fix: increment signal versions when discarding forks#17577
Merged
Rich-Harris merged 6 commits intomainfrom Jan 28, 2026
Merged
Conversation
Co-authored-by: David Roizenman <hmnd@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 1898a0e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
6 tasks
Contributor
|
Rich-Harris
added a commit
to hmnd/svelte
that referenced
this pull request
Jan 28, 2026
Rich-Harris
commented
Jan 28, 2026
paoloricciuti
approved these changes
Jan 28, 2026
Merged
Rich-Harris
added a commit
that referenced
this pull request
Jan 29, 2026
* fix: prevent reactivity loss during fork fixes #17197, fixes #17304, fixes #17301, fixes #17309 * add samples * add changeset * fix var casing in tests * don't remove reactions during fork * add sample for derived dep tracking in fork * fix sample type check error * set derived.v on first eval in fork * add sample for derived.v remaining UNINITIALIZED * lost current_batch import in runtime.js * Delete how * Update packages/svelte/src/internal/client/reactivity/deriveds.js * delete test in favour of #17577 * extract runtime.js changes into separate PR * alternative approach * revert * clear skipped branches when deferring * fix * fix * changeset * rename test * update test * unused test --------- Co-authored-by: David Roizenman <david@hmnd.io> Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> Co-authored-by: Tee Ming <chewteeming01@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Extracts part of #17335 and builds on it. If a derived is read for the first time inside a fork, we don't want to set
derived.v(unless it has no dependencies, in which case it can be cached forever), but we do want the derived to correctly update when it's subsequently read outside the fork. The easiest way to achieve that is to always treat a derived as dirty if its value isUNINITIALIZEDon read, which is what currently happens on this PR.Though maybe the correct fix looks more like this? Not 100% sure just yetEdit: yes, it is, added tests that confirm itBefore submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint