Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR optimizes star re-exports from external modules and fixes a path rendering bug for files with dot prefixes. The optimization allows modules with unknown re-exports to have static exports info, improving code generation for ESM library output.
Changes:
- Added optimization logic to disable redundant side-effect imports when star re-exporting from external modules, rendering them as top-level
export * fromstatements - Fixed path rendering bug where files with dot prefix (e.g.,
.hidden/file.js) were not getting the required./prefix for ESM imports - Refactored ESM library plugin to move module marking logic to
optimize_dependencieshook for better timing
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_plugin_rslib/src/dyn_import_external.rs |
Added cutout_star_re_export_externals function and ExportImportedDependencyTemplate to optimize star re-exports from externals; renamed cutout_dyn_import_external to cutout_dyn_import_externals |
crates/rspack_plugin_rslib/src/plugin.rs |
Integrated new star re-export optimization, registered ExportImportedDependencyTemplate, and updated function call to use renamed function |
crates/rspack_plugin_rslib/src/parser_plugin.rs |
Changed intercept_api_plugin field visibility from public to private for better encapsulation |
crates/rspack_plugin_rslib/Cargo.toml |
Added rspack_collections and rustc-hash dependencies needed for the optimization logic |
crates/rspack_plugin_esm_library/src/plugin.rs |
Fixed path rendering to check for ./ and ../ prefixes instead of just .; refactored module marking into separate method; moved hook registration order; replaced ExternalModuleInfo::new() calls with explicit struct initialization |
crates/rspack_plugin_esm_library/src/link.rs |
Added connection activity check before processing re-exports and used connection's module identifier directly |
tests/rspack-test/esmOutputCases/externals/star-re-export/* |
New test case verifying star re-exports from externals are rendered at top level |
tests/rspack-test/esmOutputCases/externals/runtime-decide/* |
New test case for modules with dynamic exports that are decided at runtime |
tests/rspack-test/esmOutputCases/basic/hidden-folder/* |
New test case verifying files in dot-prefixed folders are rendered with correct ./ prefix |
Cargo.lock |
Updated dependencies for rspack_plugin_rslib |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 12.25KB from 48.68MB to 48.70MB (⬆️0.02%) |
Deploying rspack with
|
| Latest commit: |
938cb97
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b7404ae0.rspack-v2.pages.dev |
| Branch Preview URL: | https://feat-optimize-star-re-export.rspack-v2.pages.dev |
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
Merging this PR will improve performance by 65.29%
Performance Changes
Comparing Footnotes
|
Summary
Optimize star reexports from external module, make module with unknown reexports have static exports info
Fix path rendering bug, file with dot prefix should render as './' + file
Related links
Checklist