-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
When migrating with npx sv migrate svelte-5 using sv@0.5.7 comments for props are copied across to the type definition, but lose the comment status.
<script lang="ts">
/** Minimum width of each element in the grid */
export let size = '13rem';
/** Gap between elements */
export let gap = '1rem';
let _class = '';
// noinspection ReservedWordAsName
export { _class as class };
</script>
Hi thereGets migrated to:
<script lang="ts">
interface Props {
Minimum width of each element in the grid
size?: string;
Gap between elements
gap?: string;
class?: string;
}
let { size = '13rem', gap = '1rem', class: _class = '' }: Props = $props();
// noinspection ReservedWordAsName
</script>
Hi thereI ran the sv migrate locally but also pasted the above into the Svelte 5 playground and pressed 'Migrate'.
The key issue is the comments 'Minimum width of each element in the grid' loses the /** */
Minor issues:
There's a few blank lines left behind.
The WebStorm/Rider noinspection comment is incorrectly placed, but that's a tricky one and I'm more than happy to live with that.
Reproduction
gets migrated to
Logs
No response
System Info
System:
OS: macOS 15.0.1
CPU: (8) arm64 Apple M1 Pro
Memory: 87.39 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 9.12.1 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 129.0.6668.101
Safari: 18.0.1Severity
annoyance
PS Raised here (rather on sv repo) as migration tool says:
This migration is experimental — please report any bugs to https://github.com/sveltejs/svelte/issues
damoonrashidi and victorbuikem
Metadata
Metadata
Assignees
Labels
No labels