-
-
Notifications
You must be signed in to change notification settings - Fork 787
fix: should re-export real exportInfo when export dynamic js #11776
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
base: main
Are you sure you want to change the base?
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 fixes an issue with re-exports in dynamic JavaScript modules where the wrong exportInfo
was being used for rendering. When module A re-exports from module B, the system should use the exportInfo
from module B (the source) rather than from module A (the re-exporter).
Key changes:
- Added a new
default_exported
field toExternalInterop
to properly handle default export symbols - Updated the re-export logic to use the correct
exportInfo
from the source module rather than the re-exporting module - Modified the concate modules map parameter to be mutable to allow updating interop settings
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
crates/rspack_plugin_esm_library/src/link.rs |
Core logic changes to fix re-export handling by using source module's exportInfo and adding default_exported support |
crates/rspack_plugin_esm_library/src/chunk_link.rs |
Added default_exported field and method to ExternalInterop struct for proper symbol generation |
tests/rspack-test/esmOutputCases/interop/type-module/* |
New test files to verify the re-export fix works correctly with ESM/CJS interop |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
❌ Size increased by 4.13KB from 47.89MB to 47.89MB (⬆️0.01%) |
CodSpeed Performance ReportMerging #11776 will not alter performanceComparing 🎉 Hooray!
|
5da6c87
to
76b952e
Compare
76b952e
to
34839eb
Compare
Summary
when module does reexport, there are 2
exportInfo
.when A re-export foo from B, A has exportInfo foo, and B also has exportInfo foo, should render based on exportInfo from B not A
Related links
Checklist