pull/12335/head
Rich Harris 2 years ago
parent c8bad17717
commit 75ab2573d9

@ -2,7 +2,6 @@
import { hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';
import { empty } from '../operations.js';
import { block } from '../../reactivity/effects.js';
import { HYDRATION_START } from '../../../../constants.js';
import { HEAD_EFFECT } from '../../constants.js';
/**
@ -35,14 +34,11 @@ export function head(render_fn) {
head_anchor = /** @type {TemplateNode} */ (document.head.firstChild);
}
while (
head_anchor.nodeType !== 8 ||
/** @type {Comment} */ (head_anchor).data !== HYDRATION_START
) {
while (head_anchor.nodeType !== 8 || /** @type {Comment} */ (head_anchor).data !== '#head') {
head_anchor = /** @type {TemplateNode} */ (head_anchor.nextSibling);
}
head_anchor = /** @type {TemplateNode} */ (head_anchor.nextSibling);
head_anchor = set_hydrate_node(/** @type {TemplateNode} */ (head_anchor.nextSibling));
} else {
anchor = document.head.appendChild(empty());
}

@ -137,9 +137,9 @@ export function render(component, options = {}) {
*/
export function head(payload, fn) {
const head_payload = payload.head;
payload.head.out += BLOCK_OPEN;
payload.head.out += '<!--#head-->';
fn(head_payload);
payload.head.out += BLOCK_CLOSE;
payload.head.out += '<!--/head-->';
}
/**

Loading…
Cancel
Save