From 2912e4c49093ec07ccd31fdfd80026a1d1941332 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 13 Oct 2026 21:37:11 -0400 Subject: [PATCH] =?UTF-8?q?don't=20schedule=20effects=20in=20the=20next=20?= =?UTF-8?q?batch=20=E2=80=94=20the=20effect=20will=20be=20recreated=20if?= =?UTF-8?q?=20necessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/svelte/src/internal/client/reactivity/batch.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 57d9dedf71..311c1e7875 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -684,16 +684,12 @@ export class Batch { collected_effects = null; // if render effects wrote to state, they may have invalidated themselves (or - // an ancestor), in which case newly collected effects will be destroyed - // and recreated — hand them over to the next batch instead of running them now - var next = /** @type {Batch | null} */ (/** @type {unknown} */ (current_batch)); - - if (next !== null && effects.length > length) { + // an ancestor), in which case newly collected effects should not run + if (effects.length > length) { for (var i = length; i < effects.length; i += 1) { var e = effects[i]; if (has_dirty_ancestor(e)) { - next.schedule(e); e.f |= DESTROYED; // prevent it from running in `flush_queued_effects` } }