chore: extract a couple of drive-by fixes from other branch (#16772)

* chore: extract a couple of drive-by fixes from other branch

* more
pull/16773/head
Rich Harris 3 days ago committed by GitHub
parent a0598014d2
commit 8b4e1fcb7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -130,11 +130,11 @@ export function child(node, is_text) {
/**
* Don't mark this as side-effect-free, hydration needs to walk all nodes
* @param {DocumentFragment | TemplateNode[]} fragment
* @param {boolean} is_text
* @param {DocumentFragment | TemplateNode | TemplateNode[]} fragment
* @param {boolean} [is_text]
* @returns {Node | null}
*/
export function first_child(fragment, is_text) {
export function first_child(fragment, is_text = false) {
if (!hydrating) {
// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)
var first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));

@ -316,6 +316,9 @@ export function text(value = '') {
return node;
}
/**
* @returns {TemplateNode | DocumentFragment}
*/
export function comment() {
// we're not delegating to `template` here for performance reasons
if (hydrating) {

@ -10,12 +10,10 @@ import {
INERT,
RENDER_EFFECT,
ROOT_EFFECT,
USER_EFFECT,
MAYBE_DIRTY
} from '#client/constants';
import { async_mode_flag } from '../../flags/index.js';
import { deferred, define_property } from '../../shared/utils.js';
import { get_boundary } from '../dom/blocks/boundary.js';
import {
active_effect,
is_dirty,
@ -30,7 +28,6 @@ import { DEV } from 'esm-env';
import { invoke_error_boundary } from '../error-handling.js';
import { old_values } from './sources.js';
import { unlink_effect } from './effects.js';
import { unset_context } from './async.js';
/** @type {Set<Batch>} */
const batches = new Set();

Loading…
Cancel
Save