diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js index 1d2f7e597c..250b89a398 100644 --- a/packages/svelte/src/internal/client/dom/blocks/boundary.js +++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js @@ -30,6 +30,7 @@ import { queue_boundary_micro_task } from '../task.js'; import * as e from '../../../shared/errors.js'; import { DEV } from 'esm-env'; import { from_async_derived, set_from_async_derived } from '../../reactivity/deriveds.js'; +import { changeset } from '../../reactivity/sources.js'; /** * @typedef {{ @@ -317,10 +318,9 @@ export class Boundary { } /** - * @param {Set} changeset * @param {(fork: Fork) => void} fn */ - fork(changeset, fn) { + fork(fn) { if (!active_fork || !this.#forks.has(active_fork)) { active_fork = new Fork(this, changeset); this.#forks.add(active_fork); @@ -328,10 +328,7 @@ export class Boundary { fn(active_fork); - if (!active_fork.suspended) { - active_fork.commit(); - } - + active_fork.commit(); active_fork = null; } @@ -427,8 +424,6 @@ export class Fork { return; } - this.suspended = false; - for (const e of this.#render_effects) { try { // if (check_dirtiness(e)) { @@ -458,15 +453,11 @@ export class Fork { } increment() { - if (this.#pending_count++ === 0) { - this.suspended = true; - } + this.#pending_count += 1; } decrement() { - if (--this.#pending_count === 0) { - this.suspended = false; - } + this.#pending_count -= 1; } discard() { diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 11e99db1d3..c089abad92 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -832,7 +832,7 @@ function process_effects(effect, fork) { set_signal_status(current_effect, CLEAN); } } else if ((flags & BOUNDARY_EFFECT) !== 0) { - /** @type {Boundary} */ (current_effect.b).fork(changeset, (fork) => { + /** @type {Boundary} */ (current_effect.b).fork((fork) => { process_effects(/** @type {Effect} */ (current_effect), fork); }); } else if ((flags & EFFECT) !== 0) {