fix: defer import and dynamic exportsType default export mixed#12082
fix: defer import and dynamic exportsType default export mixed#12082
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements tracking of non-deferred access to deferred modules in module concatenation, ensuring that when a deferred module is accessed in a non-deferred context, the evaluation order is correctly maintained. The changes primarily affect how concatenated modules handle mixed defer/non-defer imports.
- Adds
NonDeferAccesstracking to distinguish defer vs non-defer module access - Refactors module evaluation order to hoist deferred namespace object definitions
- Removes unused
ExportsInfoGetterimports andruntime_conditionfield fromExternalModuleInfo
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rspack-test/configCases/defer-import/dynamic-default-mixed/rspack.config.js | Test configuration for mixed defer/non-defer imports |
| tests/rspack-test/configCases/defer-import/dynamic-default-mixed/reexport.js | Test module demonstrating deferred and default imports |
| tests/rspack-test/configCases/defer-import/dynamic-default-mixed/index.js | Test case verifying correct default export with module concatenation |
| tests/rspack-test/configCases/defer-import/dynamic-default-mixed/dynamic.cjs | CommonJS module with dynamic ES module flag |
| crates/rspack_plugin_esm_library/src/plugin.rs | Removes unused ExportsInfoGetter import and runtime_condition field usage |
| crates/rspack_core/src/concatenated_module.rs | Core implementation of NonDeferAccess tracking and refactored module evaluation order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
🎉 Size decreased by 6.13KB from 47.86MB to 47.85MB (⬇️0.01%) |
CodSpeed Performance ReportMerging #12082 will not alter performanceComparing Summary
|
Summary
fix #12069
Related links
Checklist