Skip to content

Turbopack: side effects optimization cleanups #82467

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

Draft
wants to merge 3 commits into
base: canary
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
pass ModulePart correctly for FreeVarReference::EcmaScriptModule
  • Loading branch information
sokra committed Aug 8, 2025
commit 8ea38eb1b748ffaa7a4acbd6b8156e35298c068b
9 changes: 1 addition & 8 deletions turbopack/crates/turbopack-ecmascript/src/references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ struct AnalysisState<'a> {
// There can be many references to import.meta, but only the first should hoist
// the object allocation.
first_import_meta: bool,
tree_shaking_mode: Option<TreeShakingMode>,
import_externals: bool,
ignore_dynamic_requests: bool,
url_rewrite_behavior: Option<UrlRewriteBehavior>,
Expand Down Expand Up @@ -989,7 +988,6 @@ pub(crate) async fn analyse_ecmascript_module_internal(
fun_args_values: Default::default(),
var_cache: Default::default(),
first_import_meta: true,
tree_shaking_mode: options.tree_shaking_mode,
import_externals: options.import_externals,
ignore_dynamic_requests: options.ignore_dynamic_requests,
url_rewrite_behavior: options.url_rewrite_behavior,
Expand Down Expand Up @@ -2601,12 +2599,7 @@ async fn handle_free_var_reference(
span.hi.to_u32(),
),
Default::default(),
match state.tree_shaking_mode {
Some(
TreeShakingMode::ModuleFragments | TreeShakingMode::ReexportsOnly,
) => export.clone().map(ModulePart::export),
None => None,
},
export.clone().map(ModulePart::export),
state.import_externals,
)
.resolved_cell())
Expand Down