-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't hoist types referencing stores or destructured variables (#…
- Loading branch information
1 parent
90c9953
commit 2f46701
Showing
6 changed files
with
62 additions
and
4 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
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
...ages/svelte2tsx/test/svelte2tsx/samples/ts-runes-hoistable-props-false-6.v5/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,11 @@ | ||
///<reference types="svelte" /> | ||
;function render() { | ||
|
||
let store = null/*Ωignore_startΩ*/;let $store = __sveltets_2_store_get(store);/*Ωignore_endΩ*/;;type $$ComponentProps = { someProp: typeof $store }; | ||
let { someProp }:/*Ωignore_startΩ*/$$ComponentProps/*Ωignore_endΩ*/ = $props(); | ||
; | ||
async () => {}; | ||
return { props: {} as any as $$ComponentProps, exports: {}, bindings: __sveltets_$$bindings(''), slots: {}, events: {} }} | ||
const Input__SvelteComponent_ = __sveltets_2_fn_component(render()); | ||
type Input__SvelteComponent_ = ReturnType<typeof Input__SvelteComponent_>; | ||
export default Input__SvelteComponent_; |
4 changes: 4 additions & 0 deletions
4
packages/svelte2tsx/test/svelte2tsx/samples/ts-runes-hoistable-props-false-6.v5/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,4 @@ | ||
<script lang="ts"> | ||
let store = null; | ||
let { someProp }: { someProp: typeof $store } = $props(); | ||
</script> |
14 changes: 14 additions & 0 deletions
14
...ages/svelte2tsx/test/svelte2tsx/samples/ts-runes-hoistable-props-false-7.v5/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 { destructured } = {}; | ||
type Props = { | ||
prop: typeof destructured; | ||
}; | ||
let { prop }: Props = $props(); | ||
; | ||
async () => {}; | ||
return { props: {} as any as Props, exports: {}, bindings: __sveltets_$$bindings(''), slots: {}, events: {} }} | ||
const Input__SvelteComponent_ = __sveltets_2_fn_component(render()); | ||
type Input__SvelteComponent_ = ReturnType<typeof Input__SvelteComponent_>; | ||
export default Input__SvelteComponent_; |
7 changes: 7 additions & 0 deletions
7
packages/svelte2tsx/test/svelte2tsx/samples/ts-runes-hoistable-props-false-7.v5/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 lang="ts"> | ||
let { destructured } = {}; | ||
type Props = { | ||
prop: typeof destructured; | ||
}; | ||
let { prop }: Props = $props(); | ||
</script> |