Skip to content

Commit a14b363

Browse files
committed
Merge branch 'main' into nested-css-combinator
2 parents ab54212 + d77905d commit a14b363

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.changeset/seven-wombats-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: exclude type-only props from instance exports when migrating

packages/svelte/src/compiler/migrate/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export function migrate(source) {
273273
if (state.props.length > 0 && state.analysis.accessors) {
274274
str.appendRight(
275275
insertion_point,
276-
`\n${indent}export {${state.props.reduce((acc, prop) => (prop.slot_name ? acc : `${acc}\n${indent}\t${prop.local},`), '')}\n${indent}}\n`
276+
`\n${indent}export {${state.props.reduce((acc, prop) => (prop.slot_name || prop.type_only ? acc : `${acc}\n${indent}\t${prop.local},`), '')}\n${indent}}\n`
277277
);
278278
}
279279

packages/svelte/tests/migrate/samples/accessors/output.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
}
1010
1111
let {
12-
test,
1312
count = 0,
1413
stuff,
1514
cool
1615
}: Props = $props();
1716
1817
export {
19-
test,
2018
count,
2119
stuff,
2220
}

0 commit comments

Comments
 (0)