Conversation
There was a problem hiding this comment.
Pull request overview
Updates the SWC toolchain and adjusts token capturing to pre-allocate token storage based on source length for improved parsing performance.
Changes:
- Bump
swc_core(and related SWC crates) to newer major/minor versions. - Change parsing APIs to pass an optional source-length hint for token capturing (
Option<usize>), enablingCapturing::with_capacity(...). - Update generated workspace metadata to reflect the new
swc_coreversion.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/rspack_workspace/src/generated.rs | Updates the recorded swc_core version string used by the workspace. |
| crates/rspack_plugin_javascript/src/parser_and_generator/mod.rs | Passes a source-length hint to the parser to pre-allocate token storage. |
| crates/rspack_javascript_compiler/src/compiler/parse.rs | Changes token-capture flag to an optional length hint and uses Capturing::with_capacity. |
| Cargo.toml | Bumps swc_core and multiple related SWC dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 170.63KB from 48.79MB to 48.96MB (⬆️0.34%) |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 804b4d6597
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Pre-allocate token vectors with
Capturing::with_capacity(lexer, source_len + 1)to improve the performance.Checklist