Skip to content

breaking: avoid flushing queued updates on mount/hydrate #12587

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

Merged
merged 5 commits into from
Jul 24, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jul 24, 2024

I have a hunch that this might fix #12477.

Ultimately though, mount and hydrate shouldn't be considered synchronous. It prevents us from doing asynchronous things in the future, plus it slightly negatively impacts performance.

Copy link

changeset-bot bot commented Jul 24, 2024

🦋 Changeset detected

Latest commit: 2901e6e

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

@Rich-Harris
Copy link
Member

With this change, is there still a difference between flushSync(fn) and fn(), flushSync()? If not, should we retire the flushSync(fn) form?

@trueadm
Copy link
Contributor Author

trueadm commented Jul 24, 2024

With this change, is there still a difference between flushSync(fn) and fn(), flushSync()? If not, should we retire the flushSync(fn) form?

Doesn't it have some usage still for avoiding the microtask being created? In any case, we can defer that to an issue or another PR. I don't think it needs to be attached to this change.

@Rich-Harris Rich-Harris merged commit 20b8797 into main Jul 24, 2024
9 checks passed
@Rich-Harris Rich-Harris deleted the no-flush-sync-init branch July 24, 2024 19:32
Rich-Harris added a commit that referenced this pull request Jul 24, 2024
Rich-Harris added a commit that referenced this pull request Jul 24, 2024
…2593)

* Revert "breaking: avoid flushing queued updates on mount/hydrate (#12587)"

This reverts commit 20b8797.

* Update packages/svelte/src/internal/client/render.js
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: replaceState("/", {}) error
2 participants