Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: keep derived cache, but clear it in mark_reactions#17116

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Rich-Harris
Copy link
Member

@changeset-bot
Copy link

⚠️ No Changeset found

Latest commit:42c8d69

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

Playground

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

Copy link
Member

@Ocean-OSOcean-OS left a comment

Choose a reason for hiding this comment

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

Does this need a changeset?

@Rich-Harris
Copy link
MemberAuthor

no changeset needed as it's not targetingmain

Ocean-OS reacted with thumbs up emoji

@Ocean-OSOcean-OS merged commit6ca6245 intoremove-unowned-another-fixNov 5, 2025
14 checks passed
@Ocean-OSOcean-OS deleted the remove-unowned-another-fix-2 branchNovember 5, 2025 18:32
Rich-Harris added a commit that referenced this pull requestNov 5, 2025
* fix: delete from batch_values on updatesThis fixes a bug where a derived would still show its old value even after it was indirectly updated again within the same batch. This can for example happen by reading a derived on an effect, then writing to a source in that same effect that makes the derived update, and then read the derived value in a sibling effect - it still shows the old value without the fix.The fix is to _delete_ the value from batch_values, as it's now the newest value across all batches. In order to not prevent breakage on other batches we have to leave the status of deriveds as-is, i.e. within is_dirty and update_derived we cannot update its status. That might be a bit more inefficient as you now have to traverse the graph for each `get` of that derived (it's a bit like they are all disconnected) but we can always optimize that later if need be.Another advantage of this fix is that we can get rid of duplicate logic we had to add about unmarking and reconnecting deriveds, because that logic was only needed for the case where deriveds are read after they are updated, which now no longer hits that if-branch* keep derived cache, but clear it in mark_reactions (#17116)---------Co-authored-by: Rich Harris <rich.harris@vercel.com>
dummdidumm added a commit that referenced this pull requestNov 6, 2025
Fixes#17024Fixes#17049 (comment) (and therefore everything that was still buggy in that issue I think)* chore: remove unowned check when calling `e.effect_in_unowned_derived`* WIP* all non-unit tests passing* tidy* WIP* WIP* WIP* note to self* fix* fix* hmm maybe not* try this* simplify* remove skip_reaction* docs* add changeset, in case this results in changed behaviour* Update packages/svelte/src/internal/client/reactivity/effects.jsCo-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>*fix#17024* fix comment* revert* fix* dry* changeset* fix WAS_MARKED logic* failing test (that uncovered other unrelated bug) + fix* fix: delete from batch_values on updates (#17115)* fix: delete from batch_values on updatesThis fixes a bug where a derived would still show its old value even after it was indirectly updated again within the same batch. This can for example happen by reading a derived on an effect, then writing to a source in that same effect that makes the derived update, and then read the derived value in a sibling effect - it still shows the old value without the fix.The fix is to _delete_ the value from batch_values, as it's now the newest value across all batches. In order to not prevent breakage on other batches we have to leave the status of deriveds as-is, i.e. within is_dirty and update_derived we cannot update its status. That might be a bit more inefficient as you now have to traverse the graph for each `get` of that derived (it's a bit like they are all disconnected) but we can always optimize that later if need be.Another advantage of this fix is that we can get rid of duplicate logic we had to add about unmarking and reconnecting deriveds, because that logic was only needed for the case where deriveds are read after they are updated, which now no longer hits that if-branch* keep derived cache, but clear it in mark_reactions (#17116)---------Co-authored-by: Rich Harris <rich.harris@vercel.com>Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Ocean-OSOcean-OSOcean-OS approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Rich-Harris@Ocean-OS

[8]ページ先頭

©2009-2025 Movatter.jp