-
-
Notifications
You must be signed in to change notification settings - Fork 754
refactor: remove redirect_to in exports info #12581
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
- Add test cases for ESM reexporting CommonJS modules - Refactor exports_info code to simplify implementation - Fix missing export warnings for nested exports
✅ 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 pull request refactors the exports_info implementation by removing the redirect_to mechanism, simplifying the codebase and fixing issues with nested exports warnings in ESM-CommonJS interop scenarios.
- Removes the
redirect_tofield and all associated logic from ExportsInfoData, eliminating approximately 108 lines of code - Adds comprehensive test coverage for ESM reexporting CommonJS modules with default exports
- Updates export ordering in warning messages (now shows alphabetically sorted exports)
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_core/src/exports/exports_info.rs | Removes redirect_to field from ExportsInfoData struct and simplifies related methods by removing redirect logic |
| crates/rspack_core/src/exports/exports_info_getter.rs | Removes all redirect_to handling logic from getter methods, simplifying export info traversal |
| crates/rspack_core/src/exports/exports_info_setter.rs | Removes set_redirect_name_to method that was used to manage redirect relationships |
| crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs | Simplifies export merging logic by removing redirect_to checks and updating merge_exports to set exports_info directly |
| crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs | Removes redirect_to check from has_nested determination logic |
| crates/rspack_plugin_merge_duplicate_chunks/src/lib.rs | Removes redirect_to check from is_equally_used function, simplifying equality comparison |
| tests/rspack-test/normalCases/parsing/missing-export-warning-nested/warnings.js | Updates expected export ordering in warning messages from "default, d" to "d, default" |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/index.js | Adds test cases for ESM reexporting CommonJS modules with default exports |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/lib.js | Adds CommonJS module with named and default exports |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/reexport.js | Adds ESM module that reexports CommonJS module as namespace |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/warnings.js | Adds expected warning for missing nested export in reexported CommonJS module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 3.75KB from 48.00MB to 48.00MB (⬆️0.01%) |
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.
CodSpeed Performance ReportMerging #12581 will not alter performanceComparing Summary
Footnotes
|
Summary
This pull request improves the handling of exports when ESM modules re-export CommonJS modules. The changes refactor the exports_info implementation to simplify the codebase and fix issues with nested exports warnings.
The main improvements include:
Checklist