Skip to content

Conversation

Rich-Harris
Copy link
Member

I'm working to simplify some of the batching logic as a precursor to a larger overhaul that will hopefully make some of the gnarlier edge cases easier to wrangle.

This is a small step in that direction. Previously, we would reinstate a batch at the end of its life — this is one of those things that gets shoehorned into a codebase just to get the tests passing, but it never really made much sense to me. Turns out we don't need it.

The outcome is a simpler batch lifecycle — when you flush a batch, it either sticks around because it has pending async work or it gets removed straight away, with no zombie in-between state.

More to come in follow-up PRs

Copy link

changeset-bot bot commented Sep 25, 2025

⚠️ No Changeset found

Latest commit: 2c64556

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

Playground

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

* more

* remove unnecessary flushSync

* simplify
@Rich-Harris Rich-Harris merged commit ed0a393 into main Sep 25, 2025
15 of 16 checks passed
@Rich-Harris Rich-Harris deleted the simplify-batch branch September 25, 2025 18:36
Rich-Harris added a commit that referenced this pull request Sep 25, 2025
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.

2 participants