react/compiler/packages
Joseph Savona ddf8bc3fba
[compiler] Improve merging of scopes that invalidate together (#34049)
We try to merge consecutive reactive scopes that will always invalidate
together, but there's one common case that isn't handled.

```js
const y = [[x]];
```

Here we'll create two consecutive scopes for the inner and outer array
expressions. Because the input to the second scope is a temporary,
they'll merge into one scope.

But if we name the inner array, the merging stops:

```js
const array = [x];
const y = [array];
```

This is because the merging logic checks if all the dependencies of the
second scope are outputs of the first scope, but doesn't account for
renaming due to LoadLocal/StoreLocal. The fix is to track these
temporaries.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34049).
* __->__ #34049
* #34047
* #34044
2025-08-01 13:00:01 -07:00
..
babel-plugin-react-compiler [compiler] Improve merging of scopes that invalidate together (#34049) 2025-08-01 13:00:01 -07:00
eslint-plugin-react-compiler Enable ref validation in linter (#34044) 2025-07-29 12:30:29 -07:00
make-read-only-util [compiler] Add missing copyrights (#33004) 2025-04-23 22:04:44 -04:00
react-compiler-healthcheck [compiler] Add missing copyrights (#33004) 2025-04-23 22:04:44 -04: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 [mcp] Add MCP tool to print out the component tree of the currently open React App (#33305) 2025-06-02 21:42:34 -07:00
snap [compiler][wip] Improve diagnostic infra (#33751) 2025-07-24 15:37:06 -07:00