SWC v1.15.43 Lands the React Compiler as a First-Class Transform, Fixes a Silent Template Literal Minifier Bug, and Aligns `unsafe_math` with Terser

SWC v1.15.43 Lands the React Compiler as a First-Class Transform, Fixes a Silent Template Literal Minifier Bug, and Aligns `unsafe_math` with Terser

lschvn

SWC v1.15.43, published on 2026-06-22 with swc_core v71.0.3, is the first SWC release that ships the Rust React Compiler as a configurable transform, fixes a silent template literal minifier bug that affected every rspack and rsbuild user, and aligns the unsafe_math minifier flag with terser v4.3.11+. The release is the seventeenth 1.15.x patch in the SWC 1.15 cycle that has run since early 2026 and the first to land on top of swc_core v71.

The headline work is in three places: the swc_ecma_react_compiler bridge that lands the React Compiler as a first-class SWC transform, the template literal concat_tpl fix that closes the silent minifier bug, and the unsafe_math behavior change that brings SWC into parity with terser. Seven internal React Compiler fixes, an ES2022 brand-check scope fix, a parser no-default builds fix, a docs entry on untrusted input security, and the production tracing hooks removal round out the release.

The template literal minifier bug

The most user-impactful change in v1.15.43 is fix(es/minifier): Preserve cooked when concatenating template literals (#11939, kdy1). The pre-v1.15.43 concat_tpl pass folded a + b when both sides were template literals by merging the boundary quasis: the last quasi of the left template was concatenated with the first quasi of the right template, and the merged quasi was emitted with raw set to the concatenation of the two raw strings. The cooked slot was not touched.

That asymmetry was the bug. Downstream passes (eval_tpl_as_str, eval_nested_tpl, compress_tpl) evaluate the template to a string via cooked, so the text after the left template's last interpolation was silently dropped. The result was wrong but not a syntax error, so it shipped.

The reproducer in the PR description is `<b>${1}</b>` + `<i>${2}</i>`. Pre-v1.15.43, the minifier emitted <b>1<i>2</i> (note: the closing </b> is gone). The expected output is <b>1</b><i>2</i>. The same pattern affects any concatenation of two template literals that both contain at least one interpolation: `${1}px` + `${2}px` minified to ${1}${2}px with the wrong delimiter. The bug only fired when compress: true was set, which is the default in rspack's optimization.minimize and rsbuild's output.overrideBrowserslist minify path.

The fix updates cooked in the Tpl + Tpl branch of concat_tpl the same way raw is updated, falling back to None if either side's cooked is None (which signals an invalid escape sequence). The sibling branches Tpl + Str and Str + Tpl already merged cooked correctly; only the Tpl + Tpl branch was missing it. The PR adds an exec regression test that runs the original and the minified code and compares the output, plus 49 lib tests and 481 exec tests in the affected swc_ecma_minifier crate.

The PR description notes that the bug also surfaces through every bundler that wraps SWC's JS minifier, including rspack and rsbuild. Users who want to verify the fix on a known-bad input can run the smallest reproducer from the PR:

require("@swc/core").minifySync("x = `a${0}]` + `${0}b`", { compress: true }).code
// pre-v1.15.43:  x="a00b";
// post-v1.15.43: x="a0]0b";

The React Compiler as a first-class SWC transform

The headline feature is feat(es/react-compiler): Add React Compiler (#11917, kdy1), the 12,986-addition, 54-file PR that lands the Rust React Compiler as a configurable SWC transform. The integration adds the swc_ecma_react_compiler bridge crate, the SWC <-> React Compiler AST and scope conversion layer, the .swcrc jsc.transform.reactCompiler configuration field, diagnostics forwarding from the React Compiler's HIR to SWC's Handler, and JS / WASM option types. The transform is gated behind the react_compiler feature flag in swc_core v71.0.3 and is currently experimental.

The Rust React Compiler itself is the work in facebook/react#36173 (merged 2026-06-09, by Mofei Z and the React Compiler team), which ported the original TypeScript React Compiler to Rust as a Babel-AST-in / Babel-AST-out library with three example integrations (Babel, Oxc, SWC). The architecture uses a Babel-style AST as the public API and converts to and from the native representation of each integration; SWC's bridge converts between SWC's ESTree-flavored AST and the React Compiler's Rust Babel AST.

The PR description is explicit about the not-yet-published crates dependency:

Wait for the React Compiler Rust crates to be published, then replace the temporary git dependencies with published crate versions.

Until that lands, the integration uses git references to the upstream facebook/react Rust workspace, which means downstream consumers (rspack, rsbuild, custom SWC users) need to build swc_core from a git source if they want to experiment. The PR title is Add React Compiler and the entry in the CHANGELOG is feat(es/react-compiler): Add React Compiler; the feature is the third React Compiler integration story in the tooling press, after Bun's bundler integration on 2026-06-20 (PR bun#32504) and the Oxc v0.137 React Compiler treeshake hooks on 2026-06-18 (PR oxc#23471, oxc#23586).

The user-facing config field is jsc.transform.reactCompiler in .swcrc. The shape is documented in the PR but not yet in the published swc crate docs; the experimental flag is the way to opt in.

The unsafe_math behavior change

The third headline change is fix(es/minifier): Gate Number(x) -> +x on unsafe flag (#11944, with the follow-up in #11949). The pre-v1.15.43 SWC minifier rewrote Number(x) to +x whenever unsafe_math: true was set, even with unsafe: false. Terser since v4.3.11 has required BOTH unsafe: true AND unsafe_math: true for the same rewrite.

The asymmetry is documented in #11944: a TypeScript source export function foo(x) { return Number(x) } with unsafe: false, unsafe_math: true minifies in SWC to +x and in terser to Number(x). The two outputs differ on every bundle that uses the unsafe-math-only config, which is the documented Terser option for "safe-enough" minification of mathematical expressions.

The v1.15.43 fix gates the rewrite on both flags, matching terser. The change is behavior-breaking for users who relied on the SWC behavior: with unsafe: false, unsafe_math: true, the minifier now preserves Number(x). The fix is documented in the CHANGELOG and the docs entry on untrusted input security scope (#11937) adds a section to the README that clarifies the security boundary for SWC's parser and process_print entrypoints.

The React Compiler internal fixes

Seven internal React Compiler fixes land alongside the bridge integration. The fixes are smaller than the bridge itself but they are the work that makes the bridge usable for real codebases.

  • fix(es/react-compiler): Skip TypeScript this pseudo-params in scope collector (#11940, mofeiZ) tells the scope collector to ignore the synthetic this parameters that tsserver adds to TypeScript methods.
  • fix(es/react-compiler): Scope ClassStaticBlock and TsModuleBlock as var boundaries (#11943, mofeiZ) treats ClassStaticBlock (the static { ... } block in ES2022 class bodies) and TsModuleBlock (the body of namespace foo { ... } and module foo { ... }) as scope boundaries, so declarations inside them do not leak into the enclosing scope.
  • fix(react-compiler): Avoid reporting non-fatal success errors as diagnostics (#11951, mofeiZ) stops the React Compiler from reporting its own success markers as user-visible errors, which was producing noisy cargo test output.
  • fix(react-compiler): React compiler AST conversion for wrapped assignment targets (#11952, mofeiZ) handles assignments to wrapped expressions like (a.b).c = 1, which the bridge previously failed to convert.
  • fix(react-compiler): Disable parser default features (#11957, mofeiZ) tightens the parser feature set so the bridge does not pull in parser features that conflict with the React Compiler's scope model.
  • chore(es/react-compiler): Update forked react compiler to 0.2.0 (#11946) updates the internal forked React Compiler to 0.2.0, which brings the bridge in line with the upstream Rust compiler.
  • refactor(es/react-compiler): Preserve TS metadata during AST roundtrip (#11950, mofeiZ) keeps the TypeScript-specific metadata on the AST when the bridge round-trips from SWC's ESTree-flavored AST to the React Compiler's HIR and back.

The feature flag for the re-export of the React Compiler transform is feat(swc): Gate react compiler re-export (#11941), which means the swc crate's react_compiler module is behind the same react_compiler feature flag as the bridge crate. Downstream users who want the JS / WASM bindings need to enable both.

The ES2022 brand check scope fix

fix(es/es2022): Correct scope for private property brand checks (#11953) tightens the scope tracking for the ES2022 private-field brand check. The #field in obj syntax is the runtime check that decides whether a private field is accessible from a given call site; the pre-v1.15.43 implementation tracked brand checks at the wrong scope level, which caused some private-field accesses to be reported as errors when they were not, and some to be allowed when they were not. The fix scopes the brand check to the class the field is declared on, matching the spec.

The fix is the third ES2022 correctness fix in the SWC 1.15 cycle, after the private-method super rewrite fix in v1.15.39 and the static initialization block scope fix in v1.15.41. ES2022 private fields are still a work in progress in tooling; the fix does not change the parser surface, only the transform pass.

What v1.15.43 does not change

The release does not change the parser surface, the React Compiler's public API beyond the new transform, or the public swc_ecma_* crate APIs. The minifier's CompressOptions defaults match v1.15.41; the new unsafe_math behavior is gated on the existing unsafe flag. The swc_core v71.0.3 bump is the work that lands the react_compiler feature flag in the published swc_core crates; the v71 line is the first to carry it.

The release also removes the production tracing hooks (refactor: Remove production tracing hooks, #11945, kdy1). The pre-v1.15.43 SWC binary shipped with tracing hooks that could be enabled via the SWC_TRACE environment variable for production debugging; the hooks added a small but measurable cost on every parse / transform call. The v1.15.43 release removes the hooks entirely, with the trade-off that production tracing is no longer available without a debug build.

What to watch

Three follow-ups are likely in the next two to six weeks. The first is the publication of the React Compiler Rust crates on crates.io, which unblocks the integration from the temporary git dependency to a published version and lets rspack and rsbuild ship the transform in their next stable releases. The second is the next swc_core minor release (v71.0.4 or v71.1.0), which is likely to ship more of the React Compiler's HIR passes exposed as SWC transforms. The third is the next Oxc crates release, which is scheduled for Monday 2026-06-29 and is the first crates release not in the v0.137 cycle; it is likely to carry more React Compiler hooks that complement the SWC bridge.

Frequently Asked Questions

Astro 7.0.0 Stable Ships Vite 8, Makes the Rust Compiler Default, Adds a Background Dev Server for AI Coding Agents, and Promotes Route Caching, Advanced Routing, and Sätteri to First-Class

Astro 7.0.0, published on 2026-06-22, lands the 7.0 stable branch after ten weeks of beta. The headline changes: a Vite 8 upgrade, the Rust-based Astro compiler as the default (the Go compiler is removed), the Sätteri Markdown pipeline as the default (remark/rehype moves out of the default install), advanced routing promoted from experimental (with src/fetch.ts as the new default entrypoint), route caching promoted from experimental (top-level cache and routeRules, with cacheNetlify() and cacheVercel() providers landing in the same release), a background dev server mode designed for AI coding agents (astro dev --background, .astro/dev.json lockfile, astro dev stop|status|logs), compressHTML: 'jsx' as the new default, the @astrojs/db package removed, and every official integration bumped a major version (vue 7, react 6, svelte 9, preact 6, solid-js 7, vercel 11, netlify 8, node 11). create-astro@5.1.0, shipped in the same release wave, now writes an AGENTS.md file into every new project with a CLAUDE.md symlink pointing at it.

Oxlint v1.71 and Oxfmt v0.56 Ship the v0.137 Crates Wins, Land 18 New Linter Rules, and Tame React Lifecycle Traversal with a Streamed-Iterator Refactor

Oxlint apps_v1.71.0 and oxfmt apps_v0.56.0, both published on 2026-06-22, close out the v0.137 crates cycle. Oxlint v1.71 picks up the new treeshaking pure typed arrays minifier pass (#23469), the prefer-query-selector compound selector fix, 28 lint bug fixes (most of them Yunfei He's fixer-rewrite work), 13 performance entries anchored on a bucketed rule dispatch refactor (#23450, #23452, #23482-#23486, #23489, #23492), and the oxlint Tokio-on-LSP-only startup (#23447). Oxfmt v0.56.0 ships 9 bug fixes (CRLF normalization for `// @ts-ignore` suppressed text in #23701 and #23702, the member-chain panic fix #23698, the default-export-with-type-cast preservation #23697) and 3 formatter performance entries that remove arena copies on bigint, numeric-literal, and string-literal text. v1.71 is the first apps release since v1.70.0 on 2026-06-15, and the last one before the v0.138 crates release that will land on Monday 2026-06-29.

Related articles

More coverage with overlapping topics and tags.

Oxlint v1.71 and Oxfmt v0.56 Ship the v0.137 Crates Wins, Land 18 New Linter Rules, and Tame React Lifecycle Traversal with a Streamed-Iterator Refactor
tooling

Oxlint v1.71 and Oxfmt v0.56 Ship the v0.137 Crates Wins, Land 18 New Linter Rules, and Tame React Lifecycle Traversal with a Streamed-Iterator Refactor

Oxlint apps_v1.71.0 and oxfmt apps_v0.56.0, both published on 2026-06-22, close out the v0.137 crates cycle. Oxlint v1.71 picks up the new treeshaking pure typed arrays minifier pass (#23469), the prefer-query-selector compound selector fix, 28 lint bug fixes (most of them Yunfei He's fixer-rewrite work), 13 performance entries anchored on a bucketed rule dispatch refactor (#23450, #23452, #23482-#23486, #23489, #23492), and the oxlint Tokio-on-LSP-only startup (#23447). Oxfmt v0.56.0 ships 9 bug fixes (CRLF normalization for `// @ts-ignore` suppressed text in #23701 and #23702, the member-chain panic fix #23698, the default-export-with-type-cast preservation #23697) and 3 formatter performance entries that remove arena copies on bigint, numeric-literal, and string-literal text. v1.71 is the first apps release since v1.70.0 on 2026-06-15, and the last one before the v0.138 crates release that will land on Monday 2026-06-29.
Oxc v0.137 Teaches the Minifier to Treeshake Pure Typed Arrays and Set/Map Literals, Lands an Incremental Scoping Refresh, and Fixes a React Compiler Edge Case
tooling

Oxc v0.137 Teaches the Minifier to Treeshake Pure Typed Arrays and Set/Map Literals, Lands an Incremental Scoping Refresh, and Fixes a React Compiler Edge Case

Oxc release crates_v0.137.0, published on 2026-06-18, ships two new minifier passes (treeshake pure typed arrays and Set/Map array literals via #23469, and inline const values for read-only vars via #22593), a long-running incremental scoping refresh that retires the LiveUsageCollector collector entirely (#23197), a friendly parser error for adjacent JSX elements (#23378), a React Compiler bug fix for computed-key imports (#23586), and two breaking changes to the ESTree config API (#23573, #23574). The minifier pass list also gets a Proxy-aware object-introspection fix (#23483) and a new Map/WeakSet/WeakMap preservation rule for string arguments (#23470). v0.137 is the first crates release since v0.135 on 2026-06-08 and the second since Bun's native React Compiler integration landed on 2026-06-20.
Bun Integrates the React Compiler Directly Into Its Bundler, Roughly 20x Faster Than the Babel Plugin
tooling

Bun Integrates the React Compiler Directly Into Its Bundler, Roughly 20x Faster Than the Babel Plugin

PR #32504, merged into oven-sh/bun on June 20, 2026, turns the upstream React Compiler Rust port into a built-in `bun build` transform behind `--react-compiler` and `Bun.build({ reactCompiler: true })`. Bun ports the upstream `facebook/react` `compiler/crates/` workspace directly into a single `src/react_compiler/` crate (~62k LOC) instead of going through Babel, SWC, or Oxc, and on a large React codebase (around 860 components, 1400 memo slots) the compiler pass runs in 465 ms versus 9.15 s for the Babel plugin. The feature is experimental, off by default, and ships with `reactCompilerOutputMode` (client or ssr) and a `scripts/sync-react-compiler.sh` re-sync helper.

Comments

Log in Log in to join the conversation.

No comments yet. Be the first to share your thoughts.