npm / @swc/core
@swc/core
What changed in @swc/core 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
8 breaking2 security16 new APIs and options9 performance8 behavior and defaults217 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@swc/core 1260 changes
Breaking changes 8
Fixes AST roundtrip bugs and implements missing conversions, changing ESTree conversion behavior.
The native addon's minimum supported Rust version is raised to 1.85.
The parser rejects unicode escapes in RegExp flags.
Adds body_ctxt to the Switch AST node, changing the AST structure.
Uses Function for object accessors in the AST, changing the AST representation.
The React Compiler no longer uses the React-like prefilter.
Fast strip now rejects unsafe assertion erasure in binary expressions.
The parser now rejects object-rest assignment to array and object literals.
Security 2
Falls back to a safe cache root on Unix.
Bindings fall back to a secure Windows profile cache.
New APIs and options 16
Code generation now supports configurable output indentation.
Bindings now allow opting out of Unix cache root security checks.
moduleRoot is supported for AMD module IDs.
Adds opt-in parser-only TSRX lowering.
Introduces FunctionBody in the AST.
Exposes reactCompiler.environment.enableFunctionOutlining as a configuration option.
The @swc/nodejs-support-wasm package was added.
The bindings add lint and lintSync APIs to @swc/react-compiler.
Adds React Compiler support to SWC.
Adds jsc.preserveSymlinks to swc::Options.
Adds support for extracting comments during minification.
Adds an opt-in resolver that preserves symlinks.
Adds support for the 2023-11 decorators proposal.
Flow stripping is enabled in @swc/core, with parser syntax support and compatibility work for core syntax gaps and Hermes parity.
npm bindings now support linux ppc64le and s390x.
Implements the named-capturing-groups regex transform.
Performance 9
Compatibility transforms skip empty block-scoping renames.
The parser scans template literals with byte search.
The first load of the macOS native addon is optimized.
Deflating browserslist reduces binary size.
Skips identity rename mappings when applying renames.
Position and source map tracking in JsWriter is faster.
Minifier profiling hotspots are reduced.
The ES parser optimizes comment finalization.
Transformer compatibility overhead is reduced.
Behavior and default changes 8
The minifier can evaluate Math.floor, Math.ceil, Math.round and additional Math functions.
The minifier expands its support for trivial spreads.
The minifier removes unused parameters for new Function or Class expressions.
The minifier removes unused parameters for new expressions.
The minifier adds fine-grained effect analysis of classes.
The minifier removes useless arguments for callees that are not inlined.
React Compiler dependency handling gains parity with upstream.
React Compiler validation and diagnostics gain parity with upstream, including early-return, hooks, memo, lint-gating, and validation aggregation behavior.
Fixes and other changes 217
The minifier checks declarations for side effects.
Compatibility transforms preserve consecutive loop labels.
Preset-env lowers for-await in native async functions.
The fixer preserves parentheses in JSX sequence expressions.
Protects long call chains from stack overflow.
With out-dir, source map paths are resolved relative to the output.
Options object deserialization failures now show why deserialization failed, making configuration errors easier to diagnose.
The HTML minifier preserves adjacent script elements.
Node.js completes Amaro REPL support APIs.
Ambient function declarations allow eval and arguments.
The parser allows trailing commas after ambient rest parameters.
Minification preserves arguments after IIFE spreads.
Minification preserves Array spread arity.
The parser preserves elisions in arrow binding patterns.
The minifier avoids inlining an arrow with this when it is used as an argument.
Minification preserves async IIFE return values.
Explicit Script parsing allows await identifiers.
The parser allows of bindings in await using loops.
Branches are preserved when assignments are collapsed.
Minification preserves catch assignments before finally blocks.
Minification preserves catch returns before finally blocks.
Minification preserves class scope when negating if-return statements.
The minifier checks class side effects.
Minification preserves computed update targets.
Minification preserves conditional assignment target order.
Minification preserves effects from constant switch tests.
Constructor function contexts are isolated.
The HTML parser preserves customizable select markup.
The parser respects line breaks after declare.
Valid declare readonly field initializers are accepted.
The parser respects line breaks before definite assignment assertions.
Minification preserves delete operand effects.
Minification preserves destructuring patterns with PURE-annotated initializers.
Properties assigned through destructuring targets are marked as mutated.
Minification preserves empty array assignments.
Minification preserves empty IIFE parameter effects.
Minification preserves empty join coercion.
Minification preserves errors from empty object destructuring.
The parser allows line breaks before enum names.
Escaped keywords are accepted as property names.
The Node binding returns an error when a file cannot be read instead of panicking.
Minification preserves finalizer breaks in switches.
Minification preserves finalizer completions.
Folded Object.keys results are deduplicated.
Minification preserves function expression names.
Minification preserves Function.length arity.
The code generator separates generic type assertion openers.
Global defs respect root bindings.
Minification preserves holes in array joins.
The parser allows line breaks before import attributes.
Flow match patterns support leading pipes.
Let initialization is preserved when unused variables are dropped.
Minification preserves lexical method defaults.
Local deletes are folded to false.
Minification preserves lone surrogate template values.
A missing codePointAt is folded to undefined.
The parser recognizes named optional and rest tuple elements.
Lowering nested object rest preserves array rest.
Non-decimal numeric literals are rounded correctly.
The minifier drops unused object pattern defaults.
Prototype setters are skipped when optimizing Object.keys.
Minification preserves throws from optional-chain continuations.
Optional-chained enum member reads are folded.
The parser accepts optional generator methods.
Property callees are hoisted safely.
Minification preserves access to reassigned arguments.
The parser accepts optional renamed Flow component parameters.
Rest params are retained in dynamic scopes.
Minification preserves rest RegExp identity.
Minification preserves returns in finalizers.
Function and class declarations are retained when their self-reference is dropped.
Minification preserves sequence IIFE argument evaluation.
Sequences are not merged across array spreads.
Minification preserves Set and Map iteration.
Minification preserves shadowed undefined yield values.
The minifier guards similar if merges.
Minification preserves spread iteration in unused builtins.
The parser resets static block context for nested declarations.
The parser accepts static constructor methods in JavaScript.
Static helper evaluation is guarded during minification.
The parser restores strict context after classes.
Minification preserves strict equality for repeated calls.
The parser allows string import and export names after type.
Minification preserves string import names.
Minification preserves string method arguments.
String.raw templates are evaluated using raw quasis.
Minification preserves switch fallthrough cases.
Template raw values are decoded when the cooked value is missing.
Tiny toPrecision calls are preserved.
toExponential formatting is made compatible.
Type references named asserts are preserved before line breaks.
Minification preserves unary comparison evaluation order.
The code generator minifies unicode escapes in template literals.
Unsafe Symbol call arguments are retained.
Minification preserves unsigned shift coercion.
The minifier checks eval and arguments usage in var define scope.
Retries parsing when a Program is ambiguous.
Preserves grammar boundaries for await expressions during parsing.
Restores await parsing in the quote feature.
Drops spans from cached globals values during minification.
Avoids replacing value-used console.*.bind() calls with undefined.
Drops parameters from a getter that replaces a decorated private method.
Preserves control-flow targets in do-while loops during minification.
Preserves Flow component type semantics.
Reports for-loop var declarations as assignments during minification.
Preserves the scope of var bindings in for-of loops during compatibility transforms.
Preserves bindings in copied inline arrow functions.
The visitor now panics on invalid AST paths.
Avoids a loop when inlining JSX sequences.
Corrects marking for update and test expressions as executed multiple times.
Keys the optimizer environment cache by configured values.
Preserves ownership of pure annotations during minification.
Preserves effects of calls whose values are returned.
Treats const variable references as enum constants.
The ES minifier preserves for init expressions.
The React transform handles apos JSX entities.
SystemJS output preserves destructuring assignment targets.
Fixes parameter injection involving bound arguments in the minifier.
Fixes an incorrect fields count in encoding.
Fixes a panic when processing JSX surrogate entities.
Prevents mutable reference escape in the ES AST.
Makes the React Compiler fast check more conservative.
Preserves this in static field parameters.
Preserves TypeScript function overload signatures in the React Compiler.
Splits TypeScript this parameters in the AST.
Lowers async generators unsupported by the target environment.
Removes unused variable initializer cycles in the minifier.
The minifier preserves non-canonical arguments access.
The minifier preserves invalid Array lengths.
The minifier applies ToInt32 when folding bitwise NOT.
Preserves top-level declarations referenced only by direct eval.
Evaluates cooked enum templates.
The TypeScript fast-strip transform preserves ASI before interpolated templates.
Preserves JSON numeric values during optimization.
The HTML minifier preserves JSON script boundaries.
Prevents class state from leaking when nested classes are undecorated.
Transforms non-finite enum values using numeric literals.
Supports hashing non-finite numbers in the JavaScript AST.
Code generation now emits non-finite numeric literals.
The minifier uses numeric literals for non-finite values.
Avoids inexact number radix folding in the minifier.
Preserves the identity of numeric property keys.
The minifier indexes strings by UTF-16 code unit.
The minifier applies ToUint16 when evaluating fromCharCode.
The TypeScript fast-strip transform preserves UTF-16 source positions.
React Compiler scope resolution for catches and parameters was corrected.
The default hygiene pass ignores eval.
The fixer now normalizes identifier patterns in for-head positions.
Fast TypeScript stripping now handles line breaks in generic arrows.
The minifier’s IIFE invocation behavior was adjusted in relation to eval.
The minifier’s IIFE invocation behavior was adjusted for cases with eval.
The React transform emits jsxdev source for fragments.
The minifier now checks the last case.
The minifier measures number length precisely.
The fixer preserves parentheses around PURE-annotated receivers.
Relative symlinked inputs are resolved from the current working directory.
The minifier preserves switch fallthrough termination.
The SystemJS transform was rewritten.
Module transforms rewrite .tsx imports to .js unless JSX is preserved.
The minifier can eliminate unused classes that have cyclic references.
Infect Collect now collects every used identifier.
The React compiler treats these blocks as variable boundaries.
The parser now parses Flow bare renders types.
The minifier performs this conversion only when the unsafe flag is enabled.
Corrects scope handling for private property brand checks in ES2022 output.
The React compiler no longer reports non-fatal success errors as diagnostics.
Preserves cooked values when the minifier concatenates template literals.
The React compiler scope collector skips TypeScript this pseudo-parameters.
Fixes React compiler AST conversion for wrapped assignment targets.
AST transforms preserve source context.
The renamer avoids duplicate mangled names across eval scope boundaries.
Code generation emits export as namespace correctly, including when minified.
The parser handles Flow async generic arrows.
Plugins no longer import __free from env.
Decorator metadata handling now supports import types.
Plugin errors preserve their context.
Fixes a sourcemap panic for multibyte mapping positions.
The fixer preserves parentheses around new tagged template callees.
Compatibility transforms rewrite this correctly in destructuring defaults.
The minifier handles unknown member properties.
The minifier now preserves object properties in default parameters.
Fast DTS now strips definite assertions in generated declarations.
The minifier now preserves arguments for destructured callbacks.
The minifier now respects ecma when generating IIFE temporary variables.
The minifier avoids generating mangled property names that collide with existing properties.
TypeScript declaration output now strips parameter binding defaults.
Self-recursive hooks are now excluded from the React refresh dependency array.
Fixes parsing of empty Flow exact object types.
Fixes the minifier to preserve sequence order in for-loop initializers.
Fixes minifier folding of unary boolean nullish coalescing expressions.
Aligns parser disambiguation for Flow generic arrows and JSX.
Fixes handling of Flow type-only modules in script transforms.
Preserves frozen spread registry keys in the minifier.
Avoids restoring module context when Flow syntax is enabled.
Adds parser support for anonymous keyof indexers in Flow.
Allows return type annotations on Flow constructors.
Supports parsing full ES version values in minify.
Preserves newlines in quoted JSX attributes.
Rewrites class references in non-static members.
The parser now handles mixed Flow anonymous callable parameters.
Preserves super references in moved static members and scopes their rewrite correctly.
The enum transformation now handles TypeScript expressions.
The minifier now inlines property shorthand in computed props.
The 2023-11 implicit-global rewrite is now scoped to decorator-lifted expressions, avoiding unintended rewrites elsewhere.
The parser closes Flow syntax gaps by parsing key Flow forms.
The minifier now caps deep if_return conditional chains.
The regexp transform preserves source for wrapped named groups.
HTML code generation keeps the closing paragraph tag for paragraphs with a span parent.
The minifier now handles toExponential(undefined).
Preserves an explicit index.js import path when baseUrl is set.
Resolves issues with the 2022-03 decorators behavior.
The Rust CLI binary now honors externalHelpers=false.
The fixer now wraps newly generated optional chains.
Skips mkdir when the output file targets the current directory.
Module rewriting now avoids changing unknown relative extensions.
Falls back to the system allocator on linux gnu s390x and powerpc.
Fixes minifier compatibility for Wasm plugins using swc_ast_unknown.