File tree Expand file tree Collapse file tree 7 files changed +27
-2
lines changed
routes/(authed)/playground/[id]
editor/src/lib/compile-worker
repl/src/lib/workers/bundler Expand file tree Collapse file tree 7 files changed +27
-2
lines changed Original file line number Diff line number Diff line change
1
+ import '@sveltejs/site-kit/polyfills' ;
Original file line number Diff line number Diff line change 69
69
70
70
if (! hash && ! saved ) {
71
71
repl ?.set ({
72
- // TODO make this munging unnecessary
73
- files: structuredClone ( data .gist .components ).map (munge )
72
+ // TODO make this munging unnecessary (using JSON instead of structuredClone for better browser compat)
73
+ files: JSON . parse ( JSON . stringify ( data .gist .components ) ).map (munge )
74
74
});
75
75
76
76
modified = false ;
Original file line number Diff line number Diff line change
1
+ import '@sveltejs/site-kit/polyfills' ;
1
2
import { parseTar } from 'tarparser' ;
2
3
import type { CompileResult } from 'svelte/compiler' ;
3
4
import type { ExposedCompilerOptions , File } from '../Workspace.svelte' ;
Original file line number Diff line number Diff line change
1
+ import '@sveltejs/site-kit/polyfills' ;
1
2
import '../patch_window' ;
2
3
import { sleep } from '../../utils' ;
3
4
import { rollup } from '@rollup/browser' ;
Original file line number Diff line number Diff line change 98
98
"default" : " ./src/lib/nav/index.ts" ,
99
99
"svelte" : " ./src/lib/nav/index.ts"
100
100
},
101
+ "./polyfills" : {
102
+ "default" : " ./src/lib/polyfills/index.ts"
103
+ },
101
104
"./icons/link.svg" : " ./src/lib/icons/link.svg" ,
102
105
"./icons/search.svg" : " ./src/lib/icons/search.svg" ,
103
106
"./search" : {
Original file line number Diff line number Diff line change
1
+ // Some polyfills for things used throughout the app for better browser compat
2
+
3
+ if ( ! Array . prototype . at ) {
4
+ Array . prototype . at = /** @param {number } index */ function ( index ) {
5
+ return this [ index >= 0 ? index : this . length + index ] ;
6
+ } ;
7
+ }
8
+
9
+ if ( ! Promise . withResolvers ) {
10
+ Promise . withResolvers = function ( ) {
11
+ let resolve : any , reject : any ;
12
+ const promise = new Promise < any > ( ( res , rej ) => {
13
+ resolve = res ;
14
+ reject = rej ;
15
+ } ) ;
16
+ return { resolve, reject, promise } ;
17
+ } ;
18
+ }
Original file line number Diff line number Diff line change
1
+ import '@sveltejs/site-kit/polyfills' ;
1
2
import flexsearch , { type Index as FlexSearchIndex } from 'flexsearch' ;
2
3
import type { Block , BlockGroup } from './types' ;
3
4
You can’t perform that action at this time.
0 commit comments