-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Turbopack: convert EcmascriptExports to a struct to be able to add more fields #84054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sokra/improve-side-effects-optimization
Are you sure you want to change the base?
Turbopack: convert EcmascriptExports to a struct to be able to add more fields #84054
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments:
turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs (line 75):
The file uses the old EcmascriptExports::Value.cell() syntax which no longer exists after the refactoring, causing a compilation error.
View Details
📝 Patch Details
diff --git a/turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs b/turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs
index 18b1c9b9c3..a565ad0322 100644
--- a/turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs
+++ b/turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs
@@ -16,7 +16,7 @@ use turbopack_core::{
use crate::{
chunk::{
EcmascriptChunkItem, EcmascriptChunkItemContent, EcmascriptChunkPlaceable,
- EcmascriptChunkType, EcmascriptExports,
+ EcmascriptChunkType, EcmascriptExports, EcmascriptExportsType,
},
runtime_functions::TURBOPACK_EXPORT_VALUE,
utils::StringifyJs,
@@ -72,7 +72,10 @@ impl ChunkableModule for InlinedBytesJsModule {
impl EcmascriptChunkPlaceable for InlinedBytesJsModule {
#[turbo_tasks::function]
fn get_exports(&self) -> Vc<EcmascriptExports> {
- EcmascriptExports::Value.cell()
+ EcmascriptExports {
+ ty: EcmascriptExportsType::Value,
+ }
+ .cell()
}
#[turbo_tasks::function]
Analysis
Compilation error: EcmascriptExports::Value syntax no longer valid
What fails: InlinedBytesJsModule.get_exports() uses outdated enum syntax EcmascriptExports::Value.cell() but EcmascriptExports was refactored from enum to struct
How to reproduce:
cd turbopack && cargo check --package turbopack-ecmascriptResult: Compilation error no associated item named 'Value' found for struct 'EcmascriptExports' in turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs:75
Expected: Should compile successfully using struct syntax EcmascriptExports { ty: EcmascriptExportsType::Value }.cell() matching other files in codebase

No description provided.