react/compiler
Nathan ea0c17b095
[compiler] loosen computed key restriction for compiler (#34902)
We have a whole ton of compiler errors due to us using a helper to
return breakpoints for CSS-in-js, which results in code like:

```
const styles = {
  [responsive.up('xl')]: { ... }
}
```

this results in TONS of bailouts due to `(BuildHIR::lowerExpression)
Expected Identifier, got CallExpression key in ObjectExpression`.

I was looking into what it would take to fix it and why we don't allow
it, and following the paper trail is seems like the gotchas have been
fixed with the new mutability aliasing model that is fully rolled out.
It looks like this is the same pattern/issue that was fixed (see
https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-object-expression-computed-key-modified-during-after-construction-hoisted-sequence-expr.js
and the old bug in
d58c07b563/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/bug-object-expression-computed-key-modified-during-after-construction-hoisted-sequence-expr.expect.md).

@josephsavona can you confirm if that's the case and if we're able to
drop this restriction now? (or alternatively, is there another case we
can ignore?)
2025-10-20 13:52:11 -07:00
..
apps/playground [playground] Allow accordion tabs to open on error (#34844) 2025-10-14 15:07:27 -04:00
docs Update DEVELOPMENT_GUIDE.md (#32281) 2025-03-13 11:45:26 -04:00
fixtures [cleanup] Remove compiler runtime-compat fixture library (#31430) 2024-11-05 14:14:39 -05:00
packages [compiler] loosen computed key restriction for compiler (#34902) 2025-10-20 13:52:11 -07:00
scripts [compiler] Fix incorrect version name (#34764) 2025-10-07 14:32:51 -04:00
.eslintrc.js [compiler:codegen] Wrap non-ascii characters in JsxExpressionContainer 2024-06-21 10:08:15 -04:00
.gitignore Remove leftover Rust script (#33314) 2025-05-20 12:20:51 -04:00
CHANGELOG.md [compiler] Update changelog for 19.1.0-rc.2 (#33207) 2025-05-15 10:34:11 -04:00
package.json [compiler] Script to produce markdown of lint rule docs (#34260) 2025-08-22 09:59:28 -07:00
README.md Update readme and other docs 2024-05-06 14:53:47 -07:00
yarn.lock [compiler] improve zod v3 backwards compat (#34877) 2025-10-16 09:46:55 -07:00

React Compiler

React Compiler is a compiler that optimizes React applications, ensuring that only the minimal parts of components and hooks will re-render when state changes. The compiler also validates that components and hooks follow the Rules of React.

More information about the design and architecture of the compiler are covered in the Design Goals.

More information about developing the compiler itself is covered in the Development Guide.