forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn if component is expected to be reactive (sveltejs#4409)
- Loading branch information
1 parent
4a02e42
commit e546e02
Showing
6 changed files
with
89 additions
and
1 deletion.
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
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
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
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,18 @@ | ||
<script> | ||
import A from './A.svelte'; | ||
import B from './B.svelte'; | ||
let Let = A; | ||
function update() { | ||
Let = B; | ||
} | ||
export let ExportLet = B; | ||
$: Reactive = random() ? A : B; | ||
</script> | ||
|
||
<Let /> | ||
<ExportLet /> | ||
<Reactive /> | ||
<svelte:component this={Let} /> |
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,3 @@ | ||
{ | ||
"generate": true | ||
} |
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 @@ | ||
[ | ||
{ | ||
"code": "reactive-component", | ||
"message": "<Let/> will not be reactive if Let changes. Use <svelte:component this={Let}/> if you want this reactivity.", | ||
"pos": 190, | ||
"end": { | ||
"character": 197, | ||
"column": 7, | ||
"line": 15 | ||
}, | ||
"start": { | ||
"character": 190, | ||
"column": 0, | ||
"line": 15 | ||
} | ||
}, | ||
{ | ||
"message": "<ExportLet/> will not be reactive if ExportLet changes. Use <svelte:component this={ExportLet}/> if you want this reactivity.", | ||
"code": "reactive-component", | ||
"pos": 198, | ||
"end": { | ||
"character": 211, | ||
"column": 13, | ||
"line": 16 | ||
}, | ||
"start": { | ||
"character": 198, | ||
"column": 0, | ||
"line": 16 | ||
} | ||
}, | ||
{ | ||
"message": "<Reactive/> will not be reactive if Reactive changes. Use <svelte:component this={Reactive}/> if you want this reactivity.", | ||
"code": "reactive-component", | ||
"pos": 212, | ||
"end": { | ||
"character": 224, | ||
"column": 12, | ||
"line": 17 | ||
}, | ||
"start": { | ||
"character": 212, | ||
"column": 0, | ||
"line": 17 | ||
} | ||
} | ||
] |