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: further improvements to effect scheduling and flushing #10971

Merged
merged 16 commits into from
Mar 29, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Mar 28, 2024

Fixes #10946

This a follow up to 10949. Now we have true topological ordering of effects, it makes sense to try and improve certain parts of the processing of the nested effects.

Whilst looking into the bug referenced above, I noticed that we traverse into inert/destroyed effect trees, which is just pointless. I also noticed that maybe after the refactors in this PR, maybe we could just invoke render effects directly. Everything passes but one e2e test to do with custom elements. So maybe this is promising!

I also noticed that flushing of local render effects wasn't correctly setting the counter back to zero like we do in other places – which is another reported issue when using legacy effects with beforeUpdate, as that triggers this code path. I added a test to capture that not failing.

Copy link

changeset-bot bot commented Mar 28, 2024

🦋 Changeset detected

Latest commit: a7981b6

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

is_flushing_effect = true;

try {
// When working with custom elements, the root effects might not have a root
Copy link
Member

Choose a reason for hiding this comment

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

what does 'the root effects might not have a root' mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was prior to this PR. The render effect is custom element logic has no root

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

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

couple of minor suggestions but LGTM

trueadm and others added 2 commits March 28, 2024 23:49
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
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: ERR_SVELTE_TOO_MANY_UPDATES
2 participants