Repository navigation
fix(react-compiler): compile a try whose catch is unreachable instead of panicking - #28066
Merged
graphite-app[bot] merged 1 commit intoOct 22, 2026
Merged
Conversation
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
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
Bot
force-pushed
the
claude/react-compiler-dead-try-catch-27404
branch
from
October 22, 2026 06:42
11ef086 to
5705644
Compare
…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
Bot
force-pushed
the
claude/react-compiler-dead-try-catch-27404
branch
from
October 22, 2026 06:43
5705644 to
e0f8937
Compare
graphite-app
Bot
deleted the
claude/react-compiler-dead-try-catch-27404
branch
October 22, 2026 06:48
This was referenced Oct 26, 2026
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>
53 of 95 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #27404
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 withoxc-transform-react, oxlintreact/*rules).After: compiles, with
xfolded to the constant0.Cause
Once dead-code elimination empties the
trybody,prune_maybe_throwsremoves the edge to thecatch, and the catch blocks become unreachable. Two references to them were left behind:trykept an operand for the catch path, somerge_consecutive_blockshit itsassert_eq!.predsstill counted the removed blocks, so it was not merged into its real predecessor. When thecatchhad more than one block, the code after thetrywas silently dropped:try { const u = 1 } catch { if (c) a(); else b(); } return <div />compiled tofunction 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 rendersnull.Fix
prune_maybe_throwsrecomputes predecessors, drops phi operands from removed blocks, and eliminates phis this makes redundant, as constant propagation already does.merge_consecutive_blocksassertion is now an Invariant diagnostic, so any remaining case skips the function instead of crashing.Tests
Five new fixtures: the issue repro, an
ifinside thecatch, a deadtryin a loop, nestedtry, and acatchwith no reassignment. Onmain, 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 apasscase forreact/invariant.AI disclosure: written with Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bvq2daQaudW29wmuShT7jq