-
-
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
comment after errors (#13659)
- Loading branch information
1 parent
b352f08
commit 0dcd4f6
Showing
12 changed files
with
125 additions
and
2 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` comment after errors |
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
11 changes: 11 additions & 0 deletions
11
...ges/svelte/tests/migrate/samples/impossible-migrate-beforeUpdate-afterUpdate/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,11 @@ | ||
<script> | ||
import { beforeUpdate, afterUpdate } from "svelte"; | ||
beforeUpdate(()=>{ | ||
}); | ||
afterUpdate(()=>{ | ||
}); | ||
</script> |
12 changes: 12 additions & 0 deletions
12
...es/svelte/tests/migrate/samples/impossible-migrate-beforeUpdate-afterUpdate/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,12 @@ | ||
<!-- @migration-task Error while migrating Svelte code: Can't migrate code with beforeUpdate and afterUpdate. Please migrate by hand. --> | ||
<script> | ||
import { beforeUpdate, afterUpdate } from "svelte"; | ||
beforeUpdate(()=>{ | ||
}); | ||
afterUpdate(()=>{ | ||
}); | ||
</script> |
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/migrate/samples/impossible-migrate-prop-and-$$props/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,5 @@ | ||
<script> | ||
export let value = 42; | ||
</script> | ||
|
||
{$$props} |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/migrate/samples/impossible-migrate-prop-and-$$props/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,6 @@ | ||
<!-- @migration-task Error while migrating Svelte code: $$props is used together with named props in a way that cannot be automatically migrated. --> | ||
<script> | ||
export let value = 42; | ||
</script> | ||
|
||
{$$props} |
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/migrate/samples/impossible-migrate-prop-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,5 @@ | ||
<script> | ||
let props = { value: 42 }; | ||
export let { value } = props; | ||
</script> |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/migrate/samples/impossible-migrate-prop-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,6 @@ | ||
<!-- @migration-task Error while migrating Svelte code: Encountered an export declaration pattern that is not supported for automigration. --> | ||
<script> | ||
let props = { value: 42 }; | ||
export let { value } = props; | ||
</script> |
11 changes: 11 additions & 0 deletions
11
...s/svelte/tests/migrate/samples/unused-beforeUpdate-afterUpdate-extra-imports/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,11 @@ | ||
<script> | ||
import { beforeUpdate, afterUpdate, onMount } from "svelte"; | ||
let count = 0; | ||
onMount(()=>{ | ||
console.log(count); | ||
}) | ||
</script> | ||
|
||
<button on:click={()=> count++}></button> |
11 changes: 11 additions & 0 deletions
11
.../svelte/tests/migrate/samples/unused-beforeUpdate-afterUpdate-extra-imports/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,11 @@ | ||
<script> | ||
import { onMount } from "svelte"; | ||
let count = $state(0); | ||
onMount(()=>{ | ||
console.log(count); | ||
}) | ||
</script> | ||
|
||
<button onclick={()=> count++}></button> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/migrate/samples/unused-beforeUpdate-afterUpdate/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,7 @@ | ||
<script> | ||
import { beforeUpdate, afterUpdate } from "svelte"; | ||
let count = 0; | ||
</script> | ||
|
||
<button on:click={()=> count++}></button> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/migrate/samples/unused-beforeUpdate-afterUpdate/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,7 @@ | ||
<script> | ||
let count = $state(0); | ||
</script> | ||
|
||
<button onclick={()=> count++}></button> |