remove some unused stuff

blockless
Rich Harris 2 years ago
parent 375575c4a5
commit 7d9808cd17

@ -1,34 +0,0 @@
import { DYNAMIC_ELEMENT_BLOCK, SNIPPET_BLOCK } from './constants.js';
import { current_block } from './runtime.js';
/** @returns {import('./types.js').DynamicElementBlock} */
export function create_dynamic_element_block() {
return {
// dom
d: null,
// effect
e: null,
// parent
p: /** @type {import('./types.js').Block} */ (current_block),
// transition
r: null,
// type
t: DYNAMIC_ELEMENT_BLOCK
};
}
/** @returns {import('./types.js').SnippetBlock} */
export function create_snippet_block() {
return {
// dom
d: null,
// parent
p: /** @type {import('./types.js').Block} */ (current_block),
// effect
e: null,
// transition
r: null,
// type
t: SNIPPET_BLOCK
};
}

@ -524,7 +524,7 @@ function mark_lis(a) {
* @returns {Text | Element | Comment} * @returns {Text | Element | Comment}
*/ */
function insert_each_item_block(block, dom, is_controlled, sibling) { function insert_each_item_block(block, dom, is_controlled, sibling) {
var current = /** @type {import('../../types.js').TemplateNode} */ (block.d); var current = /** @type {import('../../types.js').TemplateNode} */ (block.e.dom);
if (sibling === null) { if (sibling === null) {
if (is_controlled) { if (is_controlled) {
@ -542,7 +542,7 @@ function insert_each_item_block(block, dom, is_controlled, sibling) {
* @returns {Text | Element | Comment} * @returns {Text | Element | Comment}
*/ */
function get_first_child(block) { function get_first_child(block) {
var current = block.d; var current = block.e.dom;
if (is_array(current)) { if (is_array(current)) {
return /** @type {Text | Element | Comment} */ (current[0]); return /** @type {Text | Element | Comment} */ (current[0]);
@ -556,7 +556,7 @@ function get_first_child(block) {
* @returns {Text | Element | Comment} * @returns {Text | Element | Comment}
*/ */
export function get_first_element(block) { export function get_first_element(block) {
const current = block.d; const current = block.e.dom;
if (is_array(current)) { if (is_array(current)) {
for (let i = 0; i < current.length; i++) { for (let i = 0; i < current.length; i++) {
@ -628,7 +628,7 @@ export function destroy_each_item_block(
return; return;
} }
} }
const dom = block.d; const dom = block.e.dom;
if (!controlled && dom !== null) { if (!controlled && dom !== null) {
remove(dom); remove(dom);
} }
@ -657,8 +657,7 @@ function each_item_block(item, key, index, render_fn, flags) {
const block = create_each_item_block(item_value, index_value, key); const block = create_each_item_block(item_value, index_value, key);
const effect = render_effect( const effect = render_effect(
/** @param {import('../../types.js').EachItemBlock} block */ () => {
(block) => {
render_fn(null, block.v, block.i); render_fn(null, block.v, block.i);
}, },
block, block,

@ -10,7 +10,6 @@ import {
map_set, map_set,
set_class_name set_class_name
} from './operations.js'; } from './operations.js';
import { create_dynamic_element_block, create_snippet_block } from './block.js';
import { import {
PassiveDelegatedEvents, PassiveDelegatedEvents,
DelegatedEvents, DelegatedEvents,
@ -31,10 +30,8 @@ import {
import { import {
destroy_signal, destroy_signal,
push_destroy_fn, push_destroy_fn,
execute_effect,
untrack, untrack,
flush_sync, flush_sync,
current_block,
push, push,
pop, pop,
current_component_context, current_component_context,
@ -267,8 +264,6 @@ export function comment(anchor) {
* @returns {void} * @returns {void}
*/ */
function close_template(dom, is_fragment, anchor) { function close_template(dom, is_fragment, anchor) {
const block = /** @type {import('./types.js').Block} */ (current_block);
const effect = /** @type {import('./types.js').BlockEffect} */ (current_effect); const effect = /** @type {import('./types.js').BlockEffect} */ (current_effect);
/** @type {import('./types.js').TemplateNode | Array<import('./types.js').TemplateNode>} */ /** @type {import('./types.js').TemplateNode | Array<import('./types.js').TemplateNode>} */
@ -280,7 +275,7 @@ function close_template(dom, is_fragment, anchor) {
if (!hydrating && anchor !== null) { if (!hydrating && anchor !== null) {
insert(current, null, anchor); insert(current, null, anchor);
} }
block.d = current;
effect.dom = current; effect.dom = current;
} }

@ -1,5 +1,4 @@
import { DEV } from 'esm-env'; import { DEV } from 'esm-env';
import { run_all } from '../common.js';
import { import {
array_prototype, array_prototype,
get_descriptors, get_descriptors,

Loading…
Cancel
Save