From 4d1436bb7903b4884849b4f4281fe3f4983d2d4d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 27 Mar 2026 15:13:11 -0700 Subject: [PATCH] fix --- .../src/internal/client/reactivity/batch.js | 52 +++++++++---------- .../svelte/src/internal/client/runtime.js | 7 +-- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index fc3eb25ca7..c764e6ed0c 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -266,7 +266,7 @@ export class Batch { } #process() { - console.group('process', this.id); + // console.group('process', this.id); current_batch = this; @@ -332,7 +332,7 @@ export class Batch { legacy_updates = null; if (this.#is_deferred() || this.#is_blocked()) { - console.log(this.#is_deferred() ? 'deferred' : 'blocked'); + // console.log(this.#is_deferred() ? 'deferred' : 'blocked'); this.#defer_effects(render_effects); this.#defer_effects(effects); @@ -340,7 +340,7 @@ export class Batch { reset_branch(e, t); } } else { - console.log('resolved'); + // console.log('resolved'); if (this.#pending.size === 0) { batches.delete(this); } @@ -389,7 +389,7 @@ export class Batch { this.#commit(); } - console.groupEnd(); + // console.groupEnd(); } /** @@ -773,28 +773,28 @@ export class Batch { } } - console.group('batch_values'); - for (const [value, v] of batch_values) { - console.log(this.current.has(value), value.label, v); - } - console.groupEnd(); - - console.group('batch_cvs'); - for (const [reaction, cv] of batch_cvs) { - console.log( - this.cvs.has(reaction), - cv, - reaction.deps?.map((d) => d.label), - reaction.label ?? reaction.fn - ); - } - console.groupEnd(); - - console.group('batch_wvs'); - for (const [value, wv] of batch_wvs) { - console.log(this.wvs.has(value), wv, value.label); - } - console.groupEnd(); + // console.group('batch_values'); + // for (const [value, v] of batch_values) { + // console.log(this.current.has(value), value.label, v); + // } + // console.groupEnd(); + + // console.group('batch_cvs'); + // for (const [reaction, cv] of batch_cvs) { + // console.log( + // this.cvs.has(reaction), + // cv, + // reaction.deps?.map((d) => d.label), + // reaction.label ?? reaction.fn + // ); + // } + // console.groupEnd(); + + // console.group('batch_wvs'); + // for (const [value, wv] of batch_wvs) { + // console.log(this.wvs.has(value), wv, value.label); + // } + // console.groupEnd(); } /** diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 41fa443c8f..b383e736ed 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -645,11 +645,8 @@ export function get(signal) { var value = derived.v; // if the derived is dirty and has reactions, or depends on the values that just changed, re-execute - // (a derived can be maybe_dirty due to the effect destroy removing its last reaction) - if ( - ((derived.f & CLEAN) === 0 && derived.reactions !== null) || - depends_on_old_values(derived) - ) { + // (a derived can be dirty due to the effect destroy removing its last reaction) + if ((is_dirty(derived) && derived.reactions !== null) || depends_on_old_values(derived)) { value = execute_derived(derived); }