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 reactions of non-updating deriveds have their version synced #15434

Closed
wants to merge 2 commits into from

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Mar 4, 2025

This fixes #15414. However, we have a test that fails with this change derived-write-read-write-read. That's because the new logic prevents over-firing the effect in this case, as per design.

So we have two options:

  • we state that deriveds are pure and thus can over-fire in some cases – this is already true for unowned deriveds. There's nothing technically wrong with this behaviour.
  • we remove the existing failing test and go with this strategy

@svelte-docs-bot
Copy link

Copy link
Contributor

github-actions bot commented Mar 4, 2025

Playground

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

Copy link

changeset-bot bot commented Mar 4, 2025

🦋 Changeset detected

Latest commit: 3028e7a

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

@paoloricciuti
Copy link
Member

I would say if we have to chose I lean towards keeping the test and just state that deriveds can overfire

@trueadm trueadm closed this Mar 4, 2025
@trueadm
Copy link
Contributor Author

trueadm commented Mar 4, 2025

Agreed

@trueadm trueadm deleted the sync-versions branch March 4, 2025 19:52
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.

$derived unexpectedly reevaluate
2 participants