reinstate standalone optimisation

pull/12335/head
Rich Harris 2 years ago
parent 412ac8ad60
commit 7bfc74f19c

@ -1025,7 +1025,7 @@ function serialize_inline_component(node, expression, context) {
context.state.template.push(statement);
}
if (custom_css_props.length === 0) {
if (custom_css_props.length === 0 && !context.state.skip_hydration_boundaries) {
context.state.template.push(block_close);
}
}
@ -1219,7 +1219,9 @@ const template_visitors = {
)
);
if (!context.state.skip_hydration_boundaries) {
context.state.template.push(block_close);
}
},
ClassDirective() {
throw new Error('Node should have been handled elsewhere');

@ -291,7 +291,7 @@ export function clean_nodes(
first &&
(first?.type === 'Text' || first?.type === 'ExpressionTag');
return { hoisted, trimmed, is_standalone: false, is_anchored };
return { hoisted, trimmed, is_standalone, is_anchored };
}
/**

@ -2,9 +2,5 @@ import "svelte/internal/disclose-version";
import * as $ from "svelte/internal/client";
export default function Bind_this($$anchor) {
var fragment = $.comment();
var node = $.first_child(fragment);
$.bind_this(Foo(node, { $$legacy: true }), ($$value) => foo = $$value, () => foo);
$.append($$anchor, fragment);
$.bind_this(Foo($$anchor, { $$legacy: true }), ($$value) => foo = $$value, () => foo);
}

@ -2,5 +2,4 @@ import * as $ from "svelte/internal/server";
export default function Bind_this($$payload) {
Foo($$payload, {});
$$payload.out += `<!--]-->`;
}

@ -9,10 +9,8 @@ export default function Function_prop_no_getter($$anchor) {
}
const plusOne = (num) => num + 1;
var fragment = $.comment();
var node = $.first_child(fragment);
Button(node, {
Button($$anchor, {
onmousedown: () => $.set(count, $.get(count) + 1),
onmouseup,
onmouseenter: () => $.set(count, $.proxy(plusOne($.get(count)))),
@ -24,6 +22,4 @@ export default function Function_prop_no_getter($$anchor) {
},
$$slots: { default: true }
});
$.append($$anchor, fragment);
}

@ -18,6 +18,4 @@ export default function Function_prop_no_getter($$payload) {
},
$$slots: { default: true }
});
$$payload.out += `<!--]-->`;
}
Loading…
Cancel
Save