-
-
Notifications
You must be signed in to change notification settings - Fork 746
refactor: apply swc_experimental to rspack_plugin_esm_library and get_renamed_inline_module
#12421
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 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 codebase to use swc_experimental crates (version 0.2.0) for AST parsing and semantic analysis, replacing the previous implementation that used a custom IdentCollector visitor pattern. The refactoring applies to module concatenation logic in both the ESM library plugin and the JavaScript plugin.
Key changes:
- Bumped
swc_experimental_ecma_ast,swc_experimental_ecma_parser, andswc_experimental_ecma_semanticfrom version 0.1.1 to 0.2.0 - Migrated parsing logic to use the new experimental parser APIs
- Moved
collect_identfunction to a centralized utility inrspack_core/src/utils/concatenated_module_visitor.rsand removed the duplicate implementation fromconcatenated_module.rs
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Bumped swc_experimental crate versions from 0.1.1 to 0.2.0 |
| Cargo.lock | Updated lock file with new swc_experimental versions and their updated dependencies |
| crates/rspack_core/src/utils/concatenated_module_visitor.rs | Replaced old Visit-based IdentCollector with new collect_ident function using swc_experimental APIs |
| crates/rspack_core/src/concatenated_module.rs | Migrated to swc_experimental parser, removed duplicate collect_ident implementation, updated semantic scope handling |
| crates/rspack_plugin_javascript/Cargo.toml | Added swc_experimental dependencies |
| crates/rspack_plugin_javascript/src/plugin/mod.rs | Migrated parsing to swc_experimental, removed old Ast wrapper usage, updated imports |
| crates/rspack_plugin_esm_library/Cargo.toml | Added swc_experimental dependencies |
| crates/rspack_plugin_esm_library/src/link.rs | Migrated parsing to swc_experimental, removed old Ast wrapper usage, updated imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 28.50KB from 48.21MB to 48.19MB (⬇️0.06%) |
CodSpeed Performance ReportMerging #12421 will not alter performanceComparing Summary
|
22abe96 to
85648a5
Compare
Summary
This pr follows up to #12369
swc_experimentalcratesswc_experimentaltorspack_plugin_esm_libraryandget_renamed_inline_module. After that we can remove oldIdentCollectorChecklist