Avatar for the swc-project user
swc-project
swc
BlogDocsChangelog

Performance History

Latest Results

fix(es/parser): Preserve await grammar boundaries
fix/parse-unambiguous-followup
22 minutes ago
fix(es/minifier): preserve bindings in copied inline arrows (#12141) **Description:** Cheap arrow functions stored in `Finalizer::lits` can be cloned into multiple sibling scopes while retaining the same resolved binding IDs. A later compression pass can turn each copy into an IIFE with local declarations. With mangling enabled, the shared ID can receive a short name that collides with another binding in one sibling scope, producing invalid JavaScript. This change freshens binding IDs when `Finalizer` clones an inline literal. It applies at both clone sites (identifier replacement and object-shorthand expansion), which fixes the ownership boundary instead of coupling hygiene to a later IIFE optimization. Non-binding literals keep the existing fast path. The helper also replaces the equivalent existing remapping code for cloned simple callees. The regression fixture is the exact bundle shape reported by Next.js. Its empty `expected.stdout` intentionally makes the fixture execute the generated code, so the pre-fix duplicate declaration fails with a parse error. **Validation:** - `cargo fmt --all` - `cargo clippy -p swc_ecma_minifier --lib -- -D warnings` - `cargo test -p swc_ecma_minifier --no-fail-fast` - `crates/swc_ecma_minifier/scripts/exec.sh` (484 minifier fixtures and 2,128 execution fixtures passed) - rebuilt the historical SWC native binding consumed by the affected Next.js release; the reporter's Next.js 16.3.1 app builds, starts, and renders correctly - verified passes 1/2/3, mangle on/off, toplevel on/off, object shorthand, and same-spelling collision variants - interleaved benchmark over 23 reporter server chunks: invalid outputs 1 → 0; aggregate output 569,415 → 569,403 bytes; candidate time +1.28% and +1.56% in two runs (A/A noise +0.44% and +0.28%) The workspace-wide all-target clippy command was also attempted; it is currently blocked by unrelated pre-existing unknown-lint errors in `swc_ecma_lints` and `swc_ecma_transforms_react`. The touched minifier crate's library clippy is clean. **Related issue:** - https://github.com/vercel/next.js/issues/97517 - Regression became reachable after https://github.com/swc-project/swc/pull/11021 --------- Co-authored-by: DongYun Kang <kdy.1997.dev@gmail.com>
main
2 hours ago
chore: include swc_core in changeset
fix/unsafe-wrong-ast-path
3 hours ago
test(es/minifier): cover object shorthand binding copies
marcoshernanz:codex/fix-cloned-iife-mangle-bindings
3 hours ago
test(es/typescript): Preserve mutable ambient enum reads
baltasarblanco:fix/11715-ts-enum-const-var-folding
3 hours ago
chore: add swc_visit changeset
fix/unsafe-wrong-ast-path
3 hours ago
fix(es/parser): Preserve await grammar boundaries
fix/parse-unambiguous-followup
3 hours ago
fix(visit): panic on invalid ast paths
fix/unsafe-wrong-ast-path
6 hours ago

Latest Branches

CodSpeed Performance Gauge
0%
fix(es/parser): Preserve await grammar boundaries#12156
11 hours ago
019b036
fix/parse-unambiguous-followup
CodSpeed Performance Gauge
0%
3 hours ago
e06944a
fix/unsafe-wrong-ast-path
CodSpeed Performance Gauge
0%
fix(es/minifier): preserve bindings in copied inline arrows#12141
3 hours ago
e1bf0a6
marcoshernanz:codex/fix-cloned-iife-mangle-bindings
© 2026 CodSpeed Technology
Home Terms Privacy Docs