react/compiler
mofeiZ d99f8bba2e
[compiler] Delete LoweredFunction.dependencies and hoisted instructions (#32096)
LoweredFunction dependencies were exclusively used for dependency
extraction (in `propagateScopeDeps`). Now that we have a
`propagateScopeDepsHIR` that recursively traverses into nested
functions, we can delete `dependencies` and their associated synthetic
`LoadLocal`/`PropertyLoad` instructions.

[Internal snapshot
diff](https://www.internalfb.com/phabricator/paste/view/P1716950202) for
this change shows ~.2% of files changed. I [read through ~60 of the
changed
files](https://www.internalfb.com/phabricator/paste/view/P1733074307)
- most changes are due to better outlining (due to better DCE)
- a few changes in memo inference are due to changed ordering
```
// source
arr.map(() => contextVar.inner);

// previous instructions
$0 = LoadLocal arr
$1 = $0.map
// Below instructions are synthetic
$2 = LoadLocal contextVar
$3 = $2.inner
$4 = Function deps=$3 context=contextVar {
  ...
}
```
- a few changes are effectively bugfixes (see
`aliased-nested-scope-fn-expr`)
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32096).
* #32099
* #32286
* #32104
* #32098
* #32097
* __->__ #32096
2025-02-18 09:32:49 -07:00
..
apps/playground [compiler] Playground qol: shared compilation option directives with tests (#32012) 2025-01-09 12:38:16 -05:00
docs [compiler][be] Remove unused experimental Rust port 2025-01-24 12:23:31 -08:00
fixtures [cleanup] Remove compiler runtime-compat fixture library (#31430) 2024-11-05 14:14:39 -05:00
packages [compiler] Delete LoweredFunction.dependencies and hoisted instructions (#32096) 2025-02-18 09:32:49 -07:00
scripts [compiler] Switch to esbuild (#31963) 2025-01-02 16:59:56 -05:00
.eslintrc.js [compiler:codegen] Wrap non-ascii characters in JsxExpressionContainer 2024-06-21 10:08:15 -04:00
.gitignore [.gitignore] Add bundle script 2024-04-16 14:41:13 +01:00
package.json [compiler] Upgrade esbuild (#32368) 2025-02-12 11:59:56 -05:00
README.md Update readme and other docs 2024-05-06 14:53:47 -07:00
yarn.lock [compiler] Upgrade esbuild (#32368) 2025-02-12 11:59:56 -05: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.