Skip to content

fix(react-compiler): compile a try whose catch is unreachable instead of panicking - #28066

Merged
graphite-app[bot] merged 1 commit into
mainfrom
claude/react-compiler-dead-try-catch-27404
Oct 22, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
claude/react-compiler-dead-try-catch-27404

Conversation

@Dunqing

@Dunqing Dunqing commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Fixes #27404

export function Component() {
  let x = 0;
  try {
    const unused = 1;
  } catch {
    x = 2;
  }
  return <div>{x}</div>;
}

Before: assertion failed: Found a block with a single predecessor but where a phi has multiple (2) operands, which aborts the process in release builds (Vite with oxc-transform-react, oxlint react/* rules).
After: compiles, with x folded to the constant 0.

Cause

Once dead-code elimination empties the try body, prune_maybe_throws removes the edge to the catch, and the catch blocks become unreachable. Two references to them were left behind:

  • The phi at the join after the try kept an operand for the catch path, so merge_consecutive_blocks hit its assert_eq!.
  • The join's preds still counted the removed blocks, so it was not merged into its real predecessor. When the catch had more than one block, the code after the try was silently dropped: try { const u = 1 } catch { if (c) a(); else b(); } return <div /> compiled to function Component(props) {}.

Babel's React Compiler (1.0.0 and upstream main at ab0d927f) reports the first case as an invariant error and skips the function, and compiles the second to the same empty function, which renders null.

Fix

  • prune_maybe_throws recomputes predecessors, drops phi operands from removed blocks, and eliminates phis this makes redundant, as constant propagation already does.
  • The merge_consecutive_blocks assertion is now an Invariant diagnostic, so any remaining case skips the function instead of crashing.

Tests

Five new fixtures: the issue repro, an if inside the catch, a dead try in a loop, nested try, and a catch with no reassignment. On main, three panic, one bails with a different invariant and one compiles to an empty function. With this PR, all five compile, and their output renders the same as the original source in React 19 across the fixtures' sequentialRenders. No existing snapshot changes. The issue repro is also a pass case for react/invariant.

AI disclosure: written with Claude Code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bvq2daQaudW29wmuShT7jq

@github-actions github-actions Bot added A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-react-compiler Area - React Compiler transforms and lint rules, oxc_react_compiler labels Oct 22, 2026
@codspeed

codspeed Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 86 skipped benchmarks1


Comparing claude/react-compiler-dead-try-catch-27404 (11ef086) with main (f5b625f)2

Open in CodSpeed

Footnotes

  1. 86 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. ↩

  2. No successful run was found on main (71f7a6a) during the generation of this report, so f5b625f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Oct 22, 2026
@Dunqing
Dunqing marked this pull request as ready for review October 22, 2026 06:41

Dunqing commented Oct 22, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

graphite-app Bot pushed a commit that referenced this pull request Oct 22, 2026
…tead of panicking (#28066)

Fixes #27404

```jsx
export function Component() {
  let x = 0;
  try {
    const unused = 1;
  } catch {
    x = 2;
  }
  return <div>{x}</div>;
}
```

Before: `assertion failed: Found a block with a single predecessor but where a phi has multiple (2) operands`, which aborts the process in release builds (Vite with `oxc-transform-react`, oxlint `react/*` rules).
After: compiles, with `x` folded to the constant `0`.

## Cause

Once dead-code elimination empties the `try` body, `prune_maybe_throws` removes the edge to the `catch`, and the catch blocks become unreachable. Two references to them were left behind:

- The phi at the join after the `try` kept an operand for the catch path, so `merge_consecutive_blocks` hit its `assert_eq!`.
- The join's `preds` still counted the removed blocks, so it was not merged into its real predecessor. When the `catch` had more than one block, the code after the `try` was silently dropped: `try { const u = 1 } catch { if (c) a(); else b(); } return <div />` compiled to `function Component(props) {}`.

Babel's React Compiler (1.0.0 and upstream main at `ab0d927f`) reports the first case as an invariant error and skips the function, and compiles the second to the same empty function, which renders `null`.

## Fix

- `prune_maybe_throws` recomputes predecessors, drops phi operands from removed blocks, and eliminates phis this makes redundant, as constant propagation already does.
- The `merge_consecutive_blocks` assertion is now an Invariant diagnostic, so any remaining case skips the function instead of crashing.

## Tests

Five new fixtures: the issue repro, an `if` inside the `catch`, a dead `try` in a loop, nested `try`, and a `catch` with no reassignment. On `main`, three panic, one bails with a different invariant and one compiles to an empty function. With this PR, all five compile, and their output renders the same as the original source in React 19 across the fixtures' `sequentialRenders`. No existing snapshot changes. The issue repro is also a `pass` case for `react/invariant`.

AI disclosure: written with Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Bvq2daQaudW29wmuShT7jq
@graphite-app
graphite-app Bot force-pushed the claude/react-compiler-dead-try-catch-27404 branch from 11ef086 to 5705644 Compare October 22, 2026 06:42
…tead of panicking (#28066)

Fixes #27404

```jsx
export function Component() {
  let x = 0;
  try {
    const unused = 1;
  } catch {
    x = 2;
  }
  return <div>{x}</div>;
}
```

Before: `assertion failed: Found a block with a single predecessor but where a phi has multiple (2) operands`, which aborts the process in release builds (Vite with `oxc-transform-react`, oxlint `react/*` rules).
After: compiles, with `x` folded to the constant `0`.

## Cause

Once dead-code elimination empties the `try` body, `prune_maybe_throws` removes the edge to the `catch`, and the catch blocks become unreachable. Two references to them were left behind:

- The phi at the join after the `try` kept an operand for the catch path, so `merge_consecutive_blocks` hit its `assert_eq!`.
- The join's `preds` still counted the removed blocks, so it was not merged into its real predecessor. When the `catch` had more than one block, the code after the `try` was silently dropped: `try { const u = 1 } catch { if (c) a(); else b(); } return <div />` compiled to `function Component(props) {}`.

Babel's React Compiler (1.0.0 and upstream main at `ab0d927f`) reports the first case as an invariant error and skips the function, and compiles the second to the same empty function, which renders `null`.

## Fix

- `prune_maybe_throws` recomputes predecessors, drops phi operands from removed blocks, and eliminates phis this makes redundant, as constant propagation already does.
- The `merge_consecutive_blocks` assertion is now an Invariant diagnostic, so any remaining case skips the function instead of crashing.

## Tests

Five new fixtures: the issue repro, an `if` inside the `catch`, a dead `try` in a loop, nested `try`, and a `catch` with no reassignment. On `main`, three panic, one bails with a different invariant and one compiles to an empty function. With this PR, all five compile, and their output renders the same as the original source in React 19 across the fixtures' `sequentialRenders`. No existing snapshot changes. The issue repro is also a `pass` case for `react/invariant`.

AI disclosure: written with Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Bvq2daQaudW29wmuShT7jq
@graphite-app
graphite-app Bot force-pushed the claude/react-compiler-dead-try-catch-27404 branch from 5705644 to e0f8937 Compare October 22, 2026 06:43
@graphite-app
graphite-app Bot merged commit e0f8937 into main Oct 22, 2026
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Oct 22, 2026
@graphite-app
graphite-app Bot deleted the claude/react-compiler-dead-try-catch-27404 branch October 22, 2026 06:48
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>
acusti added a commit to acusti/uikit that referenced this pull request Oct 27, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is now on by default
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. The README documents the bail-out
and how to turn the check off, and qualifies its claim that the port
compiles a superset of what the Babel plugin compiles.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 27, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 27, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is now on by default
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. The README documents the bail-out
and how to turn the check off, and qualifies its claim that the port
compiles a superset of what the Babel plugin compiles.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 27, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is now on by default
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. With panicThreshold set to
'critical_errors' or 'all_errors', the new diagnostic fails the build.
The changeset and README document the bail-out, that build failure,
reportDiagnostics to find the skipped components, and how to turn the
check off. The README also notes that its production result still
holds: the same functions in that app compile on 0.155.0 and 0.156.0.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is now on by default
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. With panicThreshold set to
'critical_errors' or 'all_errors', the new diagnostic fails the build.
The changeset and README document the bail-out, that build failure,
reportDiagnostics to find the skipped components, and how to turn the
check off. The README also notes that its production result still
holds: the same functions in that app compile on 0.155.0 and 0.156.0.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is now on by default
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. With panicThreshold set to
'critical_errors' or 'all_errors', the new diagnostic fails the build.
The changeset and README document the bail-out, that build failure,
reportDiagnostics to find the skipped components, and how to turn the
check off. The README’s caveats section now says the port differs from
the Babel plugin in both directions (compiling some code the Babel
plugin bails on, skipping these functions it compiles), and dates the
production results to the bindings they were measured on, 0.142.0,
instead of claiming parity in the present tense.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 28, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 29, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is on by default again
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
It was on at 0.142.0, the plugin’s first pinned version, and off from
0.144.0 through 0.155.0.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. With panicThreshold set to
'critical_errors' or 'all_errors', the new diagnostic fails the build.
The changeset and README document the bail-out, that build failure,
reportDiagnostics to find the skipped components, and how to turn the
check off. The README’s caveats section now says the port differs from
the Babel plugin in both directions (compiling some code the Babel
plugin bails on, skipping these functions it compiles), and dates the
production results to the bindings they were measured on, 0.142.0,
instead of claiming parity in the present tense.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 29, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 29, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

Exhaustive manual memoization validation is on by default again
(validateExhaustiveMemoizationDependencies, oxc-project/oxc#28101), as
on React Compiler main: a component or hook whose useMemo or useCallback
dependency list is missing a dependency or lists an extra one is skipped.
It was on at 0.142.0, the plugin’s first pinned version, and off from
0.144.0 through 0.155.0.
0.155.0 and babel-plugin-react-compiler@1.0.0 compile it with the
dependencies they infer, which changes when the value updates. The
plugin keeps the upstream default. With panicThreshold set to
'critical_errors' or 'all_errors', the new diagnostic fails the build.
The changeset and README document the bail-out, that build failure,
reportDiagnostics to find the skipped components, and how to turn the
check off. The README’s caveats section now says the port differs from
the Babel plugin in both directions (compiling some code the Babel
plugin bails on, skipping these functions it compiles), and dates the
production results to the bindings they were measured on, 0.142.0,
instead of claiming parity in the present tense.

The release also fixes compiled output for:
- an optional chain continued through a non-null assertion
  (`users?.find(…)!.name`), which lost its `?.` (oxc-project/oxc#28144)
- a value that a branch inside `try` picks from props, or that `catch`
  assigns when a prop makes `try` throw, which was cached once per mount
  (oxc-project/oxc#27817, oxc-project/oxc#28005)
- a `try` whose `catch` can never run, which panicked and aborted the
  process, or compiled the component to an empty function
  (oxc-project/oxc#28066)
- optional-chain dependencies, which keep the reads after an optional
  link, so a cached value no longer hides a TypeError the uncompiled
  code throws (oxc-project/oxc#28165)
- JSX outlining (opt-in `enableJsxOutlining`), which emitted invalid
  destructuring for hyphenated props like `aria-label`
  (oxc-project/oxc#28111)

Every JS/TS file in the repo compiles to identical code and diagnostics
on 0.155.0 and 0.156.0 (default and `compilationMode: 'all'`); the
source maps of Dropdown.tsx and helpers.ts differ only in the `names`
label of an optional-chain dependency. So do 9,706 TS/TSX/JSX files and
a 4,000-file JS sample from this repo’s dependencies (compiled under a
path outside node_modules), apart from five files in
`compilationMode: 'all'` whose differences come from
oxc-project/oxc#28165 and oxc-project/oxc#28005. No function changes
whether it compiles, and the public typings differ only in the
validateExhaustiveMemoizationDependencies default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acusti added a commit to acusti/uikit that referenced this pull request Oct 29, 2026
Through 0.155.0, a `try` left holding nothing that can throw (its risky
call commented out) made the compiler panic, aborting the process with
SIGABRT, a dev server included, or, when the `catch` branched, compile
the component to a function that renders nothing. Both compile as of
0.156.0 (oxc-project/oxc#28066). babel-plugin-react-compiler@1.0.0
skips the first and empties the second. Against 0.155.0 the test aborts
the Vitest worker on the first input, and the second input on its own
compiles without the memo cache or the element; both pass against
0.156.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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-react-compiler Area - React Compiler transforms and lint rules, oxc_react_compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-compiler: abort: a try body that cannot throw, with a catch that reassigns an outer let

1 participant