Skip to content

Commit 6bcaa6b

Browse files
committed
chore: remove $.space
1 parent 4fcedb2 commit 6bcaa6b

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ function process_children(nodes, expression, is_element, { visit, state }) {
14081408

14091409
state.template.push(' ');
14101410

1411-
const text_id = get_node_id(b.call('$.space', expression(true)), state, 'text');
1411+
const text_id = get_node_id(expression(true), state, 'text');
14121412

14131413
const update = b.stmt(
14141414
b.call(

packages/svelte/src/internal/client/dom/template.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,6 @@ export function space_frag(anchor) {
137137
return node;
138138
}
139139

140-
/**
141-
* @param {Text | Comment | Element} anchor
142-
*/
143-
/*#__NO_SIDE_EFFECTS__*/
144-
export function space(anchor) {
145-
// if an {expression} is empty during SSR, there might be no
146-
// text node to hydrate (or an anchor comment is falsely detected instead)
147-
// — we must therefore create one
148-
if (hydrating && anchor.nodeType !== 3) {
149-
const node = empty();
150-
anchor.before(node);
151-
return node;
152-
}
153-
return anchor;
154-
}
155-
156140
/*#__NO_SIDE_EFFECTS__*/
157141
export function comment() {
158142
return open_frag(comment_template);

0 commit comments

Comments
 (0)