rerun reactive declarations if the reactive declared variable is mutated #5045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2444
The demo in #2444 was fixed in v3.2.1 but broken again since v3.16.0
The test case added in #2694 didn't handle a particular case in the demo where there's another declaration that should be invalidated too:
after #2694 mutating
var_b
, would$$invalidate
var_b
&foo
.but because
foo
wasn't mutated anywhere,var_a
is marked asfixed_reactive_declarations
instead, and$$invalidate
foo
will not produce a newvar_a
.This fix is to mark
foo
as mutated ifvar_b
orvar_a
is mutated.Before submitting the PR, please make sure you do the following
npm run lint
!)Tests
npm test
oryarn test
)