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: only abort effect flushing if it causes an existing effect to be scheduled#16623

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

Closed
Rich-Harris wants to merge7 commits intomainfromgh-16548

Conversation

@Rich-Harris
Copy link
Member

Alternative to#16612 which I think is probably a bit simpler, and hopefully results in a greater performance boost.

Whereas#16612 works by flushing parts of the effect tree when an invalidation occurs, such that to-be-destroyed effects are destroyed before they can re-execute, this comes from the opposite end — we continue to abort flushing if a state change occurs in a user effect, butonly if that state change results in an existing effect being marked (the cause of#16072).

Fixes#16548.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC:https://github.com/sveltejs/rfcs
  • Prefix your PR title withfeat:,fix:,chore:, ordocs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code withinpackages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests withpnpm test and lint the project withpnpm lint

@changeset-bot
Copy link

changeset-botbot commentedAug 14, 2025
edited
Loading

🦋 Changeset detected

Latest commit:87e5d00

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
sveltePatch

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

@github-actions
Copy link
Contributor

Playground

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

@Rich-Harris
Copy link
MemberAuthor

Inf89e355 I tried restricting things to block effects, on the basis that (I think?) the only way#16072 could reoccur is if a block containing a scheduled effect is destroyed. It causes one of the finicky ordering tests to fail, so I don't know if it's the right fix, but I'm curious as to whether it'll address#16548 (comment).

Of note: while it helps in the case that you're renderingthis component many times...

<script>let inited=$state(false);$effect(()=> {    inited=true;  });</script><p>{inited}</p>

...you do still get an erroneous infinite loop error if theinited state isreferenced in a block effect:

<script>let inited=$state(false);$effect(()=> {    inited=true;  });</script>{#ifinited}  <p>{inited}</p>{/if}

@dummdidumm
Copy link
Member

Pretty sure you can fix the test by doing the same as I did in my latest commit to#16612 which is collecting all user/render effects of dirty branches regardless of whether they are dirty or not.

@dummdidumm
Copy link
Member

closing in favor of#16631

@dummdidummdummdidumm deleted the gh-16548 branchAugust 17, 2025 12:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Application using LayerChart hanging after updating Svelte to 5.36.0+ (loggingUpdatedAtError in 5.36.5+)

3 participants

@Rich-Harris@dummdidumm

[8]ページ先頭

©2009-2025 Movatter.jp