chore(deps): update swc-next to v0.2.3 - #527
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying rstack-cli with
|
| Latest commit: |
0eab404
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://764d2957.rstack-cli.pages.dev |
| Branch Preview URL: | https://soon-codex-swc-next-0-2-3.rstack-cli.pages.dev |
Formatter benchmark: SWC Next 0.2.2 vs 0.2.3The repeated
Negative changes mean lower elapsed time. The paired statistic is the median of same-round percentage changes, not the percentage difference between the two marginal medians. Method
Runtime and output verification Separate untimed traces confirmed that all eight workers actually called the intended parser version. Parser, decoder, and loaded native parser binaries were 0.2.2 for the baseline and 0.2.3 for the upgrade, with different hashes. The installed 0.2.3 native parser exactly matches the release workflow artifact; its parser/decoder JavaScript matches release commit All 92 write-mode benchmark invocations passed. Before/after hashes of all tracked source files confirmed identical output across versions. Additional checks introduced a formatting difference in one TypeScript file per repository; both versions formatted that file and restored the original bytes. Earlier check-mode measurementsThe first batch used the same cache/worker controls and 3 warmups + 20 measured runs, with
The apparent Rspack improvement did not reproduce in the write-mode rerun, so it should not be treated as a stable benefit. Since the mode also changed, these batches do not isolate the cause of the difference. Validation also passed: builds, |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Updates SWC Next parser from v0.2.2 to v0.2.3 for parser fixes and decoder improvements.
Changes:
- Bumps the shared parser catalog version.
- Refreshes lockfile entries and native platform bindings.
| File | Description |
|---|---|
pnpm-workspace.yaml |
Updates @swc-next/parser to 0.2.3. |
pnpm-lock.yaml |
Refreshes parser, decoder, and native binding entries. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Follow-up: interpreting the JS encoding and native-call timingsThe shorter native-call time in 0.2.3 does not directly measure an equivalent improvement in the Rust parser: the timing boundary changed.
SWC Next #725 introduced this approach so the native parser and decoder can reuse source bytes, alongside other bridge/decoding changes. It should not be described as simply adding a second encoding pass. For example, the JS/TS-only Rsbuild profile produced these median aggregate spans across three instrumented runs per version:
These are accumulated elapsed spans across workers, not whole-command wall times or pure CPU measurements. Public The supported conclusion is that the native call gets shorter, but including the work moved into JS leaves no clear public-parser benefit on this small-file workload. Separate JS-only, TS-only, and combined JS/TS CLI benchmarks—3 warmups and 20 measured runs per version/group/repository—also found no clear end-to-end change on either Rsbuild or Rspack; all paired 95% intervals crossed zero. This does not establish that the encoding strategy itself caused a regression. Isolating that effect requires an A/B test that holds the other parser and decoder changes constant and switches only the encoding path. |
JS-only, TS-only, and combined JS/TS formatter benchmarksI also tested JavaScript and TypeScript separately, excluding Markdown, MDX, TOML, JSON, CSS, and other formats. Each repository/group/version used 8 workers, disabled formatter and Node compile caches, 3 warmups, and 20 measured runs in balanced randomized order.
No clear performance change was detected in any group: all six paired intervals include zero. Negative changes mean lower elapsed time. The paired statistic is the median of same-round percentage changes, not the percentage difference between the two marginal medians. Method
Separate profiling of the combined JS/TS groups found that SWC public parsing plus AST materialization/adaptation accounted for roughly 9% of accumulated per-file elapsed time, while the remaining Prettier span accounted for roughly 80%. These are overlapping-worker aggregate spans, not wall-clock fractions or pure printer CPU time. Excluding document formats alone therefore does not make parser improvements dominate the CLI result. |
Motivation
Update the formatter to SWC Next v0.2.3 to include the latest parser fixes and decoder improvements.
Changes
Upgrade
@swc-next/parserfrom 0.2.2 to 0.2.3 and refresh the lockfile for its decoder and all native platform bindings.Validated with builds,
pnpm check, all 393 tests, and formatting runs on fixed Rsbuild and Rspack source snapshots. Repeated end-to-end benchmarks show no clear performance change; detailed results are provided in a PR comment.