mirror of https://github.com/sveltejs/svelte
chore: null out current_batch before committing branches (#17809)
Another small tweak extracted from #17805, just to make that diff a bit more legible. By passing the `batch` to the branch commit callback, we don't need to rely on the value of `current_batch` being the same as the batch currently being processed. That gives us more control over the order of operations — for example we can null out `current_batch` _before_ committing branches, which is important (at present, if a state change occurs while those branches are being committed, it will belong to the current batch, but the resulting effects will happen in the context of a _new_ batch, which is something we need to avoid for the sake of #17805). ### Before submitting the PR, please make sure you do the following - [x] 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 - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. - [x] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint`pull/17308/merge
parent
fa4f1c45f4
commit
b76cd5cafc
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
chore: null out current_batch before committing branches
|
||||
Loading…
Reference in new issue