Skip to content

fix: ensure untrack correctly retains the active reaction #15065

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

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jan 20, 2025

As documented in #14784, one of the downsides of untrack today is that it sets the active reaction to null. This is highly problematic as it leads to the effect tree being malformed – as shown with the test case. Instead of setting active_reaction to null we instead use an untracking flag. To prevent breaking changes, writes inside of untrack are permitted.

This doesn't fix the issues are making writes inside untrack possibly causing glitching, but I think fixing the bigger issue of the effect tree being mangled is probably as important.

Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: f824049

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

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@15065

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-svelte-15065-svelte.vercel.app/

this is an automated message

Copy link
Member

@paoloricciuti paoloricciuti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@trueadm trueadm merged commit 2ad5195 into main Jan 21, 2025
11 checks passed
@trueadm trueadm deleted the fix-untrack branch January 21, 2025 11:02
@github-actions github-actions bot mentioned this pull request Jan 20, 2025
@gyzerok gyzerok mentioned this pull request Jan 21, 2025
elliott-with-the-longest-name-on-github added a commit that referenced this pull request Jan 23, 2025
…15097)

* Revert "fix: ensure untrack correctly retains the active reaction (#15065)"

This reverts commit 2ad5195.

* feat: Remove repository-sync workflows in favor of github-docs-bot

* Revert "Revert "fix: ensure untrack correctly retains the active reaction (#15065)""

This reverts commit f4e98bf.
Rich-Harris pushed a commit that referenced this pull request Jan 27, 2025
* Revert "fix: ensure untrack correctly retains the active reaction (#15065)"

This reverts commit 2ad5195.

* feat: Add `bind:focused` to `HTMLAttributes`

* Revert "Revert "fix: ensure untrack correctly retains the active reaction (#15065)""

This reverts commit f4e98bf.

* changeset

* tests
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.

3 participants