mirror of https://github.com/sveltejs/svelte
fix: add migration task when there's a variable named that would conflict with a rune (#14216)
Closes #14215pull/14224/head
parent
870745fc53
commit
438de04fb2
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: add migration task when there's a variable named that would conflict with a rune
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
let bindable;
|
||||
export let something;
|
||||
</script>
|
||||
|
||||
<input bind:value={something} />
|
@ -0,0 +1,8 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: migrating this component would require adding a `$bindable` rune but there's already a variable named bindable.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let bindable;
|
||||
export let something;
|
||||
</script>
|
||||
|
||||
<input bind:value={something} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let name = 'world';
|
||||
|
||||
let derived;
|
||||
|
||||
$: other = name;
|
||||
</script>
|
||||
|
||||
<input bind:value={name} />
|
@ -0,0 +1,11 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: can't migrate `$: other = name;` to `$derived` because there's a variable named derived.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let name = 'world';
|
||||
|
||||
let derived;
|
||||
|
||||
$: other = name;
|
||||
</script>
|
||||
|
||||
<input bind:value={name} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let derived;
|
||||
</script>
|
||||
|
||||
<svelte:component this={derived} />
|
@ -0,0 +1,7 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: migrating this component would require adding a `$derived` rune but there's already a variable named derived.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let derived;
|
||||
</script>
|
||||
|
||||
<svelte:component this={derived} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
let derived;
|
||||
</script>
|
||||
<Component>
|
||||
<slot name="derived" slot="derived" />
|
||||
</Component>
|
@ -0,0 +1,7 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: This migration would change the name of a slot making the component unusable -->
|
||||
<script>
|
||||
let derived;
|
||||
</script>
|
||||
<Component>
|
||||
<slot name="derived" slot="derived" />
|
||||
</Component>
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
let name = 'world';
|
||||
|
||||
let derived;
|
||||
|
||||
let other;
|
||||
$: other = name;
|
||||
</script>
|
||||
|
||||
<input bind:value={name} />
|
@ -0,0 +1,12 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: can't migrate `let other;` to `$derived` because there's a variable named derived.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let name = 'world';
|
||||
|
||||
let derived;
|
||||
|
||||
let other;
|
||||
$: other = name;
|
||||
</script>
|
||||
|
||||
<input bind:value={name} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
<script>
|
||||
let props;
|
||||
export let something;
|
||||
</script>
|
@ -0,0 +1,6 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: migrating this component would require adding a `$props` rune but there's already a variable named props.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let props;
|
||||
export let something;
|
||||
</script>
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
let other;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
@ -0,0 +1,9 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: can't migrate `let other;` to `$state` because there's a variable named state.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
let other;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
let other = 42;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
@ -0,0 +1,9 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: can't migrate `let other = 42;` to `$state` because there's a variable named state.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
let other = 42;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
logs: [
|
||||
'One or more `@migration-task` comments were added to `output.svelte`, please check them and complete the migration manually.'
|
||||
],
|
||||
errors: []
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
$: other = 42;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
@ -0,0 +1,9 @@
|
||||
<!-- @migration-task Error while migrating Svelte code: can't migrate `$: other = 42;` to `$state` because there's a variable named state.
|
||||
Rename the variable and try again or migrate by hand. -->
|
||||
<script>
|
||||
let state = 'world';
|
||||
|
||||
$: other = 42;
|
||||
</script>
|
||||
|
||||
<input bind:value={other} />
|
Loading…
Reference in new issue