-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle runes looking like stores
- Loading branch information
1 parent
64d7b77
commit 221ee2e
Showing
5 changed files
with
59 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
14 changes: 14 additions & 0 deletions
14
packages/svelte2tsx/test/svelte2tsx/samples/runes-looking-like-stores/expectedv2.ts
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,14 @@ | ||
///<reference types="svelte" /> | ||
;function render() { | ||
|
||
let { props } = $props(); | ||
let state = $state(0); | ||
let derived = $derived(state * 2); | ||
; | ||
async () => { | ||
|
||
state; derived;}; | ||
return { props: /** @type {Record<string, never>} */ ({}), slots: {}, events: {} }} | ||
|
||
export default class Input__SvelteComponent_ extends __sveltets_2_createSvelte2TsxComponent(__sveltets_2_partial(__sveltets_2_with_any_event(render()))) { | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/svelte2tsx/test/svelte2tsx/samples/runes-looking-like-stores/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> | ||
let { props } = $props(); | ||
let state = $state(0); | ||
let derived = $derived(state * 2); | ||
</script> | ||
|
||
{state} {derived} |
17 changes: 17 additions & 0 deletions
17
packages/svelte2tsx/test/svelte2tsx/samples/stores-looking-like-runes/expectedv2.ts
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,17 @@ | ||
///<reference types="svelte" /> | ||
;function render() { | ||
|
||
const props = null/*Ωignore_startΩ*/;let $props = __sveltets_2_store_get(props);/*Ωignore_endΩ*/; | ||
$props; | ||
const state = null/*Ωignore_startΩ*/;let $state = __sveltets_2_store_get(state);/*Ωignore_endΩ*/; | ||
$state; | ||
const derived = null/*Ωignore_startΩ*/;let $derived = __sveltets_2_store_get(derived);/*Ωignore_endΩ*/; | ||
$derived; | ||
; | ||
async () => { | ||
|
||
state; derived;}; | ||
return { props: /** @type {Record<string, never>} */ ({}), slots: {}, events: {} }} | ||
|
||
export default class Input__SvelteComponent_ extends __sveltets_2_createSvelte2TsxComponent(__sveltets_2_partial(__sveltets_2_with_any_event(render()))) { | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/svelte2tsx/test/svelte2tsx/samples/stores-looking-like-runes/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,10 @@ | ||
<script> | ||
const props = null; | ||
$props; | ||
const state = null; | ||
$state; | ||
const derived = null; | ||
$derived; | ||
</script> | ||
|
||
{state} {derived} |