dillon1000/react
Commit
Browse files Propagate reactive scope dependencies transitively
During PruneNonReactiveDependencies, we sometimes need to promote a value from non-reactive to reactive if it ended up being grouped in the same reactive scope as some other reactive value. This generally happens due to interleaving mutations. In this case all downstream usage of the promoted value need to also be considered reactive. Fully propagating the reactivity requires re-running InferReactivePlaces, to account for things like control reactivity. We can't yet reuse that pass here though, because we haven't unified the pipeline on HIR yet. For now, we propagate the reactivity through local variables and downstream reactive scopes. See test fixtures for some examples that now correctly propagate reactivity and some that need the full reactivity inference to run correctly. The latter cases are handled in the next PR.
Changed paths4 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneNonReactiveDependencies.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-if.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-if.js AddedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactivity-analysis-interleaved-reactivity.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…