Skip to content

fix(minifier,linter): keep delete of constant members and later JSX keys - #27990

Merged
graphite-app[bot] merged 1 commit into
mainfrom
claude/fix-delete-index-and-jsx-key
Oct 20, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
claude/fix-delete-index-and-jsx-key

Conversation

@Dunqing

@Dunqing Dunqing commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

delete "a"[0], delete "a".length, delete [1].length and delete Number.NaN delete a non-configurable property, so they are false, or a TypeError in strict mode. The minifier folded the member to its value first, and deleting a value is true:

console.log(delete "😀"[0]); // false; minified to `console.log(!0)`

#27096 extended the string index fold to every string, so delete "😀"[0] became !0 in 0.155.0. delete "abc"[0] and delete "abc".length were already wrong in 0.154.0. The member folds, the Number.* constant replacement and the Number.NaN normalization now skip the operand of delete. delete obj["x"] still becomes delete obj.x, and delete Number["NaN"] now minifies the same way every time.

react/jsx-key with warnOnDuplicates stopped at a template key with a substitution, key={`${a}`}, instead of reading the element's next key. Since #26717 the duplicate in [<li key={${a}} key="dup" />, <li key={${a}} key="dup" />] went unreported. The rule now falls through to the next key as 0.154.0 did.

Found by comparing 0.154.0 and 0.155.0 builds. Part of #26242.

Implemented with AI assistance.

@Dunqing
Dunqing requested a review from camc314 as a code owner October 20, 2026 06:39
@github-actions github-actions Bot added A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-minifier Area - Minification, compression and name mangling, oxc_minifier / oxc_mangler labels Oct 20, 2026
@codspeed

codspeed Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 82 untouched benchmarks
⏩ 14 skipped benchmarks1


Comparing claude/fix-delete-index-and-jsx-key (526d208) with main (aa7642a)

Open in CodSpeed

Footnotes

  1. 14 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@Dunqing
Dunqing requested a balanced review from Copilot October 20, 2026 07:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Oct 20, 2026

Dunqing commented Oct 20, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

… keys (#27990)

`delete "a"[0]`, `delete "a".length`, `delete [1].length` and `delete Number.NaN` delete a non-configurable property, so they are `false`, or a `TypeError` in strict mode. The minifier folded the member to its value first, and deleting a value is `true`:

```js
console.log(delete "😀"[0]); // false; minified to `console.log(!0)`
```

#27096 extended the string index fold to every string, so `delete "😀"[0]` became `!0` in 0.155.0. `delete "abc"[0]` and `delete "abc".length` were already wrong in 0.154.0. The member folds, the `Number.*` constant replacement and the `Number.NaN` normalization now skip the operand of `delete`. `delete obj["x"]` still becomes `delete obj.x`, and `delete Number["NaN"]` now minifies the same way every time.

`react/jsx-key` with `warnOnDuplicates` stopped at a template key with a substitution, `` key={`${a}`} ``, instead of reading the element's next `key`. Since #26717 the duplicate in `[<li key={`${a}`} key="dup" />, <li key={`${a}`} key="dup" />]` went unreported. The rule now falls through to the next `key` as 0.154.0 did.

Found by comparing 0.154.0 and 0.155.0 builds. Part of #26242.

Implemented with AI assistance.
@graphite-app
graphite-app Bot force-pushed the claude/fix-delete-index-and-jsx-key branch from 526d208 to 4c0fa90 Compare October 20, 2026 07:49
@graphite-app
graphite-app Bot merged commit 4c0fa90 into main Oct 20, 2026
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Oct 20, 2026
@graphite-app
graphite-app Bot deleted the claude/fix-delete-index-and-jsx-key branch October 20, 2026 07:54
Dunqing added a commit that referenced this pull request Oct 27, 2026
### 💥 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>
Dunqing added a commit that referenced this pull request Oct 27, 2026
# Oxlint
### 🚀 Features

- cf34678 oxlint: Export `Oxlintrc` type (#28132) (Sysix)
- 831cdf1 oxlint: Require mininum oxlint-tsgolint version v7.0.2005
(#28118) (camc314)
- d1b00f4 linter/typescript: Implement no-unsafe-enum-assignment rule
(#28117) (camc314)
- 165c91f linter/typescript/await-thenable: Support
`allowMixedPromiseArrays` option (#28116) (camc314)

### 🐛 Bug Fixes

- 7f3c908 linter/eslint/array-callback-return: Check callbacks passed
with extra arguments (#28133) (sarankumar)
- 53be530 linter: Filter by type aware rules when looking up tsgolint
rule severity (#28138) (NavpreetSSidhu)
- e0f8937 react-compiler: Compile a `try` whose `catch` is unreachable
instead of panicking (#28066) (Dunqing)
- f5b625f linter/eslint/no-useless-concat: See through parenthesized
expressions (#27984) (Rahul Kashyap)
- 4629bb2 linter/jest/no-conditional-expect: Check function expression
callbacks (#28055) (camc314)
- 5c84098 semantic,linter: Report names with lone surrogates in enum and
lint checks (#27991) (Dunqing)
- f3705a9 linter/eslint/prefer-const: Skip fixers if any declarator is
reassigned (#28008) (Prince Jain)
- 4c0fa90 minifier,linter: Keep `delete` of constant members and later
JSX keys (#27990) (Dunqing)
- 0298062 linter/arrow-body-style: Keep type assertions when adding a
block body (#27978) (Yan Almeida)
# Oxfmt
### 🐛 Bug Fixes

- 5042019 formatter: Keep fill layout for array with comment after [
(#28170) (leaysgur)
- 9d37ff6 formatter: Use position-based comment checks for concise
arrays (#28169) (leaysgur)
- 016c4a2 formatter: Keep a comment before `}` inside a JSX spread child
(#28103) (vidigoat)
- 190bb1e formatter: Keep parens around an instantiation expression
ending an operand through any tight parent (#28168) (leaysgur)
- a5314a1 formatter: Keep `;` before `in` and `instanceof` class members
(#28166) (leaysgur)
- 3a56e7c formatter: Keep closing HTML comments at the start of a line
(#28064) (Cameron)
- 23d23d6 formatter_markdown: Honor range ignore inside directives
(#28164) (leaysgur)
- 5f1fd3d formatter: Measure width heuristics by display width (#28098)
(leaysgur)
- a5a52cf formatter: Keep parens around private `in` expressions
(#28096) (leaysgur)
- 999496e formatter: Measure a short key by its display width (#28026)
(vidigoat)
- 7e9aa44 formatter: Keep parens around a looser operand of an
instantiation expression (#28025) (vidigoat)
- 6912d1f formatter: Keep an arrow signature that exactly fills the line
for any body (#27989) (leaysgur)
- eb1d9f9 formatter_core: Count a flat `line` space in `fits` only when
text follows (#27987) (leaysgur)

### ⚡ Performance

- 1ed93af data_structures: Copy short strings without a memcpy call
(#27953) (leaysgur)
- 7948f0b formatter_core: Shrink `FormatElement` to 16B (#28012)
(leaysgur)
- 788af22 formatter: Keep `AstNode`s on the stack, and only chain links
in the arena (#27963) (leaysgur)

### 📚 Documentation

- 068a8ea formatter: Fix up wording (#28167) (leaysgur)
- db55461 formatter_core: Document text width divergence (#28095)
(leaysgur)
- 880d229 formatter: Add vitest-test-call to known divergences (#28006)
(leaysgur)

Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-minifier Area - Minification, compression and name mangling, oxc_minifier / oxc_mangler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants