Skip to content

fix(react-compiler): handle recursive function expressions - #26796

Merged
Boshen merged 2 commits into
oxc-project:mainfrom
brennanbutler01:fix/react-compiler-recursive-components
Sep 27, 2026
Merged

Boshen merged 2 commits into
oxc-project:mainfrom
brennanbutler01:fix/react-compiler-recursive-components

Conversation

@brennanbutler01

@brennanbutler01 brennanbutler01 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #26284.

Register named function expressions' private bindings before scope pruning so recursive components compile without an internal error. Preserve the existing manual-memoization bailout.

Verified just ready and 10 React 19.2.3 runtime scenarios covering recursion, prop updates, captured values, shadowing, and function identity.

AI assistance: OpenAI Codex.

Register a named function expression’s private binding before pruning reactive scopes. Capturing it in a nested callback otherwise references a missing memoization graph node and reports an internal error.

Cover recursive captures, direct references, shadowing, and the Oxlint diagnostic. Keep the manual memoization bailout covered separately.
Copilot AI lite review requested due to automatic review settings September 18, 2026 10:57

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.

@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 Sep 27, 2026
@codspeed

codspeed Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 86 skipped benchmarks1


Comparing brennanbutler01:fix/react-compiler-recursive-components (f027226) with main (0c105a1)

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

@Boshen
Boshen merged commit 2cac66f into oxc-project:main Sep 27, 2026
34 checks passed
graphite-app Bot pushed a commit that referenced this pull request Sep 28, 2026
# Oxlint
### 🚀 Features

- 9d80eed linter/react/only-export-components: Support `allowCompoundComponents` (#27117) (Kuroda Kayn)
- e05b155 linter: Add typescript/no-generated-empty-object-type (#26958) (camc314)

### 🐛 Bug Fixes

- 42dfbb5 linter/eslint/one-var: Keep `declare` when splitting declarations (#27081) (Cheolhee Lee)
- 2ba7e33 linter/eslint/require-await: Count `await using` as an await (#27080) (Cheolhee Lee)
- 611e4ed linter/plugins: Include executing selectors in JS plugin rule timings (#27111) (overlookmotel)
- 2cac66f react-compiler: Handle recursive function expressions (#26796) (Brennan Butler)
- e996e6c react-compiler: Treat zero-argument new Date as impure (#26894) (Boshen)
- 571cfa3 oxlint: Skip type-aware lint rules in type-check-only mode (#27076) (camc314)
- d0b2462 oxlint: Skip undefined children in CFG walker (#27075) (camc314)
- 5186328 parser: Handle HTML comment values (#22933) (Boshen)
- 0b630e8 linter/typescript/unified-signatures: Align rule with upstream (#26956) (camc314)
- ebb22f1 linter/node/no-exports-assign: Change category from style to suspicious (#26555) (Bartok)
- cce28a0 linter/import/no-duplicates: Distinguish import attributes (#26936) (camc314)
- feb733b linter/unicorn/prefer-spread: Stop checking string split calls (#26935) (camc314)
- 929e154 linter/eslint/no-unused-vars: Honor ignore patterns inside array rest bindings (#26923) (camc314)
- 5bdb9b8 linter/eslint/no-unused-vars: Recognize consumed update expressions (#26782) (camc314)
- 5c05bef linter/eslint/prefer-const: Ignore embedded assignments (#26920) (camc314)

### ⚡ Performance

- ded4c29 linter/eslint/no-unused-vars: Skip sequence checks when absent (#26921) (camc314)
# Oxfmt
### 🚀 Features

- e0b1f9f oxfmt: Bump bundled Prettier version to 3.9.9 (#27002) (leaysgur)
- 342527d oxfmt: Bump bundled Prettier version to 3.9.8 (#26999) (leaysgur)

### 🐛 Bug Fixes

- eeba1db formatter: Skip test-call layout when arguments have comments (#27119) (leaysgur)
- 1f7b8ad oxfmt: Allow repeated CLI calls in the same process (#27051) (Liang)
- 7bcb807 formatter_markdown: Keep blank line between HTML and nested list (#27112) (leaysgur)
- 10b10c5 formatter: Keep comments around `=` on their side and line (#27041) (leaysgur)
- 9aad365 formatter: Keep comments deferred before an assignment operator (#26997) (waltu)
- 8fbddb1 formatter/jsdoc: More alignment with original plugin (#27039) (leaysgur)
- 50be18e formatter: Keep trailing spaces on normal block comments (#27037) (leaysgur)
- 56d1880 formatter: Nestle adjacent block comments (#27036) (leaysgur)
- 3be5d94 formatter: Treat `/***` comments as JSDoc (#27035) (leaysgur)
- cd45f71 formatter: Keep trailing double spaces on JSDoc lines (#26861) (John Costa)
- fd695f4 formatter_markdown: Fix more mismatches found in ecosystem-ci repos (#27003) (leaysgur)
- 4e77d59 formatter_markdown: Keep a math span after a kept line break from opening a block (#27001) (leaysgur)
- 584b8b0 formatter_markdown: Keep a shape line after a multi-line inline node or link title (#27000) (leaysgur)
- b939645 formatter_markdown: Keep a line break before an inline liquid tag under preserve (#26998) (leaysgur)
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.

linter: Expected a node for all identifiers, none found for 0

4 participants