-
-
Notifications
You must be signed in to change notification settings - Fork 746
fix: defer import and dynamic exportsType default export mixed #12082
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
Conversation
✅ Deploy Preview for rspack canceled.
|
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.
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
|
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Summary
fix #12069
Related links
Checklist