pull/12335/head
Rich Harris 2 years ago
parent c23e5ea80a
commit 16533e11b4

@ -1006,7 +1006,7 @@ function serialize_inline_component(node, expression, context) {
if (node.type === 'SvelteComponent' || (node.type === 'Component' && node.metadata.dynamic)) {
context.state.template.push(block_open, statement, block_close);
} else {
context.state.template.push(statement);
context.state.template.push(statement, block_close);
}
}

@ -294,7 +294,7 @@ export function clean_nodes(
const is_anchored = (is_dynamic_text || is_text) && parent.type === 'Fragment';
return { hoisted, trimmed, is_standalone, is_anchored };
return { hoisted, trimmed, is_standalone: false, is_anchored };
}
/**

@ -1,9 +1,20 @@
import { DEV } from 'esm-env';
import { clear_text_content, empty, init_operations } from './dom/operations.js';
import { HYDRATION_ERROR, HYDRATION_START, PassiveDelegatedEvents } from '../../constants.js';
import {
HYDRATION_END,
HYDRATION_ERROR,
HYDRATION_START,
PassiveDelegatedEvents
} from '../../constants.js';
import { flush_sync, push, pop, current_component_context } from './runtime.js';
import { effect_root, branch } from './reactivity/effects.js';
import { hydrate_next, hydrating, set_hydrate_node, set_hydrating } from './dom/hydration.js';
import {
hydrate_next,
hydrate_node,
hydrating,
set_hydrate_node,
set_hydrating
} from './dom/hydration.js';
import { array_from } from './utils.js';
import { handle_event_propagation } from './dom/elements/events.js';
import { reset_head_anchor } from './dom/blocks/svelte-head.js';
@ -150,6 +161,13 @@ export function hydrate(component, options) {
const instance = _mount(component, { ...options, anchor });
if (
hydrate_node.nodeType !== 8 ||
/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END
) {
throw HYDRATION_ERROR;
}
// flush_sync will run this callback and then synchronously run any pending effects,
// which don't belong to the hydration phase anymore - therefore reset it here
set_hydrating(false);

Loading…
Cancel
Save