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 6969
7070 if (! hash && ! saved ) {
7171 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 )
7474 });
7575
7676 modified = false ;
Original file line number Diff line number Diff line change 1+ import '@sveltejs/site-kit/polyfills' ;
12import { parseTar } from 'tarparser' ;
23import type { CompileResult } from 'svelte/compiler' ;
34import type { ExposedCompilerOptions , File } from '../Workspace.svelte' ;
Original file line number Diff line number Diff line change 1+ import '@sveltejs/site-kit/polyfills' ;
12import '../patch_window' ;
23import { sleep } from '../../utils' ;
34import { rollup } from '@rollup/browser' ;
Original file line number Diff line number Diff line change 9898 "default" : " ./src/lib/nav/index.ts" ,
9999 "svelte" : " ./src/lib/nav/index.ts"
100100 },
101+ "./polyfills" : {
102+ "default" : " ./src/lib/polyfills/index.ts"
103+ },
101104 "./icons/link.svg" : " ./src/lib/icons/link.svg" ,
102105 "./icons/search.svg" : " ./src/lib/icons/search.svg" ,
103106 "./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' ;
12import flexsearch , { type Index as FlexSearchIndex } from 'flexsearch' ;
23import type { Block , BlockGroup } from './types' ;
34
You can’t perform that action at this time.
0 commit comments