File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
let { runes }: { runes: boolean } = $props ();
6
6
7
- const { workspace } = get_repl_context ();
7
+ const { workspace, svelteVersion } = get_repl_context ();
8
+ const majorVersion = Number (svelteVersion .split (" ." )[0 ]);
8
9
</script >
9
10
10
11
<Dropdown align =" right" >
16
17
17
18
{#snippet dropdown ()}
18
19
<div class =" popup" >
19
- {#if workspace .current .name .endsWith (' .svelte.js' )}
20
+ {#if Number .isInteger (majorVersion ) && majorVersion < 5 }
21
+ <p >
22
+ <a href =" /blog/runes" >Runes</a > are available from Svelte 5 onwards, and this playground is
23
+ using Svelte {svelteVersion }.
24
+ </p >
25
+ {:else if workspace .current .name .endsWith (' .svelte.js' )}
20
26
<p >
21
27
Files with a <code >.svelte.js</code > extension are always in
22
28
<a href =" /blog/runes" >runes mode</a >.
Original file line number Diff line number Diff line change 87
87
set_repl_context ({
88
88
bundle ,
89
89
toggleable ,
90
- workspace
90
+ workspace ,
91
+ svelteVersion
91
92
});
92
93
93
94
let current_token: Symbol ;
Original file line number Diff line number Diff line change @@ -47,4 +47,5 @@ export type ReplContext = {
47
47
bundle : Writable < ReplState [ 'bundle' ] > ;
48
48
toggleable : Writable < ReplState [ 'toggleable' ] > ;
49
49
workspace : Workspace ;
50
+ svelteVersion : string ;
50
51
} ;
You can’t perform that action at this time.
0 commit comments