From b779acc375384664d6800e22f6e9bf6956e9b80e Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 17 Jun 2024 21:53:57 -0400 Subject: [PATCH] undo name change for now, to minimise diff --- .../src/internal/client/reactivity/deriveds.js | 4 ++-- .../svelte/src/internal/client/reactivity/effects.js | 8 ++++---- .../svelte/src/internal/client/reactivity/sources.js | 4 ++-- packages/svelte/src/internal/client/runtime.js | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/deriveds.js b/packages/svelte/src/internal/client/reactivity/deriveds.js index f3eb99ee7e..04c060d74e 100644 --- a/packages/svelte/src/internal/client/reactivity/deriveds.js +++ b/packages/svelte/src/internal/client/reactivity/deriveds.js @@ -4,7 +4,7 @@ import { current_effect, remove_reactions, set_signal_status, - update_reaction, + execute_reaction_fn, destroy_effect_children, increment_version } from '../runtime.js'; @@ -84,7 +84,7 @@ export function update_derived(derived) { var previous_updating_derived = updating_derived; updating_derived = true; destroy_derived_children(derived); - var value = update_reaction(derived); + var value = execute_reaction_fn(derived); updating_derived = previous_updating_derived; var status = (derived.f & UNOWNED) !== 0 && derived.deps !== null ? MAYBE_DIRTY : CLEAN; diff --git a/packages/svelte/src/internal/client/reactivity/effects.js b/packages/svelte/src/internal/client/reactivity/effects.js index 4516a86441..4c578bdd25 100644 --- a/packages/svelte/src/internal/client/reactivity/effects.js +++ b/packages/svelte/src/internal/client/reactivity/effects.js @@ -5,7 +5,7 @@ import { current_reaction, destroy_effect_children, dev_current_component_function, - update_effect, + execute_effect, get, is_destroying_effect, is_flushing_effect, @@ -106,7 +106,7 @@ function create_effect(type, fn, sync) { try { set_is_flushing_effect(true); - update_effect(effect); + execute_effect(effect); effect.f |= EFFECT_RAN; } finally { set_is_flushing_effect(previously_flushing_effect); @@ -267,7 +267,7 @@ export function legacy_pre_effect_reset() { var effect = token.effect; if (check_dirtiness(effect)) { - update_effect(effect); + execute_effect(effect); } token.ran = false; @@ -479,7 +479,7 @@ function resume_children(effect, local) { // If a dependency of this effect changed while it was paused, // apply the change now if (check_dirtiness(effect)) { - update_effect(effect); + execute_effect(effect); } var child = effect.first; diff --git a/packages/svelte/src/internal/client/reactivity/sources.js b/packages/svelte/src/internal/client/reactivity/sources.js index 9196a709d3..6ae154c8e0 100644 --- a/packages/svelte/src/internal/client/reactivity/sources.js +++ b/packages/svelte/src/internal/client/reactivity/sources.js @@ -13,7 +13,7 @@ import { set_signal_status, untrack, increment_version, - update_effect, + execute_effect, inspect_effects } from '../runtime.js'; import { equals, safe_equals } from './equality.js'; @@ -123,7 +123,7 @@ export function set(source, value) { if (DEV) { for (const effect of inspect_effects) { - update_effect(effect); + execute_effect(effect); } inspect_effects.clear(); diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index fe84211672..cb851fd7d2 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -259,7 +259,7 @@ function handle_error(error, effect, component_context) { * @param {import('#client').Reaction} reaction * @returns {V} */ -export function update_reaction(reaction) { +export function execute_reaction_fn(reaction) { const previous_dependencies = current_dependencies; const previous_untracked_writes = current_untracked_writes; const previous_reaction = current_reaction; @@ -381,7 +381,7 @@ export function destroy_effect_children(signal, remove_dom = true) { * @param {import('#client').Effect} effect * @returns {void} */ -export function update_effect(effect) { +export function execute_effect(effect) { var flags = effect.f; if ((flags & DESTROYED) !== 0) { @@ -409,7 +409,7 @@ export function update_effect(effect) { } execute_effect_teardown(effect); - var teardown = update_reaction(effect); + var teardown = execute_reaction_fn(effect); effect.teardown = typeof teardown === 'function' ? teardown : null; effect.version = increment_version(); @@ -479,12 +479,12 @@ function flush_queued_effects(effects) { var effect = effects[i]; if ((effect.f & (DESTROYED | INERT)) === 0 && check_dirtiness(effect)) { - update_effect(effect); + execute_effect(effect); // Effects with no dependencies or teardown do not get added to the effect tree. // Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we // don't know if we need to keep them until they are executed. Doing the check - // here (rather than in `update_effect`) allows us to skip the work for + // here (rather than in `execute_effect`) allows us to skip the work for // immediate effects. if (effect.deps === null && effect.first === null && effect.dom === null) { if (effect.teardown === null) { @@ -570,7 +570,7 @@ function process_effects(effect, collected_effects) { if ((flags & RENDER_EFFECT) !== 0) { if (!is_branch && check_dirtiness(current_effect)) { - update_effect(current_effect); + execute_effect(current_effect); // Child might have been mutated since running the effect child = current_effect.first; }