Merge branch 'main' into blockless

pull/10873/head
Rich Harris 2 years ago
commit e03bc2b346

@ -89,11 +89,6 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
() => {
consequent_dom = consequent_fn(anchor);
if (mismatch) {
// Set fragment so that Svelte continues to operate in hydration mode
set_current_hydration_fragment([]);
}
return () => {
// TODO make this unnecessary by linking the dom to the effect,
// and removing automatically on teardown
@ -122,11 +117,6 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
() => {
alternate_dom = alternate_fn(anchor);
if (mismatch) {
// Set fragment so that Svelte continues to operate in hydration mode
set_current_hydration_fragment([]);
}
return () => {
// TODO make this unnecessary by linking the dom to the effect,
// and removing automatically on teardown
@ -148,6 +138,11 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
});
}
}
if (mismatch) {
// Set fragment so that Svelte continues to operate in hydration mode
set_current_hydration_fragment([]);
}
}, block);
if (elseif) {

@ -50,18 +50,11 @@ export function insert(current, sibling) {
/**
* @param {Array<import('../types.js').TemplateNode> | import('../types.js').TemplateNode} current
* @returns {Element | Comment | Text}
*/
export function remove(current) {
var first_node = current;
if (is_array(current)) {
var i = 0;
var node;
for (; i < current.length; i++) {
node = current[i];
if (i === 0) {
first_node = node;
}
for (var i = 0; i < current.length; i++) {
var node = current[i];
if (node.isConnected) {
node.remove();
}
@ -69,7 +62,6 @@ export function remove(current) {
} else if (current.isConnected) {
current.remove();
}
return /** @type {Element | Comment | Text} */ (first_node);
}
/**

Loading…
Cancel
Save