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

Performance History

Latest Results

fix(es/minifier): avoid moved binding collisions
kdy1/fix-11977-minifier-binding
14 hours ago
fix(wasm-typescript): handle nodejs review cases
kdy1/nodejs-wasm-typescript-api
14 hours ago
chore: update anyhow for advisory
kdy1/fix-11977-mangle-collision
15 hours ago
fix(swc_core): avoid duplicate fixture builds
kdy1/nodejs-wasm-typescript-api
15 hours ago
chore: add changeset for hoisted binding collision fix
kdy1/fix-11977-mangle-collision
15 hours ago
fix(wasm-typescript): tighten nodejs helper semantics
kdy1/nodejs-wasm-typescript-api
16 hours ago
fix(es/minifier): always run hygiene before the mangler The minify pipeline skipped `hygiene()` whenever the mangler was enabled, on the assumption that the mangler renames everything hygiene would. That assumption is false: the mangler preserves names it is not allowed to rename — most importantly top-level bindings, which with the default `mangle.top_level = false` are never renamed at all. It therefore cannot deconflict a synthesized binding that collides with a preserved one. IIFE inlining hoists a parameter (or body-level `var`) binding into the enclosing scope, reusing its original nested syntax context. When that lands at the top level next to a user binding of the same name, the two collide: SyntaxError: Identifier 'x' has already been declared `hygiene()` renames one of them (e.g. to `x1`) and resolves the collision, but it was being skipped precisely in the configuration that needs it (compress + mangle, the default `@swc/core` script setup). SWC's parser does not enforce lexical redeclaration, so the invalid output shipped silently; Node rejects it at load. This surfaced in Turbopack/Next.js output, whose top-level `eval('require')` shim also disables the dead-parameter elimination that would otherwise remove the hoisted binding. Fix: run `hygiene()` unconditionally after `optimize()` in every minify entry point (`Compiler::minify`, the `transform()` minifier pass, and the node minifier binding), and mirror this in the minifier test harness. Hygiene runs after all compressor passes, so unlike a mid-pipeline rename it does not desync usage data or regress optimization. A handful of fixtures update: hygiene now disambiguates shadowed names (e.g. a nested `function n()` that the mangler had left shadowing an outer `n`) — latent bugs the same misconfiguration was producing without an error. The wasm minifier binding inherits the fix through `Compiler::minify`. Closes: https://github.com/swc-project/swc/issues/11977 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lukesandberg:fix/issue-11977-iife-mangle-collision
21 hours ago

Latest Branches

CodSpeed Performance Gauge
-2%
fix(es/minifier): avoid moved binding collisions#11981
14 hours ago
3aa4da8
kdy1/fix-11977-minifier-binding
CodSpeed Performance Gauge
0%
15 hours ago
1de0d8e
kdy1/nodejs-wasm-typescript-api
CodSpeed Performance Gauge
0%
15 hours ago
96d6c91
kdy1/fix-11977-mangle-collision
© 2026 CodSpeed Technology
Home Terms Privacy Docs