From 1d6ef08ccf3aa1e0b4a0a9684581fbdb575849f0 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 12 Oct 2026 22:16:14 -0400 Subject: [PATCH] chore: remove small pieces not needed by any test - stale-source dependency in get_batch_value - saving/restoring stale_sources in eager() - is_eager early return in #find_earlier_batch - updating content.wv on fork commit --- packages/svelte/src/internal/client/reactivity/batch.js | 7 +------ packages/svelte/src/internal/client/runtime.js | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 97bb32fec7..f1b6e08ab1 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -581,8 +581,6 @@ export class Batch { } #find_earlier_batch() { - if (this.is_eager) return null; - for (var batch = this.prev; batch !== null; batch = batch.prev) { if (!batch.is_fork && this.dependent.has(batch)) { return batch; @@ -1271,15 +1269,12 @@ export function eager(fn) { // the first time this runs, we create an eager effect // that will run eagerly whenever the expression changes var previous_batch_values = batch_values; - var previous_stale_sources = stale_sources; try { batch_values = null; - stale_sources = null; value = fn(); } finally { batch_values = previous_batch_values; - stale_sources = previous_stale_sources; } return; @@ -1402,7 +1397,7 @@ export function fork(fn) { // apply changes and update write versions so deriveds see the change for (var [source, content] of batch.current) { source.v = content.v; - content.wv = source.wv = increment_write_version(); + source.wv = increment_write_version(); } // trigger any `$state.eager(...)` expressions with the new state. diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 0123560a7f..5c4abd95e4 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -748,8 +748,6 @@ function get_batch_value(signal, first_time) { } const batch = stale_sources?.get(signal); if (batch) { - if (!current.is_eager) batch.dependent.add(current); - // The reaction that read the stale value has to re-run in `batch`'s world. If we're inside // a derived, that's the derived (whose reactions get dirtied): `active_effect` is only the // derived's parent then, not the effect on whose behalf the derived is evaluated (which may