From 021b5b4767b9013e9211e8540c00232668fef516 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 17 Jun 2024 16:29:43 -0400 Subject: [PATCH] get rid of force_schedule --- .../svelte/src/internal/client/reactivity/deriveds.js | 4 +--- .../svelte/src/internal/client/reactivity/sources.js | 2 +- packages/svelte/src/internal/client/runtime.js | 9 ++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/deriveds.js b/packages/svelte/src/internal/client/reactivity/deriveds.js index f13607ef95..b9ed9d0864 100644 --- a/packages/svelte/src/internal/client/reactivity/deriveds.js +++ b/packages/svelte/src/internal/client/reactivity/deriveds.js @@ -4,7 +4,6 @@ import { current_effect, remove_reactions, set_signal_status, - mark_reactions, current_skip_reaction, execute_reaction_fn, destroy_effect_children, @@ -80,10 +79,9 @@ function destroy_derived_children(signal) { /** * @param {import('#client').Derived} derived - * @param {boolean} force_schedule * @returns {void} */ -export function update_derived(derived, force_schedule) { +export function update_derived(derived) { var previous_updating_derived = updating_derived; updating_derived = true; destroy_derived_children(derived); diff --git a/packages/svelte/src/internal/client/reactivity/sources.js b/packages/svelte/src/internal/client/reactivity/sources.js index 904d99332e..6ae154c8e0 100644 --- a/packages/svelte/src/internal/client/reactivity/sources.js +++ b/packages/svelte/src/internal/client/reactivity/sources.js @@ -91,7 +91,7 @@ export function set(source, value) { source.v = value; source.version = increment_version(); - mark_reactions(source, true); + mark_reactions(source); // If the current signal is running for the first time, it won't have any // reactions as we only allocate and assign the reactions after the signal diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 38a5a93447..30e301b3cb 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -172,7 +172,7 @@ export function check_dirtiness(reaction) { var dependency = dependencies[i]; if (!is_dirty && check_dirtiness(/** @type {import('#client').Derived} */ (dependency))) { - update_derived(/** @type {import('#client').Derived} **/ (dependency), true); + update_derived(/** @type {import('#client').Derived} **/ (dependency)); } if (is_derived) { @@ -762,7 +762,7 @@ export function get(signal) { (flags & DERIVED) !== 0 && check_dirtiness(/** @type {import('#client').Derived} */ (signal)) ) { - update_derived(/** @type {import('#client').Derived} **/ (signal), false); + update_derived(/** @type {import('#client').Derived} **/ (signal)); } return signal.v; @@ -807,10 +807,9 @@ export function invalidate_inner_signals(fn) { /** * @param {import('#client').Value} signal - * @param {boolean} force_schedule * @returns {void} */ -export function mark_reactions(signal, force_schedule) { +export function mark_reactions(signal) { var reactions = signal.reactions; if (reactions === null) return; @@ -836,7 +835,7 @@ export function mark_reactions(signal, force_schedule) { // We skip any effects that are already dirty. Additionally, we also // skip if the reaction is the same as the current effect (except if we're not in runes or we // are in force schedule mode). - if ((flags & DIRTY) !== 0 || ((!force_schedule || !runes) && reaction === current_effect)) { + if ((flags & DIRTY) !== 0 || (!runes && reaction === current_effect)) { continue; }