diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index f7397b2b4e..c78c27dd18 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -516,7 +516,7 @@ function mark_lis(a) { } /** - * @param {import('../../types.js').Block} block + * @param {import('../../types.js').EachItemBlock} block * @param {Element | Comment | Text} dom * @param {boolean} is_controlled * @param {null | Text | Element | Comment} sibling @@ -537,7 +537,7 @@ function insert_each_item_block(block, dom, is_controlled, sibling) { } /** - * @param {import('../../types.js').Block} block + * @param {import('../../types.js').EachItemBlock} block * @returns {Text | Element | Comment} */ function get_first_child(block) { @@ -551,7 +551,7 @@ function get_first_child(block) { } /** - * @param {import('../../types.js').Block} block + * @param {import('../../types.js').EachItemBlock} block * @returns {Text | Element | Comment} */ export function get_first_element(block) { @@ -595,45 +595,6 @@ function update_each_item_block(block, item, index, type) { } } -/** - * @param {import('../../types.js').EachItemBlock} block - * @param {null | Array} transition_block - * @param {boolean} apply_transitions - * @param {any} controlled - * @returns {void} - */ -export function destroy_each_item_block( - block, - transition_block, - apply_transitions, - controlled = false -) { - const transitions = block.s; - - if (apply_transitions && transitions !== null) { - // We might have pending key transitions, if so remove them first - for (let other of transitions) { - if (other.r === 'key') { - transitions.delete(other); - } - } - if (transitions.size === 0) { - block.s = null; - } else { - // trigger_transitions(transitions, 'out'); - if (transition_block !== null) { - transition_block.push(block); - } - return; - } - } - const dom = block.e.dom; - if (!controlled && dom !== null) { - remove(dom); - } - destroy_signal(/** @type {import('../../types.js').EffectSignal} */ (block.e)); -} - /** * @template V * @param {V} item diff --git a/packages/svelte/src/internal/client/reactivity/computations.js b/packages/svelte/src/internal/client/reactivity/computations.js index 7f01774d79..c1e018e695 100644 --- a/packages/svelte/src/internal/client/reactivity/computations.js +++ b/packages/svelte/src/internal/client/reactivity/computations.js @@ -28,12 +28,10 @@ import { * @template V * @param {import('../types.js').SignalFlags} flags * @param {V} value - * @param {import('../types.js').Block | null} block */ -function create_computation_signal(flags, value, block) { +function create_computation_signal(flags, value) { /** @type {import('../types.js').ComputationSignal} */ const signal = { - b: block, c: null, d: null, e: null, @@ -72,14 +70,14 @@ export function push_reference(target_signal, ref_signal) { /** * @param {import('../types.js').EffectType} type - * @param {(() => void | (() => void)) | ((b: import('../types.js').Block) => void | (() => void))} fn + * @param {(() => void | (() => void))} fn * @param {boolean} sync - * @param {null | import('../types.js').Block} block + * @param {null} block * @param {boolean} schedule * @returns {import('../types.js').EffectSignal} */ function internal_create_effect(type, fn, sync, block, schedule) { - const signal = create_computation_signal(type | DIRTY, null, block); + const signal = create_computation_signal(type | DIRTY, null); signal.i = fn; signal.x = current_component_context; if (current_effect !== null) { @@ -212,9 +210,8 @@ export function invalidate_effect(fn) { } /** - * @template {import('../types.js').Block} B - * @param {(block: B) => void | (() => void)} fn - * @param {any} block + * @param {() => void | (() => void)} fn + * @param {null} block * @param {any} managed * @param {any} sync * @returns {import('../types.js').EffectSignal} @@ -224,7 +221,7 @@ export function render_effect(fn, block = null, managed = false, sync = true) { if (managed) { flags |= MANAGED; } - return internal_create_effect(flags, /** @type {any} */ (fn), sync, block, true); + return internal_create_effect(flags, /** @type {any} */ (fn), sync, null, true); } /** diff --git a/packages/svelte/src/internal/client/types.d.ts b/packages/svelte/src/internal/client/types.d.ts index 484554ae09..3e8f3c2b8a 100644 --- a/packages/svelte/src/internal/client/types.d.ts +++ b/packages/svelte/src/internal/client/types.d.ts @@ -88,8 +88,6 @@ export type SourceSignalDebug = { }; export type ComputationSignal = { - /** block: The block associated with this effect/computed */ - b: null | Block; /** consumers: Signals that read from the current signal */ c: null | ComputationSignal[]; /** context: The associated component if this signal is an effect/computed */