chore: remove $.space

pull/10945/head
Rich Harris 2 years ago
parent 4fcedb2fb1
commit 6bcaa6b6b2

@ -1408,7 +1408,7 @@ function process_children(nodes, expression, is_element, { visit, state }) {
state.template.push(' '); state.template.push(' ');
const text_id = get_node_id(b.call('$.space', expression(true)), state, 'text'); const text_id = get_node_id(expression(true), state, 'text');
const update = b.stmt( const update = b.stmt(
b.call( b.call(

@ -137,22 +137,6 @@ export function space_frag(anchor) {
return node; return node;
} }
/**
* @param {Text | Comment | Element} anchor
*/
/*#__NO_SIDE_EFFECTS__*/
export function space(anchor) {
// if an {expression} is empty during SSR, there might be no
// text node to hydrate (or an anchor comment is falsely detected instead)
// — we must therefore create one
if (hydrating && anchor.nodeType !== 3) {
const node = empty();
anchor.before(node);
return node;
}
return anchor;
}
/*#__NO_SIDE_EFFECTS__*/ /*#__NO_SIDE_EFFECTS__*/
export function comment() { export function comment() {
return open_frag(comment_template); return open_frag(comment_template);

Loading…
Cancel
Save