mirror of https://github.com/sveltejs/svelte
fix: ensure inserted code is preserved during migration (#13617)
* fix: moving deriveds during migration deletes part of the inserted code * fix: use update instead of remove * Update .changeset/cool-apes-confess.md Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/13622/head
parent
a17a28b30e
commit
48f0bfc73f
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure inserted code is preserved during migration
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
export let data
|
||||
$: ({ foo } = data)
|
||||
|
||||
import { blah } from './blah.js'
|
||||
|
||||
let bar
|
||||
$: {
|
||||
bar = []
|
||||
let baz
|
||||
}
|
||||
</script>
|
@ -0,0 +1,15 @@
|
||||
<script>
|
||||
import { run } from 'svelte/legacy';
|
||||
|
||||
|
||||
import { blah } from './blah.js'
|
||||
/** @type {{data: any}} */
|
||||
let { data } = $props();
|
||||
|
||||
let bar = $state()
|
||||
let { foo } = $derived(data)
|
||||
run(() => {
|
||||
bar = []
|
||||
let baz
|
||||
});
|
||||
</script>
|
Loading…
Reference in new issue