refactor: use swc_experimental on concatenated module #12369
Conversation
✅ Deploy Preview for rspack canceled.
|
240bcab to
da64957
Compare
📦 Binary Size-limit
❌ Size increased by 476.50KB from 47.69MB to 48.16MB (⬆️0.98%) |
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 |
CodSpeed Performance ReportMerging #12369 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase to use the experimental SWC parser (swc_experimental) instead of the traditional SWC parser. The main motivation is performance improvement, with a 14% improvement observed in the analyze_module function according to codspeed benchmarks.
Key Changes:
- Migrated parsing and semantic analysis in
concatenated_module.rsfrom traditional SWC APIs to experimental SWC APIs - Updated string formatting in unrelated files to use modern inline format strings
- Added three new dependencies:
swc_experimental_ecma_ast,swc_experimental_ecma_parser, andswc_experimental_ecma_semantic(all at version 0.1.1)
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_core/src/concatenated_module.rs | Refactored parsing and identifier collection to use experimental SWC parser and AST; replaced visitor-based approach with direct node iteration |
| crates/rspack_core/Cargo.toml | Added dependencies for experimental SWC packages |
| Cargo.toml | Declared workspace-level versions for experimental SWC packages |
| Cargo.lock | Updated dependency lock with experimental SWC packages and minor version bumps for transitive dependencies |
| xtask/src/release_check/mod.rs | Updated string formatting to use inline format strings |
| crates/rspack_javascript_compiler/src/compiler/transform.rs | Updated string formatting to use inline format strings |
| tests/rspack-test/diagnosticsCases/module-parse-failed/concatenate_parse_module/stats.err | Updated expected test output to match new parser error message format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
📝 Benchmark detail: Open
|
Summary
Sadly there's no apparent performance improvement on my machine.
But we can see slightly improvement (16%) on analyze_module function on codspeed
Checklist