mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
3ab47ac6bd2818ab04d069803cff5271012ee146
This PR adds one remaining feature to InferReactivePlaces: tracking indirections like LoadLocal, PropertyLoad, and similar. Consider something like: ``` // INPUT x.push(reactiveValue); // HIR t0 = LoadLocal 'x' t1 = PropertyLoad t0, 'push' t2 = LoadLocal 'reactiveValue' // reactive t3 = CallExpression mutate t0 . read t1 ( read t2 ) ``` Because a reactive value (`t2`) flows into `t0`, we want to record t0 as reactive as well. But that's just the temporary for `LoadLocal 'x'` - what's really happening is that from this point, `x` is reactive. InferReactiveIdentifiers tracked this, and now that logic is ported into InferReactivePlaces as well. That lets us remove all the actual inference from InferReactiveIdentifiers.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%