-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
feat(turbopack): Implement module walking for side effect optimization #71241
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
select_part
Tests Passed |
a632653
to
b44dd1e
Compare
b44dd1e
to
5fc8e32
Compare
turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs
Outdated
Show resolved
Hide resolved
turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs
Outdated
Show resolved
Hide resolved
b279bb5
to
9e7ae8c
Compare
ee4d33a
to
6156178
Compare
9e7ae8c
to
dafce19
Compare
6156178
to
1b6f93a
Compare
dafce19
to
006967f
Compare
1b6f93a
to
4fd4165
Compare
006967f
to
6201752
Compare
4fd4165
to
ac78938
Compare
6201752
to
861424a
Compare
ac78938
to
54f24bb
Compare
54f24bb
to
d327fef
Compare
Merge activity
|
6535bf7
to
a9a4f2e
Compare
@@ -607,7 +612,9 @@ pub(crate) async fn analyse_ecmascript_module_internal( | |||
} | |||
ImportedSymbol::Symbol(name) => Some(ModulePart::export((&**name).into())), | |||
ImportedSymbol::PartEvaluation(part_id) => { | |||
evaluation_references.push(i); | |||
if !is_side_effect_free { |
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.
Without this change, all next.js tests pass (CI) but the side-effect-optimization unit test fails because of non-existing.js
.
Investigation of CI failure:# Module 2
var TracesSamplerValues;
export { TracesSamplerValues as a };
# Module 3
import { a as TracesSamplerValues } from "__TURBOPACK_PART__" with {
__turbopack_part__: -2
};
(function(TracesSamplerValues) {
TracesSamplerValues["AlwaysOff"] = "always_off";
TracesSamplerValues["AlwaysOn"] = "always_on";
TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off";
TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on";
TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio";
TracesSamplerValues["TraceIdRatio"] = "traceidratio";
})(TracesSamplerValues || (TracesSamplerValues = {})); Module 3 is skipped because it was treated as a side effect. |
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.
enable the test case for the side effects optimization
9a209c3
to
a4ee926
Compare
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.
#71241) ### What? Implement side effect optimization without creating a new `ModulePart`. This PR is `partial` because this PR does not handle the exclusion of a non-existent module perfectly. #72947 will do it. ### Why? #70336 (comment)
What?
Implement side effect optimization without creating a new
ModulePart
. This PR ispartial
because this PR does not handle the exclusion of non-existent module perfectly. #72947 will do it.Why?
#70336 (comment)
How?
Closes PACK-3494