Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure reactivity system remains consistent with removals #13087

Merged
merged 4 commits into from
Sep 2, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Aug 30, 2024

Fixes #13002.

There were actually a few issues that needed resolving:

  • we weren't correctly disconnecting effects from the parents effects (if an effect is created in a derived, and that derived is in a branch, then the child effect will go to the branch)
  • we had a linked list on deriveds for ownership of effects, which was pointless as it was also the same linked list used on effects – meaning a deriveds child would incorrectly then link to when to the effect graph – causing all sorts of random things being destroyed. I have no idea how this went missed, but we just now use a single array called children to store any effects or deriveds that are owned by a derived.
  • when we execute effects we need to ensure that the child is the latest after updating deriveds

Copy link

changeset-bot bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: 6e1c414

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@trueadm trueadm merged commit 6f855e6 into main Sep 2, 2024
9 checks passed
@trueadm trueadm deleted the fix-reactivity-issues branch September 2, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Svelte 5: fromStore breaks reactivity when used with @const
2 participants