Skip to content

Commit 5f19c37

Browse files
committed
fix
1 parent 05c3efa commit 5f19c37

File tree

1 file changed

+8
-3
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,14 @@ function serialize_inline_component(node, component_name, context) {
720720
Array.isArray(attribute.value) &&
721721
attribute.value.some((n) => {
722722
if (n.type !== 'ExpressionTag') return false;
723-
return context.state.analysis.runes
724-
? n.metadata.contains_call_expression
725-
: n.expression.type !== 'Identifier';
723+
if (n.expression.type === 'Identifier' || n.expression.type === 'Literal') return false;
724+
725+
if (n.expression.type === 'MemberExpression' && context.state.analysis.runes) {
726+
// in legacy mode, `foo={bar.baz}` is wrapped in derived to preserve old behaviour.
727+
return false;
728+
}
729+
730+
return true;
726731
});
727732

728733
if (should_wrap_in_derived) {

0 commit comments

Comments
 (0)