react/compiler/packages
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
..
babel-plugin-react-compiler [compiler] loosen computed key restriction for compiler (#34902) 2025-10-20 13:52:11 -07:00
eslint-plugin-react-compiler [compiler] Cleanup and enable validateNoVoidUseMemo (#34882) 2025-10-16 13:08:57 -07:00
make-read-only-util [compiler] Add missing copyrights (#33004) 2025-04-23 22:04:44 -04:00
react-compiler-healthcheck [compiler] improve zod v3 backwards compat (#34877) 2025-10-16 09:46:55 -07:00
react-compiler-runtime [compiler] Add missing copyrights (#33004) 2025-04-23 22:04:44 -04:00
react-forgive [forgive][ez] Tweak logging (#33011) 2025-04-24 13:30:16 -04:00
react-mcp-server [compiler] improve zod v3 backwards compat (#34877) 2025-10-16 09:46:55 -07:00
snap [compiler] improve zod v3 backwards compat (#34877) 2025-10-16 09:46:55 -07:00