Turbopack: refactor export analysis#92781
Turbopack: refactor export analysis#92781mischnic wants to merge 3 commits intomischnic/refactor-esm-codegenfrom
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. |
Failing test suitesCommit: 2bec518 | About building and testing Next.js
Expand output● create-next-app with package manager yarn › should use yarn for --use-yarn flag ● create-next-app with package manager yarn › should use yarn when user-agent is yarn
Expand output● instant-navigation-testing-api › runtime params are excluded from instant shell › does not include cookie values in instant shell during page load |
Merging this PR will improve performance by 4.77%
Performance Changes
Comparing Footnotes
|
6f01c2f to
fae0c19
Compare
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
a7bfd82 to
1ea7315
Compare
569914a to
cde1798
Compare
The refactor moved import handling to a prepass but dropped the case where
an import has no specifiers but has an internal turbopack part ID (e.g.
`import "__TURBOPACK_PART__" with { ... }`). Without this, the tree-shaken
facade loses its dependency on the ModuleEvaluation part, causing side
effects to not execute.
Co-Authored-By: Claude <[email protected]>
Two fixes in imports.rs:
1. Re-exports (export { x } from '...') should always have mutable=false
since liveness is determined by the referenced module's own export
description, not the re-exporting module. The refactor incorrectly
propagated is_fake_esm to the mutable flag for re-exports, causing
setter functions to be emitted where getters are sufficient.
2. The snapshot source-map offsets shifted by 4 lines due to the above
change; regenerate the 5 affected basic-tree-shake snapshots.
Co-Authored-By: Claude <[email protected]>

Remove
ModuleReferencesVisitorand move everything into theImportMapAnalyzer