remove_nodes -> skip_nodes

async-hydration
Rich Harris 6 hours ago
parent 180e36cf03
commit 535d6aeca5

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

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

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

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

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

Loading…
Cancel
Save