-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
migration-task
for impossible to migrate slots (#13658)
* feat: add `migration-task` for impossible to migrate slots * Update packages/svelte/src/compiler/migrate/index.js Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> * Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> * Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> * Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> * Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com> --------- Co-authored-by: Dominic Gannaway <trueadm@users.noreply.github.com>
- Loading branch information
1 parent
0dcd4f6
commit 969e6aa
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
feat: add `migration-task` for impossible to migrate slots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/svelte/tests/migrate/samples/slot-non-identifier/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script> | ||
import Comp from "./Component.svelte"; | ||
</script> | ||
|
||
<Comp> | ||
<div slot="cool:stuff"> | ||
cool | ||
</div> | ||
</Comp> | ||
|
||
<Comp> | ||
<div slot="cool stuff"> | ||
cool | ||
</div> | ||
</Comp> | ||
|
||
<Comp> | ||
<div slot="stuff"> | ||
cool | ||
</div> | ||
</Comp> | ||
|
||
<Comp> | ||
<svelte:fragment slot="cool:stuff"> | ||
cool | ||
</svelte:fragment> | ||
</Comp> | ||
|
||
<Comp> | ||
<svelte:fragment slot="cool stuff"> | ||
cool | ||
</svelte:fragment> | ||
</Comp> | ||
|
||
<Comp> | ||
<svelte:fragment slot="stuff"> | ||
cool | ||
</svelte:fragment> | ||
</Comp> |
47 changes: 47 additions & 0 deletions
47
packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script> | ||
import Comp from "./Component.svelte"; | ||
</script> | ||
|
||
<Comp> | ||
<!-- @migration-task: migrate this slot by hand, `cool:stuff` is an invalid identifier --> | ||
<div slot="cool:stuff"> | ||
cool | ||
</div> | ||
</Comp> | ||
|
||
<Comp> | ||
<!-- @migration-task: migrate this slot by hand, `cool stuff` is an invalid identifier --> | ||
<div slot="cool stuff"> | ||
cool | ||
</div> | ||
</Comp> | ||
|
||
<Comp> | ||
{#snippet stuff()} | ||
<div > | ||
cool | ||
</div> | ||
{/snippet} | ||
</Comp> | ||
|
||
<Comp> | ||
<!-- @migration-task: migrate this slot by hand, `cool:stuff` is an invalid identifier --> | ||
<svelte:fragment slot="cool:stuff"> | ||
cool | ||
</svelte:fragment> | ||
</Comp> | ||
|
||
<Comp> | ||
<!-- @migration-task: migrate this slot by hand, `cool stuff` is an invalid identifier --> | ||
<svelte:fragment slot="cool stuff"> | ||
cool | ||
</svelte:fragment> | ||
</Comp> | ||
|
||
<Comp> | ||
{#snippet stuff()} | ||
|
||
cool | ||
|
||
{/snippet} | ||
</Comp> |