Skip to content
Prev Previous commit
Next Next commit
Update on "compiler: treat pruned scope outputs as reactive"
Mostly addresses the issue with non-reactive pruned scopes. Before, values from pruned scopes would not be memoized, but could still be depended upon by downstream scopes. However, those downstream scopes would assume the value could never change. This could allow the developer to observe two different versions of a value - the freshly created one (if observed outside a scope) or a cached one (if observed inside, or through) a scope which used the value but didn't depend on it.

The fix here is to consider the outputs of pruned reactive scopes as reactive. Note that this is a partial fix because of things like control variables — the full solution would be to mark these values as reactive, and then re-run InferReactivePlaces. We can do this once we've fully converted our pipeline to use HIR everywhere. For now, this should fix most issues in practice because PruneNonReactiveDependencies already does basic alias tracking (see new fixture).

[ghstack-poisoned]
  • Loading branch information
josephsavona committed Jun 6, 2024
commit 6315a4e4e271431858a509eb6866bd9556572fa3
2 changes: 0 additions & 2 deletions compiler/packages/snap/src/SproutTodoFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,6 @@ const skipFilter = new Set([
"rules-of-hooks/rules-of-hooks-69521d94fa03",

// bugs
"bug-invalid-reactivity-value-block",
"bug-invalid-pruned-scope-leaks-value",
"bug-invalid-hoisting-functionexpr",
"original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block",
"original-reactive-scopes-fork/bug-hoisted-declaration-with-scope",
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.