remove_nodes -> skip_nodes

pull/16797/head
Rich Harris 15 hours ago
parent 180e36cf03
commit 535d6aeca5

@ -7,7 +7,7 @@ import {
hydrating, hydrating,
set_hydrate_node, set_hydrate_node,
set_hydrating, set_hydrating,
remove_nodes skip_nodes
} from '../hydration.js'; } from '../hydration.js';
import { get_boundary } from './boundary.js'; import { get_boundary } from './boundary.js';
@ -27,7 +27,7 @@ export function async(node, expressions, fn) {
hydrate_next(); hydrate_next();
var previous_hydrate_node = hydrate_node; var previous_hydrate_node = hydrate_node;
var end = remove_nodes(false); var end = skip_nodes(false);
set_hydrate_node(end); set_hydrate_node(end);
} }

@ -8,7 +8,7 @@ import {
hydrate_next, hydrate_next,
hydrate_node, hydrate_node,
hydrating, hydrating,
remove_nodes, skip_nodes,
set_hydrate_node, set_hydrate_node,
set_hydrating set_hydrating
} from '../hydration.js'; } from '../hydration.js';
@ -140,7 +140,7 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
if (mismatch) { if (mismatch) {
// Hydration mismatch: remove everything inside the anchor and start fresh // Hydration mismatch: remove everything inside the anchor and start fresh
anchor = remove_nodes(); anchor = skip_nodes();
set_hydrate_node(anchor); set_hydrate_node(anchor);
set_hydrating(false); set_hydrating(false);

@ -21,7 +21,7 @@ import {
hydrate_node, hydrate_node,
hydrating, hydrating,
next, next,
remove_nodes, skip_nodes,
set_hydrate_node set_hydrate_node
} from '../hydration.js'; } from '../hydration.js';
import { get_next_sibling } from '../operations.js'; import { get_next_sibling } from '../operations.js';
@ -335,7 +335,7 @@ export class Boundary {
if (hydrating) { if (hydrating) {
set_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open)); set_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open));
next(); next();
set_hydrate_node(remove_nodes()); set_hydrate_node(skip_nodes());
} }
var did_reset = false; var did_reset = false;

@ -14,7 +14,7 @@ import {
hydrate_node, hydrate_node,
hydrating, hydrating,
read_hydration_instruction, read_hydration_instruction,
remove_nodes, skip_nodes,
set_hydrate_node, set_hydrate_node,
set_hydrating set_hydrating
} from '../hydration.js'; } from '../hydration.js';
@ -209,7 +209,7 @@ export function each(node, flags, get_collection, get_key, render_fn, fallback_f
if (is_else !== (length === 0)) { if (is_else !== (length === 0)) {
// hydration mismatch — remove the server-rendered DOM and start over // hydration mismatch — remove the server-rendered DOM and start over
anchor = remove_nodes(); anchor = skip_nodes();
set_hydrate_node(anchor); set_hydrate_node(anchor);
set_hydrating(false); set_hydrating(false);
@ -259,7 +259,7 @@ export function each(node, flags, get_collection, get_key, render_fn, fallback_f
// remove excess nodes // remove excess nodes
if (length > 0) { if (length > 0) {
set_hydrate_node(remove_nodes()); set_hydrate_node(skip_nodes());
} }
} }

@ -6,7 +6,7 @@ import {
hydrate_node, hydrate_node,
hydrating, hydrating,
read_hydration_instruction, read_hydration_instruction,
remove_nodes, skip_nodes,
set_hydrate_node, set_hydrate_node,
set_hydrating set_hydrating
} from '../hydration.js'; } from '../hydration.js';
@ -93,7 +93,7 @@ export function if_block(node, fn, elseif = false) {
if (!!condition === is_else) { if (!!condition === is_else) {
// Hydration mismatch: remove everything inside the anchor and start fresh. // Hydration mismatch: remove everything inside the anchor and start fresh.
// This could happen with `{#if browser}...{/if}`, for example // This could happen with `{#if browser}...{/if}`, for example
anchor = remove_nodes(); anchor = skip_nodes();
set_hydrate_node(anchor); set_hydrate_node(anchor);
set_hydrating(false); set_hydrating(false);

@ -84,7 +84,7 @@ export function next(count = 1) {
* Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment * Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment
* @param {boolean} remove * @param {boolean} remove
*/ */
export function remove_nodes(remove = true) { export function skip_nodes(remove = true) {
var depth = 0; var depth = 0;
var node = hydrate_node; var node = hydrate_node;

Loading…
Cancel
Save