delete some unused stuff

blockless
Rich Harris 2 years ago
parent cd58dbd2d6
commit c80fe4588e

@ -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 {Element | Comment | Text} dom
* @param {boolean} is_controlled * @param {boolean} is_controlled
* @param {null | Text | Element | Comment} sibling * @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} * @returns {Text | Element | Comment}
*/ */
function get_first_child(block) { 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} * @returns {Text | Element | Comment}
*/ */
export function get_first_element(block) { 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<import('../../types.js').Block>} 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 * @template V
* @param {V} item * @param {V} item

@ -28,12 +28,10 @@ import {
* @template V * @template V
* @param {import('../types.js').SignalFlags} flags * @param {import('../types.js').SignalFlags} flags
* @param {V} value * @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<V>} */ /** @type {import('../types.js').ComputationSignal<V>} */
const signal = { const signal = {
b: block,
c: null, c: null,
d: null, d: null,
e: null, e: null,
@ -72,14 +70,14 @@ export function push_reference(target_signal, ref_signal) {
/** /**
* @param {import('../types.js').EffectType} type * @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 {boolean} sync
* @param {null | import('../types.js').Block} block * @param {null} block
* @param {boolean} schedule * @param {boolean} schedule
* @returns {import('../types.js').EffectSignal} * @returns {import('../types.js').EffectSignal}
*/ */
function internal_create_effect(type, fn, sync, block, schedule) { 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.i = fn;
signal.x = current_component_context; signal.x = current_component_context;
if (current_effect !== null) { if (current_effect !== null) {
@ -212,9 +210,8 @@ export function invalidate_effect(fn) {
} }
/** /**
* @template {import('../types.js').Block} B * @param {() => void | (() => void)} fn
* @param {(block: B) => void | (() => void)} fn * @param {null} block
* @param {any} block
* @param {any} managed * @param {any} managed
* @param {any} sync * @param {any} sync
* @returns {import('../types.js').EffectSignal} * @returns {import('../types.js').EffectSignal}
@ -224,7 +221,7 @@ export function render_effect(fn, block = null, managed = false, sync = true) {
if (managed) { if (managed) {
flags |= 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);
} }
/** /**

@ -88,8 +88,6 @@ export type SourceSignalDebug = {
}; };
export type ComputationSignal<V = unknown> = { export type ComputationSignal<V = unknown> = {
/** block: The block associated with this effect/computed */
b: null | Block;
/** consumers: Signals that read from the current signal */ /** consumers: Signals that read from the current signal */
c: null | ComputationSignal[]; c: null | ComputationSignal[];
/** context: The associated component if this signal is an effect/computed */ /** context: The associated component if this signal is an effect/computed */

Loading…
Cancel
Save