dillon1000/react
Commit
Browse files [compiler] Add reactive flag on scope dependencies (#33325)
When collecting scope dependencies, mark each dependency with `reactive: true | false`. This prepares for later PRs https://github.com/facebook/react/pull/33326 and https://github.com/facebook/react/pull/32099 which rewrite scope dependencies into instructions. Note that some reactive objects may have non-reactive properties, but we do not currently track this. Technically, state[0] is reactive and state[1] is not. Currently, both would be marked as reactive. ```js const state = useState(); ``` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33325). * #33326 * __->__ #33325 * #32286
Changed paths7 files
First-parent comparisoncompiler/packages/babel-plugin-react-compiler/src/HIR/CollectHoistablePropertyLoads.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/HIR/CollectOptionalChainDependencies.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/HIR/DeriveMinimalDependenciesHIR.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/HIR/PropagateScopeDependenciesHIR.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Inference/InferReactivePlaces.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/MergeReactiveScopesThatInvalidateTogether.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…