fix: skip unnecessary `$$legacy` flag (#12850)

pull/12846/head
Rich Harris 1 month ago committed by GitHub
parent 57a4b5d19c
commit 50b905a531
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: skip unnecessary `$$legacy` flag

@ -298,7 +298,10 @@ export function build_component(node, component_name, context, anchor = context.
push_prop(b.init('$$slots', b.object(serialized_slots))); push_prop(b.init('$$slots', b.object(serialized_slots)));
} }
if (!context.state.analysis.runes) { if (
!context.state.analysis.runes &&
node.attributes.some((attribute) => attribute.type === 'BindDirective')
) {
push_prop(b.init('$$legacy', b.true)); push_prop(b.init('$$legacy', b.true));
} }

@ -23,10 +23,6 @@ export default function Purity($$anchor) {
var node = $.sibling($.sibling(p_1, true)); var node = $.sibling($.sibling(p_1, true));
Child(node, { Child(node, { prop: encodeURIComponent(value) });
prop: encodeURIComponent(value),
$$legacy: true
});
$.append($$anchor, fragment); $.append($$anchor, fragment);
} }
Loading…
Cancel
Save