-
-
Notifications
You must be signed in to change notification settings - Fork 223
fix(svelte2tsx): support for runes={false} in svelte:options #2847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dummdidumm
merged 7 commits into
sveltejs:master
from
axel7083:fix/support-svelte-options-runes-false
Sep 15, 2025
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
240908a
fix(svelte2tsx): support for runes={false} svelte:options
axel7083 712083e
docs: adding changelog
axel7083 df4992c
Update packages/svelte2tsx/src/htmlxtojsx_v2/index.ts
dummdidumm 01571f2
Update .changeset/green-news-find.md
dummdidumm 34dac88
fix: expectedv2.ts
axel7083 ca428d9
Update .changeset/green-news-find.md
dummdidumm 8e59b25
fix: adding missing expected-svelte5.ts
axel7083 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| --- | ||
| 'svelte2tsx': patch | ||
| --- | ||
|
|
||
| support for runes={false} in svelte:options | ||
dummdidumm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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
26 changes: 26 additions & 0 deletions
26
packages/svelte2tsx/test/svelte2tsx/samples/ts-export-list-runes-false/expectedv2.ts
This file contains hidden or 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,26 @@ | ||
| ///<reference types="svelte" /> | ||
| ;function $$render() { | ||
|
|
||
| let name1: string = "world"/*Ωignore_startΩ*/;name1 = __sveltets_2_any(name1);/*Ωignore_endΩ*/ | ||
| let name2: string/*Ωignore_startΩ*/;name2 = __sveltets_2_any(name2);/*Ωignore_endΩ*/; | ||
| let name3: string = ''/*Ωignore_startΩ*/;name3 = __sveltets_2_any(name3);/*Ωignore_endΩ*/;let name4: string/*Ωignore_startΩ*/;name4 = __sveltets_2_any(name4);/*Ωignore_endΩ*/; | ||
|
|
||
| let rename1: string = ''/*Ωignore_startΩ*/;rename1 = __sveltets_2_any(rename1);/*Ωignore_endΩ*/; | ||
| let rename2: string/*Ωignore_startΩ*/;rename2 = __sveltets_2_any(rename2);/*Ωignore_endΩ*/; | ||
|
|
||
| class Foo {} | ||
| function bar() {} | ||
| const baz: string = ''; | ||
|
|
||
| class RenameFoo {} | ||
| function renamebar() {} | ||
| const renamebaz: string = ''; | ||
|
|
||
|
|
||
| ; | ||
| async () => { { svelteHTML.createElement("svelte:options", { "runes":false,});} | ||
| }; | ||
| return { props: {name1: name1 , name2: name2 , name3: name3 , name4: name4 , renamed1: rename1 , renamed2: rename2 , Foo: Foo , bar: bar , baz: baz , RenamedFoo: RenameFoo , renamedbar: renamebar , renamedbaz: renamebaz} as {name1?: string, name2: string, name3?: string, name4: string, renamed1?: string, renamed2: string, Foo?: typeof Foo, bar?: typeof bar, baz?: string, RenamedFoo?: typeof RenameFoo, renamedbar?: typeof renamebar, renamedbaz?: string}, slots: {}, events: {} }} | ||
|
|
||
| export default class Input__SvelteComponent_ extends __sveltets_2_createSvelte2TsxComponent(__sveltets_2_with_any_event($$render())) { | ||
| } |
19 changes: 19 additions & 0 deletions
19
packages/svelte2tsx/test/svelte2tsx/samples/ts-export-list-runes-false/input.svelte
This file contains hidden or 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,19 @@ | ||
| <svelte:options runes={false} /> | ||
| <script> | ||
| let name1: string = "world" | ||
| let name2: string; | ||
| let name3: string = '', name4: string; | ||
|
|
||
| let rename1: string = ''; | ||
| let rename2: string; | ||
|
|
||
| class Foo {} | ||
| function bar() {} | ||
| const baz: string = ''; | ||
|
|
||
| class RenameFoo {} | ||
| function renamebar() {} | ||
| const renamebaz: string = ''; | ||
|
|
||
| export { name1, name2, name3, name4, rename1 as renamed1, rename2 as renamed2, Foo, bar, baz, RenameFoo as RenamedFoo, renamebar as renamedbar, renamebaz as renamedbaz }; | ||
| </script> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.