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 child effects are destroyed before their deriveds #14043

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 30, 2024

Fixes #14025. We should be destroying child effects before deriveds, it was obviously on reflection now. Also means we can undo the changes in #13611!

Copy link

changeset-bot bot commented Oct 30, 2024

🦋 Changeset detected

Latest commit: 5649964

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

pkg-pr-new bot commented Oct 30, 2024

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

commit: 5649964

@dummdidumm
Copy link
Member

what happens in runes mode? Do we have a similar situation there?

@trueadm
Copy link
Contributor Author

trueadm commented Oct 30, 2024

@dummdidumm Nope. In runes mode that example seems to work fine for me. https://svelte.dev/playground/9f385dbe4c29498482b870f4bff9e2de?version=5.1.4

Actually, adding a default value causes a mishap:
https://svelte.dev/playground/9f385dbe4c29498482b870f4bff9e2de?version=5.1.4

I'll investigate.

@trueadm trueadm changed the title fix: ensure legacy props cache last value when destroyed fix: ensure derived props cache last value when destroyed Oct 30, 2024
@trueadm trueadm marked this pull request as draft October 30, 2024 18:52
@trueadm trueadm marked this pull request as ready for review October 30, 2024 18:55
@trueadm
Copy link
Contributor Author

trueadm commented Oct 30, 2024

A far simpler approach and more test coverage added!

@trueadm trueadm changed the title fix: ensure derived props cache last value when destroyed fix: ensure child effects are destroyed before their deriveds Oct 30, 2024
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Great stuff

@trueadm trueadm merged commit bce1c48 into main Oct 30, 2024
10 checks passed
@trueadm trueadm deleted the legacy-derived-prop-destroyed branch October 30, 2024 19:35
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
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: Props consumed from onDestroy are revalidated if not consumed in the template
3 participants