From 15e1e73f9cb7fd4a96f994816fa03be64715e428 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 28 Feb 2026 19:58:18 -0500 Subject: [PATCH] chore: add `batch.id` property (#17831) I cannot tell you how many times I have temporarily added this code to make it easier to debug some async stuff. I am extremely bored of doing so. I'm just going to add it to `main` to save myself the annoyance. We can remove it once everything async is stable --- packages/svelte/src/internal/client/reactivity/batch.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 4a4864581d..1575d6561d 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -76,7 +76,12 @@ export let is_flushing_sync = false; */ export let collected_effects = null; +let uid = 1; + export class Batch { + // for debugging. TODO remove once async is stable + id = uid++; + /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous`