Commit Graph
145 Commits
Author SHA1 Message Date
camc314 3fd78d7451 fix(codegen): preserve names in duplicate source mappings (#26051)
When an unnamed parent node and a mangled identifier begin at the same source position, codegen deduplicated the identifier mapping. This retained location data but discarded the original identifier name, leaving consumers unable to restore inferred function names in source-mapped Node stack traces.

```mermaid
flowchart LR
    A[AssignmentExpression mapping<br/>unnamed] --> B[Token at source position P<br/>name: none]
    C[Identifier mapping<br/>name: longName] --> D{Same source position P?}
    D -->|before| E[Drop duplicate<br/>names: empty]
    D -->|after| F[Enrich existing token<br/>name: longName]
```

### Changes

- Cache whether the last emitted token has a name, keeping duplicate-position handling cheap in the source-map builder hot path.
- Enrich an unnamed duplicate token when a later identifier mapping supplies the original name.
- Add a unit regression test for the builder behavior.
- Extend the existing Node source-map stack-trace snapshot test with a mangled ES module fixture.

The Node fixture verifies:

```text
function longFunctionName(longName) { ... }
            ↓ mangled
function e(e) { ... }
```

and asserts that the source map includes both original names while Node restores the inferred inner frame as:

```text
at longName (/project/input.js:6:15)
```
2026-11-03 02:22:04 +00:00
oxc-guard f799f174b5 release(crates): oxc v0.157.0 (#28719)
### 🚀 Features

- 8dd67a6 transform-react: Expose TypeScript transform options (Tomas Särnhammar)
- deed7dc parser: More friendly error for duplicate import attribute key (#28262) (sapphi-red)

### 🐛 Bug Fixes

- eaa8e90 ecmascript: Avoid numeric `+` folding when an operand may be a string (#28544) (camc314)
- b03c7b8 regular_expression: Allow incomplete oversized legacy quantifiers (#28449) (Boshen)
- 128c67d semantic: Check strict eval and arguments writes by reference flags (#28445) (Boshen)
- c97c43c parser: Reject TypeScript default exports in JavaScript (#28440) (Boshen)
- fdd119f span: Count Unicode characters when filtering typo suggestions (#28452) (Boshen)
- cb64638 regular_expression: Reject incomplete Unicode atom escapes (#28448) (Boshen)
- fc0eed3 semantic: Stop let-binding scans at arrow functions (#28444) (Boshen)
- 3421516 parser: Preserve default import names in reexports (#28442) (Boshen)
- a1e7e5f parser: Reject optional class members in JavaScript (#28439) (Boshen)
- 5b9a7bc parser: Parse sloppy let expressions and labels (#28438) (Boshen)
- 8e61652 regex: Reject templates without cooked values (#28345) (Boshen)
- 3b36543 parser: Preserve in-context after TypeScript type arguments (#28300) (Boshen)
- 2e3126c regex: Decode constructor patterns and flags consistently (#28298) (Boshen)
- 8a90be2 regex: Track capture groups and disjunction identity (#28297) (Boshen)
- 3dc2cb0 regex: Preserve escape values and boundaries (#28296) (Boshen)
- fc8acbc parser: Handle leading-zero numeric exponents (#28295) (Boshen)
- 91a638d parser: Normalize raw template line endings with invalid escapes (#28285) (Boshen)
- 2ac9a42 parser: Allow parenthesized private-in expressions (#28284) (Boshen)
- 052bca9 ast: Prevent greyed out fields in AST types in IDEs (#28335) (overlookmotel)
- ed7df7d ast/estree: Include comments in TS Program span (#28326) (camc314)

### ⚡ Performance

- 9b6b7bf regular_expression: Advance validated Unicode escapes directly (#28514) (Boshen)
- 82e1982 regular_expression: Share Unicode property name prefixes (#28513) (Boshen)
- 5395a40 regular_expression: Parse class set character prefixes once (#28512) (Boshen)
- 3708934 regular_expression: Defer literal range dash allocation (#28511) (Boshen)
- d85ee3d semantic: Skip arguments ancestry checks outside classes (#28510) (Boshen)
- cf81d07 semantic: Reuse private reference resolution (#28509) (Boshen)
- a79eebc semantic: Avoid duplicate maps for public JavaScript members (#28508) (Boshen)
- 235ca3b semantic: Skip escape checks for unescaped strings (#28507) (Boshen)
- babf44c parser: Reuse shorthand assignment target identifiers (#28504) (Boshen)
- 444f24a ecmascript: Short-circuit simple parameter checks for rest (#28503) (Boshen)
- 04b20c0 semantic: Compute duplicate parameter policy once per list (#28446) (Boshen)
- dbf8482 parser: Use token lookahead for simple function types (#28489) (Boshen)
- bca1275 parser: Avoid unused destructuring rest capacity (#28499) (Boshen)
- 691be5c parser: Compact cover initialized name storage (#28495) (Boshen)
- b3b5444 parser: Build simple arrow bindings directly (#28493) (Boshen)
- e1c9baf parser: Disambiguate single-identifier arrow heads (#28491) (Boshen)
- 550e98a regular_expression: Avoid rescanning unique capture names (#28450) (Boshen)
- 10e9fc7 parser: Skip duplicate lookup for singleton import attributes (#28441) (Boshen)
- 5238839 parser: Use a stack buffer for float separators (#28435) (Boshen)
- 6e35e3c parser: Fast-path leaf expressions before delimiters (#28432) (Boshen)
- 3d7512c parser: Decode Unicode identifiers once (#28414) (Boshen)
- 30f59f4 parser: Factor object type opening brace (#28430) (Boshen)
- 028a267 parser: Always inline postfix update parsing (#28429) (Boshen)
- 1b5a171 parser: Reuse export kind classification (#28424) (Boshen)
- 179a432 parser: Factor return type identifier parsing (#28416) (Boshen)
- 553dd1d parser: Inline hot paths and fold function dispatch (#28404) (Boshen)
- de75d56 parser: Combine parenthesized arrow lookahead (#28412) (Boshen)
- a768a0c parser: Reuse comment annotations after rewind (#28408) (Boshen)
- 563d92a parser: Skip redundant source cursor updates (#28409) (Boshen)
- 7941ca9 parser: Factor tuple identifier parsing (#28398) (Boshen)
- 426c151 parser: Construct completed tokens without intermediate writes (#28291) (Boshen)
- df42953 minifier: Don't request another pass for block unwrapping (#28315) (Dunqing)
- c2d663d parser: Avoid vectors for single parenthesized expressions (#28374) (Boshen)
- 50bd0a9 parser: Size delimited lists after the first element (#28373) (Boshen)
- bd869b5 parser: Bypass redundant operand parsing (#28372) (Boshen)
- 455fc09 parser: Skip keyword checks for plain identifier expressions (#28371) (Boshen)
- 61303fb parser: Fast-path identifier operands (#28306) (Boshen)
- 6cf5b1a parser: Guard arrow and conditional parsing (#28305) (Boshen)
- 3666939 parser: Specialize identifier reference parsing (#28303) (Boshen)
- 0d6641a parser: Skip inapplicable expression parsing paths (#28294) (Boshen)
- 3be7997 parser: Reduce lexer search batch size (#28292) (Boshen)
- ab5655a regex: Remove redundant character-class and quantifier checks (#28288) (Boshen)
- ec8e8d4 parser: Remove redundant grammar and lexer checks (#28287) (Boshen)
- c903f5c parser: Specialize known-token parsing (#28286) (Boshen)
- 2683225 str: `static_ident!` and `static_str!` macros guarantee const evaluation (#28340) (overlookmotel)
- df90836 ast: Reduce compile time of `#[ast]` macro (#28336) (overlookmotel)
- 8239dac parser: Replace dragonbox_ecma with zmij_ecma (#28282) (Boshen)
2026-11-02 19:40:44 +00:00
oxc-guard[bot]andDunqing 75efdca474 release(crates): oxc v0.156.0 (#28190)
### 💥 BREAKING CHANGES

- cf8296f ecmascript: [**BREAKING**] Fold surrogate strings with JSStr
constants (#27098) (Dunqing)

### 🚀 Features

- dd6cb2b minifier: Fold out-of-bounds string indices to `void 0`
(#28004) (Dunqing)

### 🐛 Bug Fixes

- f4dac9e semantic: Separate hoisted vars from block type bindings
(#27936) (limadog9)
- 9ec6617 minifier: Keep brackets on negative and non-finite numeric
keys (#27855) (Yunus Ozen)
- 520a26e minifier: Keep the default in shorthand assignment targets
(#28183) (waltu)
- def47b8 react-compiler: Keep manual memoization as written when its
dependencies can't be honoured (#28101) (Dunqing)
- 704d8cf transformer_plugins: Keep the bare inject when references to
it remain (#26965) (Bharadwaj Pendyala)
- 6d7b372 minifier: Handle sequence exprs when folding if to expr
statement (#27939) (Armano)
- e3eca41 runtime: Align async iterator throw with Babel (#28059)
(camc314)
- af0258d parser: Parse source imports named type (#28062) (camc314)
- 83633a7 parser: Parse escaped class field names after initializers
(#28061) (camc314)
- 90c58ac parser: Parse postfix updates of sloppy `let` identifiers
(#28060) (camc314)
- 0e2934f codegen: Preserve default import names in source maps (#28058)
(camc314)
- 09bdb80 minifier: Allow argument rewrite with with leading var
assignments (#28056) (Armano)
- ebcdcd9 minifier: Preserve rest destructuring side effects (#27981)
(camc314)
- 5c84098 semantic,linter: Report names with lone surrogates in enum and
lint checks (#27991) (Dunqing)
- bd70a9b ecmascript: Use ECMAScript whitespace when folding
`parseFloat`/`parseInt`/`trim` (#27719) (Dunqing)
- 4c0fa90 minifier,linter: Keep `delete` of constant members and later
JSX keys (#27990) (Dunqing)

### ⚡ Performance

- 3493ce3 minifier: Reuse is_error_constructor and simplify
substitute_global_new_expression (#28149) (Armano)
- a22c9f2 parser: Move annotation comment handling out of hot paths
(#28139) (camc314)
- 1ed93af data_structures: Copy short strings without a memcpy call
(#27953) (leaysgur)

### 🛡️ Security

- b93e169 deps: Bump .node-version to 26.12.1 (#28090) (leaysgur)

Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
2026-10-27 11:19:24 +08:00
camc314 0e2934fbe6 fix(codegen): preserve default import names in source maps (#28058)
Default imports with escaped identifiers (for example, `import s\u006furce from "./a.js"`) lose their original spelling from JS codegen source maps. The default-import printer records an unnamed mapping for the specifier instead of a named mapping for its local identifier.

Use the same named identifier mapping as the other import forms. Add regressions for default imports, type-only imports, and defaults combined with named or namespace imports; each compares code and complete source maps against Rust in both parenthesis modes.

Exposed by the TypeScript fixture update in #28057 and [this failed CI job](https://github.com/oxc-project/oxc/actions/runs/39690771786/job/119536110779). Stack: this fix targets `main`; #28057 targets this branch.
2026-10-21 23:58:27 +00:00
oxc-guard 73e6b56473 release(crates): oxc v0.155.0 (#27962)
### 💥 BREAKING CHANGES

- c7d229b transformer: [**BREAKING**] Decode JSX entities to lone surrogates (#26712) (Dunqing)
- e3c1b11 ast: [**BREAKING**] Preserve lone surrogates in static property names (#27095) (Dunqing)
- a0a987c ast: [**BREAKING**] Preserve lone surrogates in static member names (#26677) (Dunqing)

### 🚀 Features

- 7bb2697 minifier: Minimize array join expression (#27905) (Armano)
- 5d91db8 ast: Generate node ID setters for enums (#27500) (camc314)
- 6b5057b minifier: Add de morgan optimization for void expressions (#27375) (Armano)

### 🐛 Bug Fixes

- ce6a088 minifier: Fold string indices by UTF-16 code unit (#27096) (Dunqing)
- 7c47246 linter: Check module specifiers and string values that contain lone surrogates (#26717) (Dunqing)
- 782ab6e linter: Search string values without UTF-8 conversion (#26716) (Dunqing)
- a5d8184 jsdoc: Parse code spans after quotes in descriptions (#27955) (leaysgur)
- bd37e78 ecmascript: Look through sequence expressions in `to_primitive` (#27837) (baltasarblanco)
- d92789d minifier: Drop debugger statements in unbraced bodies (#27867) (camc314)
- 863b359 ecmascript: Correct parseFloat decimal prefix scanning (#27695) (camc314)
- a2534c6 minifier: Preserve lexical initializers in dead for loops (#27676) (camc314)
- 3543672 ecmascript: Do not fold Number.isInteger / isSafeInteger of tiny non-integers to true (#27622) (Baltasar Blanco)
- 6987a61 ecmascript: BigInt loose equality folding (unknown operands and `StringToBigInt`) (#27656) (Baltasar Blanco)
- 40e5644 minifier: Preserve indirect access when folding into call targets (#27082) (waltu)
- 022306f ecmascript: Do not fold `Math.cbrt` of a negative number to `NaN` (#27621) (Baltasar Blanco)

### ⚡ Performance

- faa75d8 transformer: Remove redundant scratch vectors (#27922) (camc314)
- 88b5c35 minifier: Reduce code branches when evaluating roots (#27906) (Armano)
- fe1d367 codegen: Remove branches from loops printing arrays (#27840) (overlookmotel)
- 7bb6b62 codegen: Reduce hashmap lookups in `print_annotation_comment` (#27845) (overlookmotel)
- 31ffd08 codegen: Avoid unnecessary comment clone (#27843) (overlookmotel)
- a6456b7 codegen: Remove branch from `print_space_before_identifier` (#27842) (overlookmotel)
- eeff416 codegen: Simplify `print_space_before_identifier` (#27841) (overlookmotel)
- 5d877b8 diagnostics: Speed up zero-context span lookups (#27770) (camc314)
- 2ab6b63 packages/codegen: Remove redundant `printSpaceBeforeIdentifier` and `last` updates in `printParams` (#27652) (overlookmotel)
- e533278 codegen: Reduce writes in `printDecorators` (#27651) (overlookmotel)

### 📚 Documentation

- 29caafd codegen: Format table in doc comment (#27839) (overlookmotel)
- 3de03c1 packages/codegen: Correct outdated comments (#27838) (overlookmotel)
2026-10-19 14:20:38 +00:00
overlookmotel 3de03c1bed docs(packages/codegen): correct outdated comments (#27838)
Comments-only change. Correct comments saying the printer does not support `ParenthesizedExpression`. This isn't true - it does!
2026-10-16 18:07:16 +00:00
overlookmotel 2ab6b63df5 perf(packages/codegen): remove redundant printSpaceBeforeIdentifier and last updates in printParams (#27652)
Perf optimization.

When printing function params, use `writeNoLast` over `write` where it's provably safe to do so.
2026-10-13 12:30:39 +00:00
overlookmotel e533278327 perf(codegen): reduce writes in printDecorators (#27651)
Small perf optimization. Combine 2 writes into 1 for decorators which have to be wrapped.
2026-10-13 12:30:38 +00:00
oxc-guard[bot]andleaysgur d47efe5cb8 release(crates): oxc v0.154.0 (#27644)
### 💥 BREAKING CHANGES

- 7730e14 ast: [**BREAKING**] Refactor comment attachment storage
(#27512) (camc314)
- c904b61 ast: [**BREAKING**] Add comment attachment storage (#27393)
(camc314)
- b5e8eff parser: [**BREAKING**] Assign node IDs during parsing (#27411)
(camc314)

### 🚀 Features

- 3d00bbd minifier: Add folding of delete expression (#27522) (Armano)

### 🐛 Bug Fixes

- 760b60b codegen, packages/codegen: Remove extraneous space before
`RestElement` in `ArrayPattern` (#27613) (overlookmotel)
- 0353d37 packages/codegen: Support printing `V8IntrinsicExpression`s
(#27597) (overlookmotel)
- 1e4c6ee minifier: Preserve parameter writes through mapped arguments
(#27494) (Dunqing)
- f8e9a50 semantic: Stop arguments resolution at ordinary functions
(#26929) (camc314)
- 4b75662 transformer_plugins: Preserve optional chains through non-null
assertions (#27526) (Dunqing)
- 72bf06f crates/oxc_semantic: Decline to evaluate unary ops on strings
in enum initializers (#27447) (Brooooooklyn)
- c57d9c7 parser: Apply no-side-effects annotations after export
(#27504) (camc314)
- 02577b1 minifier: Preserve delete semantic when folding non-finite
numbers (#27466) (Armano)
- f14ead5 minifier: Eliminate unused IIFE calls with constant arguments
(#27434) (Dunqing)
- aec14bc transformer: Avoid synthetic private fields for static blocks
(#27300) (Kuroda Kayn)
- 558a890 semantic: Mark delete of optional members as MemberWriteTarget
(#27430) (Bartok)
- f50257e codegen: Avoid extra indent before empty do-while bodies
(#27407) (camc314)
- 82bfc5f codegen: Fix printing negative `BigIntLiteral` after `-`
(#27378) (overlookmotel)
- 5461c1a packages/codegen: Fix printing negative `BigIntLiteral` after
`-` (#27377) (overlookmotel)
- bebef88 packages/codegen: Fix debug assert fail printing
`TSJSDocNonNullableType` (#27373) (overlookmotel)
- 7e6a050 semantic: Visit `TSMethodSignature` computed method keys in
enclosing scope (#27357) (camc314)

### ⚡ Performance

- e1c97f8 packages/codegen: Remove all `printSpaceBeforeIdentifier`
calls (#27620) (overlookmotel)
- 70ecfdd packages/codegen: Skip redundant `printSpaceBeforeIdentifier`
call (#27619) (overlookmotel)
- 3c289f3 packages/codegen: Remove branches from loops printing arrays
(#27614) (overlookmotel)
- 27f5b45 packages/codegen: Remove branch printing `RestElement` in
`ArrayPattern` (#27608) (overlookmotel)
- adc90ed packages/codegen: Reduce branches in `printArguments` (#27607)
(overlookmotel)
- 262dd21 packages/codegen: Remove unnecessary
`printSpaceBeforeIdentifier` calls (#27606) (overlookmotel)
- 4bb9722 packages/codegen: Print `SpreadElement` arguments via
`printExpression` (#27599) (overlookmotel)
- 0c98dc5 packages/codegen: Reduce megamorphic `type` reads in
`printParams` (#27595) (overlookmotel)
- e3780b5 packages/codegen: Reduce writes in `printForOfStatement`
(#27594) (overlookmotel)
- 8d0ba20 packages/codegen: Reduce megamorphic `type` reads in
`printForOfStatement` (#27593) (overlookmotel)
- b29f35e packages/codegen: Reduce megamorphic `type` reads in
`printDirectivesAndStatements` (#27592) (overlookmotel)
- 256259d packages/codegen: Reduce megamorphic `type` reads in
`printConditionalExpression` (#27591) (overlookmotel)
- a9bd942 packages/codegen: Reduce megamorphic `type` reads in
`printObjectProperty` (#27590) (overlookmotel)
- 0a386ff packages/codegen: Ensure `shorthand` var is always a boolean
(#27589) (overlookmotel)
- 8d4c633 packages/codegen: Reduce branches in `printObjectProperty`
(#27588) (overlookmotel)
- b4c8c04 packages/codegen: Reduce megamorphic `type` reads in
`printMemberExpression` (#27587) (overlookmotel)
- ff5eae8 packages/codegen: Reduce megamorphic `type` reads (#27586)
(overlookmotel)
- 5487247 ast: Generate derive for `CloneIn` on `Comment` (#27542)
(overlookmotel)
- cd1c192 minifier: Optimize unused expression removal in minimize_if
(#27545) (Armano)
- 14a92ba transformer: Skip expression exit pipeline for unaffected
nodes (#27492) (camc314)
- cd9a62f transformer: Skip static block dispatch for ordinary
statements (#27491) (camc314)
- 135dd04 transformer: Skip ES2022 exits for non-class expressions
(#27489) (camc314)
- 961f318 packages/codegen: Reduce megamorphic `type` reads in
`binCheckAndPrepare` (#27460) (overlookmotel)
- 3d2f93f packages/codegen: Reduce megamorphic property accesses for
`BinaryExpression`s (#27459) (overlookmotel)
- 675ec5e packages/codegen: Reduce megamorphic property accesses in
`printBinaryish` (#27458) (overlookmotel)
- b0dbfff packages/codegen: Reduce writes and branches printing
functions (#27455) (overlookmotel)
- 5f3865c packages/codegen: Reduce writes for optional
`MemberExpression`s (#27454) (overlookmotel)
- 8c57c5e linter: Share one source per file across type-aware
diagnostics (#27462) (Max Schwenk)
- 19c227d minifier: Use ident when checking specific id names (#27208)
(Armano)
- 180d4e7 minifier: Avoid unecessary import/export merging for
cjs/scripts (#27291) (Armano)

### 📚 Documentation

- c993555 minifier: Align guides with current implementation (#27584)
(Cameron)
- 59472c5 packages/codegen: Add `@param`s to JSDoc comments which had
none (#27601) (overlookmotel)
- 5ee0fc9 packages/codegen: Complete `@param` lists in partly documented
JSDoc comments (#27600) (overlookmotel)
- 12dfa25 packages/codegen: Correct doc comment for `printBinaryish`
(#27456) (overlookmotel)
- add0443 mangler: Clarify node ID renumbering in build (#27448)
(camc314)

Co-authored-by: leaysgur <6259812+leaysgur@users.noreply.github.com>
2026-10-13 10:10:49 +01:00
overlookmotel e1c97f8c3f perf(packages/codegen): remove all printSpaceBeforeIdentifier calls (#27620)
Perf optimization.

#27455 removed the only call to `printSpaceBeforeIdentifier` which isn't a no-op in pretty-printing mode (the only mode that `oxc-codegen` currently supports).

Remove `printSpaceBeforeIdentifier` from builds with a `MINIFY` flag which TSDown sets to `false`. Minifier then removes all the calls.

Produces a 0.5%-1% perf improvement on benchmarks.

Reason for using `MINIFY` flag to render the code a no-op, rather than removing all the calls manually, it's it's useful to have the logic in place, in case we want to support minified output in future. It'd be a pain to restore it all if we do that later.
2026-10-12 21:45:55 +00:00
overlookmotel 70ecfddf2a perf(packages/codegen): skip redundant printSpaceBeforeIdentifier call (#27619)
Small perf optimization.

After a `(` is written, it's redundant to call `printSpaceBeforeIdentifier` because it's always a no-op. Skip it on that branch.
2026-10-12 21:45:55 +00:00
overlookmotel 3c289f3961 perf(packages/codegen): remove branches from loops printing arrays (#27614)
Perf optimization.

Optimize printing arrays - `ArrayExpression` and `ArrayPattern`.

- Move branches out of the loops, so each loop iteration is as quick as possible.
- Convert `write` calls to `writeNoLast` wherever possible.
2026-10-12 21:13:12 +00:00
overlookmotel 760b60ba14 fix(codegen, packages/codegen): remove extraneous space before RestElement in ArrayPattern (#27613)
Fix both Rust and JS codegens.

Both printed an extraneous space before `...` for a `RestElement` as first element of an `ArrayPattern`.

```javascript
// Before
const [ ...rest] = arr;
// After
const [...rest] = arr;
```

[Playground](https://playground.oxc.rs/?options=%7B%22run%22%3A%7B%22lint%22%3Afalse%2C%22formatter%22%3Afalse%2C%22transform%22%3Afalse%2C%22isolatedDeclarations%22%3Afalse%2C%22whitespace%22%3Afalse%2C%22mangle%22%3Afalse%2C%22mangleProps%22%3Afalse%2C%22compress%22%3Afalse%2C%22scope%22%3Atrue%2C%22symbol%22%3Atrue%2C%22cfg%22%3Afalse%7D%2C%22parser%22%3A%7B%22extension%22%3A%22js%22%2C%22allowReturnOutsideFunction%22%3Atrue%2C%22preserveParens%22%3Atrue%2C%22allowV8Intrinsics%22%3Atrue%2C%22semanticErrors%22%3Atrue%7D%2C%22linter%22%3A%7B%7D%2C%22formatter%22%3A%7B%22useTabs%22%3Afalse%2C%22tabWidth%22%3A2%2C%22endOfLine%22%3A%22lf%22%2C%22printWidth%22%3A80%2C%22singleQuote%22%3Afalse%2C%22jsxSingleQuote%22%3Afalse%2C%22quoteProps%22%3A%22as-needed%22%2C%22trailingComma%22%3A%22all%22%2C%22semi%22%3Atrue%2C%22arrowParens%22%3A%22always%22%2C%22bracketSpacing%22%3Atrue%2C%22bracketSameLine%22%3Afalse%2C%22objectWrap%22%3A%22preserve%22%2C%22singleAttributePerLine%22%3Afalse%7D%2C%22transformer%22%3A%7B%22target%22%3A%22es2015%22%2C%22useDefineForClassFields%22%3Atrue%2C%22experimentalDecorators%22%3Atrue%2C%22emitDecoratorMetadata%22%3Atrue%2C%22optimizeEnums%22%3Atrue%2C%22optimizeConstEnums%22%3Atrue%7D%2C%22isolatedDeclarations%22%3A%7B%22stripInternal%22%3Afalse%7D%2C%22codegen%22%3A%7B%22normal%22%3Atrue%2C%22jsdoc%22%3Atrue%2C%22annotation%22%3Atrue%2C%22legal%22%3Atrue%7D%2C%22compress%22%3A%7B%7D%2C%22mangle%22%3A%7B%22topLevel%22%3Atrue%2C%22keepNames%22%3Afalse%7D%2C%22mangleProps%22%3A%7B%22include%22%3A%22_%24%22%2C%22reserved%22%3A%5B%5D%2C%22quoted%22%3Afalse%2C%22debug%22%3Afalse%7D%2C%22controlFlow%22%3A%7B%22verbose%22%3Afalse%7D%2C%22inject%22%3A%7B%22inject%22%3A%7B%7D%7D%2C%22define%22%3A%7B%22define%22%3A%7B%7D%7D%7D&code=const+%5B...x%5D+%3D+y%3B)
2026-10-12 21:13:11 +00:00
overlookmotel 27f5b45b71 perf(packages/codegen): remove branch printing RestElement in ArrayPattern (#27608)
Perf optimization.

When printing `...rest` in an `ArrayPattern`, there's no need to send it via `printBindingPattern` which checks `rest.type`. We already know it's a `RestElement`, so just print that directly.
2026-10-12 21:13:11 +00:00
overlookmotel adc90edea0 perf(packages/codegen): reduce branches in printArguments (#27607)
Small perf optimization.

The loop always checks if `length === 0` anyway before first iteration, so there's no real gain in checking it manually.
2026-10-12 21:13:11 +00:00
overlookmotel 262dd21150 perf(packages/codegen): remove unnecessary printSpaceBeforeIdentifier calls (#27606)
Perf optimization.

Remove unnecessary `printSpaceBeforeIdentifier` calls in `printAssignmentTargetProperty`. The last thing printed is always either `{` or `, `, so `printSpaceBeforeIdentifier` is always a no-op here anyway.
2026-10-12 21:13:10 +00:00
overlookmotel 59472c5170 docs(packages/codegen): add @params to JSDoc comments which had none (#27601)
Comments-only change.

Add documentation for all parameters to the JSDoc comment for every function.
2026-10-12 17:10:53 +00:00
overlookmotel 5ee0fc9758 docs(packages/codegen): complete @param lists in partly documented JSDoc comments (#27600)
Comments-only change.

Where a JSDoc comment documented some of a function's parameters but not all, add the missing `@param`s, in parameter order.
2026-10-12 17:10:52 +00:00
overlookmotel 4bb972213c perf(packages/codegen): print SpreadElement arguments via printExpression (#27599)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

An argument can be any expression, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). `printArguments` read it to check for a spread, and then `printExpression` read it again to dispatch. Add a `SpreadElement` arm to `printExpression`, so arguments are passed straight to it, and their `type` is read only once.

This change produces a 1%-1.5% perf improvement on most benchamarks.
2026-10-12 17:10:52 +00:00
overlookmotel 1f5b9f7b04 refactor(packages/codegen): remove UnknownNode type (#27598)
Refactor. Remove the `UnknownNode` type, which was a hack to satisfy the type-checker. It made function signatures misleading. Replace it by another mechanism which achieves the same thing, but has tighter typing.

It was this change which revealed the lack of support for printing `V8IntrinsicExpression`s (fixed in #27597).
2026-10-12 17:10:52 +00:00
overlookmotel 0353d37faf fix(packages/codegen): support printing V8IntrinsicExpressions (#27597)
`oxc_codegen` (Rust) supports printing `V8IntrinsicExpression`s but `oxc-codegen` (JS) didn't. Add support for it.
2026-10-12 17:10:51 +00:00
overlookmotel 0c98dc54ac perf(packages/codegen): reduce megamorphic type reads in printParams (#27595)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

In TS builds, a parameter can be any of several node types, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). Read it once for both the `this` parameter and parameter property checks.
2026-10-12 14:03:12 +00:00
overlookmotel e3780b5ab5 perf(packages/codegen): reduce writes in printForOfStatement (#27594)
Perf optimization.

Combine writes when printing a `ForOfStatement`. Previous it was 2 writes (`for`, ` (`) or 3 (`for`, ` await`, ` (`). Now either is just one write.
2026-10-12 14:03:12 +00:00
overlookmotel 8d0ba201fd perf(packages/codegen): reduce megamorphic type reads in printForOfStatement (#27593)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

The left side of a `for of` head can be any declaration or assignment target, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). Read it once in `printForOfStatement` and pass it to a single `forOfHeadNeedsWrapping`, which applies both the `let` and `async` rules while walking the leftmost spine, reading each level's `type` once.

Previously computed members read their object's `type` three times (via `withoutParens`). Adds a fixture and hand-built tests for `let`/`async` heads, including parenthesized ones, which only hand-built ASTs can reach.
2026-10-12 14:03:11 +00:00
overlookmotel b29f35eac3 perf(packages/codegen): reduce megamorphic type reads in printDirectivesAndStatements (#27592)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

The expression of a leading expression statement can be any expression, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). Read its `type` once while unwrapping parens, instead of in `withoutParens` and again after it.
2026-10-12 14:03:11 +00:00
overlookmotel 256259ddfa perf(packages/codegen): reduce megamorphic type reads in printConditionalExpression (#27591)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

The test of a conditional expression can be any expression, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). In TS builds, read its `type` once while unwrapping parens, instead of in `withoutParens` and again after it.
2026-10-12 14:03:11 +00:00
overlookmotel a9bd9420d4 perf(packages/codegen): reduce megamorphic type reads in printObjectProperty (#27590)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

A property's value can be any expression, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). Read it once, and reuse it for the method check (twice in TS builds) and the shorthand check, instead of reading it again in `withoutParens` and after it.

Ditto for the load of `type` property on `key` in the `!computed` branch.
2026-10-12 14:03:10 +00:00
overlookmotel 0a386ff5b5 perf(packages/codegen): ensure shorthand var is always a boolean (#27589)
Tiny perf optimization.

Ensure that V8 can prove that `shorthand` is always a boolean, and can avoid a type check when branching on it later on.
2026-10-12 14:03:10 +00:00
overlookmotel 8d4c633137 perf(packages/codegen): reduce branches in printObjectProperty (#27588)
Perf optimization.

Move a branch which depends on `!computed` into inside an existing branch which already has that check, removing the 2nd branch on that condition.
2026-10-12 14:03:09 +00:00
overlookmotel b4c8c04b91 perf(packages/codegen): reduce megamorphic type reads in printMemberExpression (#27587)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

The object of a computed member expression can be any expression, so reading its `type` is a megamorphic load (a builtin call, which V8 does not deduplicate). Read its `type` once for the `(let)[0]` check, while unwrapping parens, instead of in `withoutParens` and again after it.
2026-10-12 14:03:09 +00:00
overlookmotel ff5eae8c5f perf(packages/codegen): reduce megamorphic type reads (#27586)
Perf optimization. Continuation of [#27458](https://github.com/oxc-project/oxc/issues/27458).

Avoid reading `type` of a node multiple times where the node can have multiple object shapes. In such a case, loading `.type` is a megamorphic property access, which is expensive, and V8 does not cache the result.
2026-10-12 14:03:08 +00:00
overlookmotel 961f318571 perf(packages/codegen): reduce megamorphic type reads in binCheckAndPrepare (#27460)
Perf optimization. Continuation of #27458.

Ensure that costly megamorphic reads of the `type` of `Expression`s happens the minimum of times.

Pass `left` (with any `ParenthesizedExpression` wrappers stripped off) and `left.type` into `binCheckAndPrepare`, so in the paths for `??` and `**`, the unwrapping and megamorphic `.type` accesses don't need to be repeated again. `**` is rare, but `??` is quite heavily used in some codebases.

Passing these 2 vars as params doesn't cost anything, as `binCheckAndPrepare` gets inlined anyway.
2026-10-08 17:07:16 +00:00
overlookmotel 3d2f93f87c perf(packages/codegen): reduce megamorphic property accesses for BinaryExpressions (#27459)
Perf optimization. Continuation of #27458.

The branch of `printExpression` for `BinaryExpression` (common path) reads the `type` of the left-hand node in order to check if it's a `PrivateInExpression`. This is a costly megamorphic access.

In the common case where it's _not_ a `PrivateInExpression`, it then calls `printBinaryish` which then accesses `node.left.type` again. This incurs the megamorphic load cost twice.

Instead, pass the extracted value of `node.left.type` into `printBinaryish` so it can avoid the 2nd lookup.
2026-10-08 17:07:15 +00:00
overlookmotel 675ec5e879 perf(packages/codegen): reduce megamorphic property accesses in printBinaryish (#27458)
Perf optimization.

Accessing the a `type` property of an `Expression` is expensive because an `Expression` can be any one of many object shapes, so it's a slow megamorphic access. In `printBinaryish` (a hot path), ensure that each of these accesses happens only once, rather than multiple times.

This change shows a 1%-2% perf improvement on most bench fixtures.
2026-10-08 17:07:15 +00:00
overlookmotel c179bbeb61 refactor(packages/codegen): import ESTree types individually (#27457)
Pure refactor.

Import ESTree types individually to shorten the code where these types are used.
2026-10-08 17:07:14 +00:00
overlookmotel 12dfa2538c docs(packages/codegen): correct doc comment for printBinaryish (#27456)
Comments-only change. Correct the JSDoc comment for `printBinaryish`.
2026-10-08 17:07:14 +00:00
overlookmotel b0dbfffbce perf(packages/codegen): reduce writes and branches printing functions (#27455)
Perf optimization.

When printing a `function`, `node.async` is fairly unpredictable - some functions are async, others aren't.

Make whether to print the `async` keyword a branchless decision.

Also use a single write in all cases to print the whole prefix of the function (e.g. `function`, `declare async function` etc). The main win here is to avoid printing a single space as a separate `write` call in the common case of named functions.
2026-10-08 17:07:14 +00:00
overlookmotel 5f3865cc2e perf(packages/codegen): reduce writes for optional MemberExpressions (#27454)
Small perf optimization.

When printing optional member expression `?.`, print `?.` in a single write, instead of writing `?` and `.` individually. 1 less `write` call for this case, and it also shortens the path to a single `write` call for all cases.
2026-10-08 17:07:13 +00:00
camc314 f50257e4ac fix(codegen): avoid extra indent before empty do-while bodies (#27407)
Indented empty `do…while` bodies currently print extra whitespace between `do` and `;`. Skip the empty statement's indentation in both the JavaScript and Rust printers, keeping the semicolon directly after `do`.
2026-10-07 13:11:21 +00:00
overlookmotel 5461c1ade4 fix(packages/codegen): fix printing negative BigIntLiteral after - (#27377)
Fix printing a negative `BigIntLiteral` after `-`.

```javascript
// Original
x = -(-1n);
// Printed - syntax error
x = --1n;
```

This bug could not be produced by an AST which has come from parser, because parser would parse the input as equivalent to `x = -(-(1n));`. But it could be produced when printing a hand-built AST.
2026-10-06 19:06:06 +00:00
overlookmotel bebef8836b fix(packages/codegen): fix debug assert fail printing TSJSDocNonNullableType (#27373)
When printing `<` followed by `!` in a TS type e.g. `Array<!T>`, the `last` category recorded is `CAT_OP_UN_NOT` instead of `CAT_OP_LT_THEN_UN_NOT`, which is the more usual category to record for `<!`.

In this case, `CAT_OP_UN_NOT` is fine. The purpose of `CAT_OP_LT_THEN_UN_NOT` is to insert a space before printing `--`, which would form an HTML-style comment `<!--`. In this case, that's not possible - no type can begin with `--` - so this hazard doesn't exist.

The problem was the checks in debug builds which make sure that `<!` always results in `CAT_OP_LT_THEN_UN_NOT`. Before this PR, printing `Array<!T>` would throw in tests / conformance.

Fix this by writing `CAT_OP_LT_THEN_UN_NOT` in debug builds. In release builds, continue to write `CAT_OP_UN_NOT` as it's cheaper, and the debug checks don't run in release builds.
2026-10-06 11:35:03 +00:00
overlookmotel ccb1c0f67a refactor(packages/codegen): rename CAT_OP_LT_THEN_UN_NOT (#27372)
Pure refactor.

Rename `CAT_OP_UN_NOT_AFTER_LT` to `CAT_OP_LT_THEN_UN_NOT`. The old name was confusing - it could read as "not after LT" whereas what it really means is an operator "unary not" _is_ after LT. Rename it to remove this confusion.
2026-10-06 11:35:03 +00:00
oxc-guard 7f56ec9301 release(crates): oxc v0.153.0 (#27342)
### 🚀 Features

- 61003c7 minifier: Fold undefined argument in non delegating yield (#27324) (Armano)
- 07833c0 ast: Tie `debug_name` return lifetime to the underlying AST node (#27295) (sadan)
- adb1139 minifier: Merge import statements against the same module (#25534) (翠)
- cc82598 minifier: Merge import and export statements against the same module (#25533) (翠)
- 1c352ce minifier: Minimize bitwise binary expressions (#27107) (Armano)
- d1a0bcc minifier: Merge statements after terminating if block branches (#26667) (Armano)
- 7a95376 minifier: Merge adjucent if stmt with the same content (#26445) (Armano)

### 🐛 Bug Fixes

- 6a7d48b parser: Report abstract private field error on modifier (#27314) (camc314)
- 2ff6fb5 parser: Include generator marker in overload diagnostic span (#27313) (camc314)
- 4359a66 parser: Reject TypeScript class modifiers in JavaScript (#27312) (camc314)
- 565d75d minifier: Correct indopedency when processing nested sequences (#27273) (Armano)
- d0b9372 parser: Remove type-dependent tuple rest diagnostics (#27234) (camc314)
- 3d61a59 parser: Validate TypeScript type member separators (#27222) (camc314)
- b2793fa parser: Reject module syntax in script (#27220) (leaysgur)
- 5914a24 parser: Report `TS1243` for abstract async methods (#27192) (camc314)
- c6c6e5e parser: Report `TS1242` for interfaces with `abstract` modifier (#27191) (camc314)
- dd0bbb9 parser: Avoid duplicate index signature modifier diagnostic (#27190) (camc314)
- 8f61129 regex: Decode escaped capturing group names (#27156) (camc314)
- da1fed2 minifier: Fold conditional expressions with long sequences (#27083) (Armano)
- 0c601f4 isolated-declarations: Allow adding undefined to keyof parameter types (#27173) (Dunqing)
- 4896287 isolated-declarations: Support readonly parameter types (#27009) (sama Pyb)
- 72d62a1 transformer/explicit-resource-management: Transform classic for loop using declarations (#27148) (camc314)
- 4cf9ae2 minifier: Preserve sibling declarations in arguments copy rewrite (#27140) (camc314)
- 24b7015 transformer/explicit-resource-management: Lower using in catch and finally (#27142) (camc314)

### ⚡ Performance

- 99e3c15 minifier: Small performance improvement when merging imports (#27238) (Armano)
- d37d1db codegen: Pre-allocate sourcemap builder vectors (#27230) (codspeed)
- 466ef10 minifier: Update expressions in place in `merge_import_export` (#27226) (Armano)
- 028ffb8 minifier: Update nodes in place in `wrap_to_avoid_ambiguous_else` (#27194) (Armano)
- 6fcd135 minifier: Avoid conversion from ident to str when for substitute symbols (#27209) (Armano)
- 0b9799d minifier: Reduce usage of minimize_conditional (#26028) (Armano)
- 3ca3ded minifier: Short-circuit IfStatement termination on alternate (#25198) (Armano)

### 📚 Documentation

- 335ce79 agents: Scope verification for local and stacked work (#27299) (Dunqing)
2026-10-05 10:09:39 +00:00
Cameron eec94b27e5 chore(codegen): revert remove unused minified-printing support (#27340)
This reverts commit b98722887c.
2026-10-05 09:07:58 +00:00
camc314 b98722887c refactor(codegen): remove unused minified-printing support (#27336)
The JavaScript code generator only supports pretty printing, so padded binary operators already prevent the `<!--` and adjacent-regex token hazards. Remove the unused categories and checks inherited from minified printing, along with their debug character tracking.

Keep required unary-operator spacing, add regression cases for `x < !--y` and `x < /script/`, and update the design guide. Pretty-printed output is unchanged.
2026-10-05 08:11:19 +00:00
oxc-guard dfbc0d1ea7 release(crates): oxc v0.152.0 (#27133)
### 🚀 Features

- 02331c8 str: Add `JSStr`, `JSChar` and `JSStrBuilder` types (#26435) (Dunqing)
- 52ae63f regular_expression: Support buffer boundary assertions (#27048) (Boshen)
- 3255b89 transform-react: Add `reportDiagnostics` option to expose recoverable React Compiler diagnostics (#26624) (Jack)
- f585cb4 napi: Add threadless WASI builds (#26898) (Boshen)

### 🐛 Bug Fixes

- c380c85 minifier: Preserve iife with directives (#27060) (Armano)
- c55b35d str: Correct clippy reason (#27013) (overlookmotel)
- 8fbddb1 formatter/jsdoc: More alignment with original plugin (#27039) (leaysgur)
- 5186328 parser: Handle HTML comment values (#22933) (Boshen)
- 01ff33e parser: Reject module export names containing a lone surrogate (#26953) (Dunqing)
- d79ad19 codegen: Remove redundant dollar escapes in minified templates (#26924) (camc314)

### ⚡ Performance

- 0afbf85 minifier: Fold logical expressions in place (#26768) (Armano)
- 3471f29 minifier: Avoid creation of empty block when folding try finally (#26971) (Armano)
- 3893d64 minifier: Update boolean context expressions in place (#26823) (Armano)
- de8af47 minifier: Take return argument directly when converting arrow fn (#26830) (Armano)
- fc37ba0 minifier: Reduce allocations when minimizing assignments (#26609) (Armano)
- dce64f6 minifier: Use ident hashes for catch var and arguments (#26907) (Armano)
- 57610b3 minifier: Use ident hashes in label comparison (#26887) (Armano)

### 📚 Documentation

- dfa6cf9 str: Reformat and simplify comments (#27011) (overlookmotel)
- d775315 parser: Document AST property order (#27038) (Boshen)
- cd80e3f ast: Correct `JSXExpressionContainer` example (#26975) (camc314)
- 8cb05e3 ast: Simplify `JSXAttribute` value description (#26974) (camc314)
- fda7fbb ast: Correct `TSNumberKeyword` example (#26973) (camc314)
- e63c439 ast: Clarify `RegExpFlags::V` flag features (#26972) (camc314)
- 278288e ast: Correct `JSXText` example (#26970) (camc314)
- e9ff529 ast: Correct `TSIntrinsicKeyword` example (#26967) (camc314)
- c643ce4 ast: Fix `TSTupleType` example syntax (#26966) (camc314)
- 895b1a7 ast: Correct `TSPropertySignature` usage example (#26964) (camc314)
- 8d8cc7c ast: Correct `Class` abstract example values (#26963) (camc314)
- f7ef2e2 ast: Use valid variance example for `TSTypeParameter` (#26962) (camc314)
- 145fcdb ast: Attach `pure` comment to `NewExpression` field (#26961) (camc314)
- 06dfd9f ast: Clarify `TSNonNullExpression` docs (#26960) (camc314)
- d5f92b5 ast: Add docs for TSNonNullExpression (#26910) (camchenry)
- 4a76723 ast: Add docs for TSNamespaceExportDeclaration (#26909) (camchenry)
- de41927 ast: Add docs for `TSInstantiationExpression` (#26908) (camchenry)
2026-09-28 09:39:56 +00:00
oxc-guard bec650f15b release(crates): oxc v0.151.0 (#26875)
### 🚀 Features

- 1fac655 coverage: Support new TypeScript fixture layout (#26226) (camc314)

### 🐛 Bug Fixes

- cd7228f minifier: Add missing negation for boolean literal (#26847) (Armano)
- 32305e2 transformer: Skip enum reverse mappings for syntactic string initializers (#26724) (Dunqing)
- 7811f0a parser: Preserve reparsed `await` tokens (#26619) (camc314)
- 9220158 transformer: Skip recovered using loop patterns (#26722) (camc314)
- 3130405 parser: Recover await using object binding patterns (#26721) (camc314)
- 827fdbd parser: Reject invalid modifiers on import aliases (#26622) (camc314)

### ⚡ Performance

- 3f1e3aa minifier: Preallocate stmts vec size to avoid excesive reallocs (#26856) (Armano)
- bd3f69e semantic: Reuse identifier hashes in enum member lookups (#26773) (camc314)
- 5f72954 minifier: Reduce allocations when processing if statements (#26666) (Armano)
2026-09-21 12:15:01 +00:00
camc314 1fac65563b feat(coverage): support new TypeScript fixture layout (#26226)
Update the coverage harness and fixture consumers for TypeScript's merged `tsc/testdata` layout, including separate compiler and conformance baseline directories. Handle strict/checkJs baseline variants and exclude fixtures without any reference baseline. Update fixture revisions, conformance snapshots, and the existing NAPI token-test exclusion paths. Remove the temporary snapshot path translation from the parent PR.

Local conformance reproduced the updated snapshots, and all 237,025 parser NAPI tests passed with token, range/parent, and lazy-transfer modes enabled. The snapshots retain the false failures for the two TS2339 fixtures without special-case exclusions.
2026-09-18 08:35:21 +00:00
oxc-guard 5a6e37e5cf release(crates): oxc v0.150.0 (#26632)
### 🚀 Features

- ca649e0 ecma: Define math constants as known globals and resolve their types (#26585) (Armano)
- 9ef028c codegen: Add `ascii_only` option (#25994) (Samuel Attard)
- 80a76a0 minifier: Negate binary comparison for `typeof x < 'u'` (#26367) (Armano)

### 🐛 Bug Fixes

- 8ca76da parser: Reject `accessor` modifiers on methods (#26617) (camc314)
- 1916f31 parser: Reject `readonly` modifier on constructors (#26612) (camc314)
- 1c42008 parser: Handle escaped let in for loops (#26583) (camc314)
- d21d5cf parser: Recognize annotated empty arrows in conditionals (#26537) (camc314)
- d7713ad parser: Classify Unicode line breaks in block comments (#26536) (camc314)
- 75cd919 transformer: Preserve receivers in private optional chains (#26535) (camc314)
- b32d25d parser: Reject escaped import-phase keywords (#26534) (camc314)
- 47b8311 parser: Recognize contextual binding names in type lookaheads (#26532) (camc314)
- d6b6705 parser: Require arrow separator in TypeScript function types (#26529) (camc314)
- e98beef parser: Disambiguate await using in for initializers (#26527) (camc314)
- 92afee6 parser: Allow parenthesized JSX comma expressions with preserve_parens=false (#26524) (camc314)
- 31508b1 parser: Reject return types on constructor overloads (#26523) (camc314)
- a091fc4 parser: Validate await context for await using declarations (#26495) (camc314)
- 5501e86 parser: Disallow in expressions in using for-loop initializers (#26490) (camc314)
- c8e5fa7 parser: Allow escaped type names in import and export specifiers (#26487) (camc314)
- 2dcee2f parser: Reject async modifiers on class fields (#26486) (camc314)
- 973d58e parser: Require comma after TypeScript this parameter (#26480) (camc314)
- 32d00c5 codegen: Preserve instantiation expression precedence (#26424) (camc314)
- cfa47ab parser: Allow `in` expressions in class static blocks (#26423) (camc314)
- 5986187 packages/codegen: Preserve private-in right operand precedence (#26420) (camc314)
- f8e6c6c packages/codegen: Preserve in restriction through yield arguments (#26421) (camc314)
- d61e3bf parser: Validate TS named tuple rest elements (#26419) (camc314)
- ae6c386 codegen: Preserve in restriction through yield arguments (#26413) (camc314)
- 42ac916 codegen: Preserve private-in right operand precedence (#26411) (camc314)
- 10521b2 parser: Allow escaped type default import bindings (#26409) (camc314)
- 72cb5e3 parser: Reject rest parameters in getters (#26400) (camc314)
- 6e15ad5 packages/codegen: Print matching quoted import names as identifiers (#26404) (camc314)
- bbbb4bc packages/codegen: Preserve private-in left operand precedence (#26403) (camc314)
- a111b5b packages/codegen: Print accessibility modifiers before abstract (#26402) (camc314)
- 4e76602 parser: Allow `in` in arrow block bodies within `for` initializers (#26395) (camc314)
- b20fc19 parser: Reject partially parenthesized mixed coalesce expressions (#26394) (camc314)

### ⚡ Performance

- 1f902a6 isolated_declarations: Key scope maps by `Ident` (#26380) (Dunqing)
- a242469 minfiier: Reduce allocs when creating indirect access (#26601) (Armano)
- 5b4787f minifier: Update chain expressions in place (#26544) (Armano)
- 0bc1661 minifier: Try merging before creating new expression statements (#26556) (Armano)
- c78d707 minifier: Process newly created stmt in handle_if_statement (#26541) (Armano)
- 029c84b minfier: Update expressions in place when substituting alternate syntax (#26460) (Armano)
- d198982 codegen: Outline postfix source mapping work (#26450) (camc314)
- 53f006e ecmascript: Format small integer literals with itoa (#26446) (camc314)
- 8bfb8c0 codegen: Avoid duplicate sourcemap name lookups (#26441) (camc314)

### 📚 Documentation

- 38533ac ast: Move type annotation span comment to span field (#26522) (camc314)
2026-09-14 11:25:40 +00:00
camc314 32d00c55bc fix(codegen): preserve instantiation expression precedence (#26424)
Preserve parentheses around TypeScript instantiation expressions in postfix contexts. Previously, `(f<T>).x` and `(f<T>)[x]` were emitted as `f<T>.x` and `f<T>[x]`, producing invalid syntax or changing how the expression is parsed.

The printer now respects the surrounding precedence while retaining grouping for lower-precedence operands.
2026-09-07 18:20:11 +00:00