From 4d60069dec78130bbf4e6479aed337e2d4add6e3 Mon Sep 17 00:00:00 2001 From: smertelny Date: Fri, 5 Nov 2021 00:10:02 +0200 Subject: [PATCH 01/91] #12: Initial commit for differential legacy builds implementation --- packages/kit/package.json | 1 + packages/kit/src/core/build/index.js | 73 +++++++++++++++---- packages/kit/src/core/config/index.js | 7 ++ packages/kit/src/core/config/index.spec.js | 6 +- packages/kit/src/core/config/options.js | 11 ++- packages/kit/src/core/config/test/index.js | 3 +- .../kit/src/runtime/server/page/render.js | 63 +++++++++++++++- packages/kit/types/config.d.ts | 2 + packages/kit/types/internal.d.ts | 17 ++++- pnpm-lock.yaml | 36 ++++++++- 10 files changed, 196 insertions(+), 23 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index d1723bd56099..ac82404b5d7e 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -10,6 +10,7 @@ "type": "module", "dependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", + "@vitejs/plugin-legacy": "^1.6.2", "cheap-watch": "^1.0.4", "sade": "^1.7.4", "vite": "^2.6.12" diff --git a/packages/kit/src/core/build/index.js b/packages/kit/src/core/build/index.js index 58176de46c26..82ac04d1eecc 100644 --- a/packages/kit/src/core/build/index.js +++ b/packages/kit/src/core/build/index.js @@ -4,6 +4,7 @@ import path from 'path'; import { svelte } from '@sveltejs/vite-plugin-svelte'; import glob from 'tiny-glob/sync.js'; import vite from 'vite'; +import legacy from '@vitejs/plugin-legacy'; import { rimraf } from '../../utils/filesystem.js'; import { deep_merge } from '../../utils/object.js'; @@ -137,6 +138,20 @@ async function build_client({ } }; + let plugins = [ + svelte({ + extensions: config.extensions, + emitCss: !config.kit.amp, + compilerOptions: { + hydratable: !!config.kit.hydrate + } + }) + ]; + + if (config.kit.legacy) { + plugins = [...plugins, legacy(config.kit.legacy)]; + } + // don't warn on overriding defaults const [modified_vite_config] = deep_merge(default_config, vite_config); @@ -166,15 +181,7 @@ async function build_client({ $lib: config.kit.files.lib } }, - plugins: [ - svelte({ - extensions: config.extensions, - emitCss: !config.kit.amp, - compilerOptions: { - hydratable: !!config.kit.hydrate - } - }) - ] + plugins }); print_config_conflicts(conflicts, 'kit.vite.', 'build_client'); @@ -280,6 +287,31 @@ async function build_server( }; }); + /** @type {(filename: string) => string} */ + const make_legacy_file_name = (file) => { + const f = file.split('.'); + return `${f.slice(0, f.length - 1).join('.')}-legacy.${f.slice(f.length - 1)}`; + }; + + if (config.kit.legacy) { + ['vite/legacy-polyfills', ...manifest.components.map(make_legacy_file_name)].forEach((file) => { + if (client_manifest[file]) { + const js_deps = new Set(); + + find_deps(file, js_deps, new Set()); + + const js_legacy = Array.from(js_deps); + + metadata_lookup[file] = { + entry: client_manifest[file].file, + css: [], + js: js_legacy, + styles: [] + }; + } + }); + } + /** @type {Set} */ const entry_js = new Set(); /** @type {Set} */ @@ -287,6 +319,8 @@ async function build_server( find_deps(client_entry_file, entry_js, entry_css); + const legacy_entry_file = make_legacy_file_name(client_entry_file); + // prettier-ignore fs.writeFileSync( app_file, @@ -297,9 +331,10 @@ async function build_server( import { set_prerendering } from './runtime/env.js'; import * as user_hooks from ${s(app_relative(hooks_file))}; - const template = ({ head, body }) => ${s(fs.readFileSync(config.kit.files.template, 'utf-8')) + const template = ({ head, body, legacy_scripts = '' }) => ${s(fs.readFileSync(config.kit.files.template, 'utf-8')) .replace('%svelte.head%', '" + head + "') - .replace('%svelte.body%', '" + body + "')}; + .replace('%svelte.body%', '" + body + "') + .replace('%svelte.legacy_scripts%', '" + legacy_scripts + "')}; let options = null; @@ -321,6 +356,12 @@ async function build_server( css: [${Array.from(entry_css).map(dep => 'assets + ' + s(prefix + dep))}], js: [${Array.from(entry_js).map(dep => 'assets + ' + s(prefix + dep))}] }, + entry_legacy: ${config.kit.legacy ? `{ + file: assets + ${s(prefix + client_manifest[legacy_entry_file].file)}, + css: [], + js: [], + polyfills: assets + ${s(prefix + client_manifest['vite/legacy-polyfills'].file)} + },` : 'null,'} fetched: undefined, floc: ${config.kit.floc}, get_component_path: id => assets + ${s(prefix)} + entry_lookup[id], @@ -411,7 +452,12 @@ async function build_server( }; const metadata_lookup = ${s(metadata_lookup)}; - + ${config.kit.legacy ? + `\nconst make_legacy_file_name = (filename) => { + let f = filename.split("."); + let end = f.pop(); + return f.join(".").concat("-legacy.", end); + }\n` : ''} async function load_component(file) { const { entry, css, js, styles } = metadata_lookup[file]; return { @@ -419,7 +465,8 @@ async function build_server( entry: assets + ${s(prefix)} + entry, css: css.map(dep => assets + ${s(prefix)} + dep), js: js.map(dep => assets + ${s(prefix)} + dep), - styles + styles, + legacy: ${config.kit.legacy ? `assets + ${s(prefix)} + metadata_lookup[make_legacy_file_name(file)]["entry"]` : '[]'} }; } diff --git a/packages/kit/src/core/config/index.js b/packages/kit/src/core/config/index.js index 6af9d9b348af..642c1a41e5c1 100644 --- a/packages/kit/src/core/config/index.js +++ b/packages/kit/src/core/config/index.js @@ -22,6 +22,13 @@ function validate_template(cwd, validated) { throw new Error(`${relative} is missing ${tag}`); } }); + + if (validated.kit.legacy) { + const tag = '%svelte.legacy_scripts%'; + if (contents.indexOf(tag) === -1) { + throw new Error(`${relative} is missing ${tag}`); + } + } } else { throw new Error(`${relative} does not exist`); } diff --git a/packages/kit/src/core/config/index.spec.js b/packages/kit/src/core/config/index.spec.js index 2707b6133c2d..fb14d45b6810 100644 --- a/packages/kit/src/core/config/index.spec.js +++ b/packages/kit/src/core/config/index.spec.js @@ -52,7 +52,8 @@ test('fills in defaults', () => { router: true, ssr: true, target: null, - trailingSlash: 'never' + trailingSlash: 'never', + legacy: null } }); }); @@ -152,7 +153,8 @@ test('fills in partial blanks', () => { router: true, ssr: true, target: null, - trailingSlash: 'never' + trailingSlash: 'never', + legacy: null } }); }); diff --git a/packages/kit/src/core/config/options.js b/packages/kit/src/core/config/options.js index 1a76bb14e113..920c0996d1d4 100644 --- a/packages/kit/src/core/config/options.js +++ b/packages/kit/src/core/config/options.js @@ -187,7 +187,16 @@ const options = object( return input; } - ) + ), + legacy: validate(null, (input, keypath) => { + if (typeof input !== 'object' || Array.isArray(input)) { + throw new Error( + `${keypath} should be an object. See https://github.com/vitejs/vite/tree/main/packages/plugin-legacy for all avaliable options` + ); + } + + return input; + }) }) }, true diff --git a/packages/kit/src/core/config/test/index.js b/packages/kit/src/core/config/test/index.js index 57d966c14909..9206943902e1 100644 --- a/packages/kit/src/core/config/test/index.js +++ b/packages/kit/src/core/config/test/index.js @@ -54,7 +54,8 @@ async function testLoadDefaultConfig(path) { router: true, ssr: true, target: null, - trailingSlash: 'never' + trailingSlash: 'never', + legacy: null } }); } diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 561f817fd904..06e105b50a83 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -148,6 +148,11 @@ export async function render_response({ }` : 'null'} }); `; + + if (options.entry_legacy) { + init = `${init} + `; + } } if (options.service_worker) { @@ -196,10 +201,66 @@ export async function render_response({ headers['permissions-policy'] = 'interest-cohort=()'; } + let legacy_scripts = ''; + if (options.entry_legacy) { + legacy_scripts = [ + '', + ``, + `` + ].join('\n\t\t'); + } + return { status, headers, - body: options.template({ head, body }) + body: options.template({ head, body, legacy_scripts }) }; } diff --git a/packages/kit/types/config.d.ts b/packages/kit/types/config.d.ts index 5d2214d0eacb..dffe1e1d5d2b 100644 --- a/packages/kit/types/config.d.ts +++ b/packages/kit/types/config.d.ts @@ -1,6 +1,7 @@ import { UserConfig as ViteConfig } from 'vite'; import { RecursiveRequired } from './helper'; import { Logger, TrailingSlash } from './internal'; +import { Options as ViteLegacyOptions } from '@vitejs/plugin-legacy'; export interface AdapterUtils { log: Logger; @@ -89,6 +90,7 @@ export interface Config { target?: string; trailingSlash?: TrailingSlash; vite?: ViteConfig | (() => ViteConfig); + legacy?: ViteLegacyOptions; }; preprocess?: any; } diff --git a/packages/kit/types/internal.d.ts b/packages/kit/types/internal.d.ts index bfc5b5ab0a05..57e1e7523e13 100644 --- a/packages/kit/types/internal.d.ts +++ b/packages/kit/types/internal.d.ts @@ -129,6 +129,7 @@ export interface SSRNode { js: string[]; /** inlined styles */ styles: string[]; + legacy?: string; } export interface SSRRenderOptions { @@ -139,6 +140,12 @@ export interface SSRRenderOptions { css: string[]; js: string[]; }; + entry_legacy?: { + file: string; + css: string[]; + js: string[]; + polyfills: string; + }; floc: boolean; get_stack: (error: Error) => string | undefined; handle_error(error: Error & { frame?: string }, request: ServerRequest): void; @@ -157,7 +164,15 @@ export interface SSRRenderOptions { service_worker?: string; ssr: boolean; target: string; - template({ head, body }: { head: string; body: string }): string; + template({ + head, + body, + legacy_scripts + }: { + head: string; + body: string; + legacy_scripts?: string; + }): string; trailing_slash: TrailingSlash; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8b6bc35a954..de3076a86f6b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,6 +209,7 @@ importers: '@types/node': ^16.10.3 '@types/rimraf': ^3.0.2 '@types/sade': ^1.7.3 + '@vitejs/plugin-legacy': ^1.6.2 amphtml-validator: ^1.0.35 cheap-watch: ^1.0.4 cookie: ^0.4.1 @@ -233,6 +234,7 @@ importers: vite: ^2.6.12 dependencies: '@sveltejs/vite-plugin-svelte': 1.0.0-next.30_svelte@3.44.0+vite@2.6.13 + '@vitejs/plugin-legacy': 1.6.2_vite@2.6.13 cheap-watch: 1.0.4 sade: 1.7.4 vite: 2.6.13 @@ -261,7 +263,7 @@ importers: sirv: 1.0.18 svelte: 3.44.0 svelte-check: 2.2.8_svelte@3.44.0 - svelte2tsx: 0.4.8_svelte@3.44.0+typescript@4.4.4 + svelte2tsx: 0.4.8_svelte@3.44.0 tiny-glob: 0.2.9 uvu: 0.5.2 @@ -322,6 +324,11 @@ packages: regenerator-runtime: 0.13.9 dev: true + /@babel/standalone/7.16.2: + resolution: {integrity: sha512-Cc0b/YJapYV1o+lhevV2FCr0lkbGbejA/iRWH5S5aZCF/AeAVVRcIS491omYMNbf+Z9SCDgczUu8Kx8WGCnr2g==} + engines: {node: '>=6.9.0'} + dev: false + /@bcoe/v8-coverage/0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true @@ -1070,6 +1077,20 @@ packages: eslint-visitor-keys: 2.1.0 dev: true + /@vitejs/plugin-legacy/1.6.2_vite@2.6.13: + resolution: {integrity: sha512-p5Bv/827WUpVN2m95ZYXzmjE3AblFE4CHasVoZ7dIwOPlyNcpg70SehEi5AWqyC0E7C1rHD8Nju9rWoV9uBLiw==} + engines: {node: '>=12.0.0'} + peerDependencies: + vite: ^2.0.0 + dependencies: + '@babel/standalone': 7.16.2 + core-js: 3.19.1 + magic-string: 0.25.7 + regenerator-runtime: 0.13.9 + systemjs: 6.11.0 + vite: 2.6.13 + dev: false + /accepts/1.3.7: resolution: {integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==} engines: {node: '>= 0.6'} @@ -1495,6 +1516,11 @@ packages: resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} engines: {node: '>= 0.6'} + /core-js/3.19.1: + resolution: {integrity: sha512-Tnc7E9iKd/b/ff7GFbhwPVzJzPztGrChB8X8GLqoYGdEOG8IpLnK1xPyo3ZoO3HsK6TodJS58VGPOxA+hLHQMg==} + requiresBuild: true + dev: false + /cross-spawn/5.1.0: resolution: {integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=} dependencies: @@ -3447,7 +3473,6 @@ packages: /regenerator-runtime/0.13.9: resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==} - dev: true /regexparam/1.3.0: resolution: {integrity: sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g==} @@ -3936,7 +3961,7 @@ packages: engines: {node: '>= 8'} dev: true - /svelte2tsx/0.4.8_svelte@3.44.0+typescript@4.4.4: + /svelte2tsx/0.4.8_svelte@3.44.0: resolution: {integrity: sha512-FSaJW/PW40XIV3zrHsW4aX6fBDPUu19gl1+zupCqOeT7wRip2RBxxt5ENDsPx/U5EuQC5+ultlYDGhSi6276wQ==} peerDependencies: svelte: ^3.24 @@ -3945,9 +3970,12 @@ packages: dedent-js: 1.0.1 pascal-case: 3.1.2 svelte: 3.44.0 - typescript: 4.4.4 dev: true + /systemjs/6.11.0: + resolution: {integrity: sha512-7YPIY44j+BoY+E6cGBSw0oCU8SNTTIHKZgftcBdwWkDzs/M86Fdlr21FrzAyph7Zo8r3CFGscyFe4rrBtixrBg==} + dev: false + /table/6.7.2: resolution: {integrity: sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==} engines: {node: '>=10.0.0'} From b6c04c16b8d9be5b4edbd87be51f0f9a53ca02f5 Mon Sep 17 00:00:00 2001 From: smertelny Date: Fri, 3 Dec 2021 13:57:47 +0200 Subject: [PATCH 02/91] Extracting page data to its own variable; fixes after extraction of data --- packages/kit/src/core/dev/index.js | 5 +- packages/kit/src/runtime/client/renderer.js | 2 +- packages/kit/src/runtime/client/start.js | 19 ++- .../kit/src/runtime/server/page/render.js | 126 +++++++----------- 4 files changed, 69 insertions(+), 83 deletions(-) diff --git a/packages/kit/src/core/dev/index.js b/packages/kit/src/core/dev/index.js index 11e247c3b1fb..6c93d195c2c3 100644 --- a/packages/kit/src/core/dev/index.js +++ b/packages/kit/src/core/dev/index.js @@ -458,11 +458,12 @@ async function create_plugin(config, dir, cwd, get_manifest) { router: config.kit.router, ssr: config.kit.ssr, target: config.kit.target, - template: ({ head, body }) => { + template: ({ head, body, legacy_scripts = '' }) => { let rendered = fs .readFileSync(config.kit.files.template, 'utf8') .replace('%svelte.head%', () => head) - .replace('%svelte.body%', () => body); + .replace('%svelte.body%', () => body) + .replace('%svelte.legacy_scripts%', () => legacy_scripts); if (config.kit.amp && validator) { const result = validator.validateString(rendered); diff --git a/packages/kit/src/runtime/client/renderer.js b/packages/kit/src/runtime/client/renderer.js index b0990138ecf8..03a22233237c 100644 --- a/packages/kit/src/runtime/client/renderer.js +++ b/packages/kit/src/runtime/client/renderer.js @@ -67,7 +67,7 @@ export class Renderer { * @param {{ * Root: CSRComponent; * fallback: [CSRComponent, CSRComponent]; - * target: Node; + * target: Element; * session: any; * host: string; * }} opts diff --git a/packages/kit/src/runtime/client/start.js b/packages/kit/src/runtime/client/start.js index 5d7868f6a7e1..a16a3b448e96 100644 --- a/packages/kit/src/runtime/client/start.js +++ b/packages/kit/src/runtime/client/start.js @@ -13,7 +13,7 @@ import { set_paths } from '../paths.js'; * assets: string; * base: string; * }, - * target: Node; + * target: string; * session: any; * host: string; * route: boolean; @@ -22,7 +22,8 @@ import { set_paths } from '../paths.js'; * hydrate: { * status: number; * error: Error; - * nodes: Array>; + * nodes: Array; + * legacy_nodes: Array; * page: import('types/page').Page; * }; * }} opts @@ -35,7 +36,7 @@ export async function start({ paths, target, session, host, route, spa, trailing const renderer = new Renderer({ Root, fallback, - target, + target: document.querySelector(target) ?? document.body, session, host }); @@ -52,7 +53,17 @@ export async function start({ paths, target, session, host, route, spa, trailing init(router); set_paths(paths); - if (hydrate) await renderer.start(hydrate); + if (hydrate) { + if (import.meta.env.LEGACY) { + hydrate.nodes = hydrate.legacy_nodes; + } + + hydrate.nodes = await Promise.all(hydrate.nodes.map((n) => import(/* @vite-ignore */ n))); + hydrate.page.query = new URLSearchParams(hydrate.page.query); + + await renderer.start(hydrate); + } + if (router) { if (spa) router.goto(location.href, { replaceState: true }, []); router.init_listeners(); diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 06e105b50a83..14d5f84961ed 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -115,38 +115,52 @@ export async function render_response({ `; } else if (include_js) { // prettier-ignore - init = `\n`; + init += ``; if (options.entry_legacy) { @@ -208,51 +222,11 @@ export async function render_response({ ``, - `` ].join('\n\t\t'); } From 2ce2297a8f43b20b5d01c408fdaddf47a7d51f8a Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Sun, 21 Aug 2022 18:50:55 +0300 Subject: [PATCH 03/91] fixing legacy chunk generation --- packages/kit/package.json | 1 - packages/kit/src/vite/index.js | 16 +++++--- pnpm-lock.yaml | 57 +++++++++++++++-------------- sites/kit.svelte.dev/package.json | 2 + sites/kit.svelte.dev/vite.config.js | 15 +++++++- 5 files changed, 56 insertions(+), 35 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index b4f17ec1c66c..1ff4a5503624 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -11,7 +11,6 @@ "type": "module", "dependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.1", - "@vitejs/plugin-legacy": "2.0.0", "chokidar": "^3.5.3", "sade": "^1.8.1", "terser": ">=5.4.0 <6.0.0" diff --git a/packages/kit/src/vite/index.js b/packages/kit/src/vite/index.js index 6cda0a82f1f0..415a3645dbd0 100644 --- a/packages/kit/src/vite/index.js +++ b/packages/kit/src/vite/index.js @@ -1,10 +1,9 @@ import { fork } from 'node:child_process'; -import fs, { existsSync } from 'node:fs'; +import fs from 'node:fs'; import path from 'node:path'; import colors from 'kleur'; import { svelte } from '@sveltejs/vite-plugin-svelte'; import * as vite from 'vite'; -import legacy from '@vitejs/plugin-legacy'; import { mkdirp, posixify, rimraf } from '../utils/filesystem.js'; import * as sync from '../core/sync/sync.js'; import { build_server } from './build/build_server.js'; @@ -87,6 +86,8 @@ function kit() { /** @type {import('vite').ConfigEnv} */ let vite_config_env; + let outputCount = 0; + /** @type {import('types').ManifestData} */ let manifest_data; @@ -242,10 +243,6 @@ function kit() { } }; - if (svelte_config.kit.legacy) { - result.plugins = [legacy(svelte_config.kit.legacy)]; - } - deferred_warning = warn_overridden_config(config, result); return result; }, @@ -279,6 +276,13 @@ function kit() { * then use this hook to kick off builds for the server and service worker. */ async writeBundle(_options, bundle) { + ++outputCount; + const output = vite_config.build.rollupOptions.output; + const outputLength = Array.isArray(output) ? output.length : 1; + if (outputCount < outputLength) { + return;// Wait untill all output will be done building, since we need the manifest + } + const verbose = vite_config.logLevel === 'info'; log = logger({ verbose }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f30e472ca0e0..218cb9289196 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -278,7 +278,6 @@ importers: '@types/node': ^16.11.36 '@types/sade': ^1.7.4 '@types/set-cookie-parser': ^2.4.2 - '@vitejs/plugin-legacy': 2.0.0 chokidar: ^3.5.3 cookie: ^0.5.0 cross-env: ^7.0.3 @@ -305,7 +304,6 @@ importers: vite: ^3.0.0 dependencies: '@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.48.0+vite@3.0.0 - '@vitejs/plugin-legacy': 2.0.0_terser@5.14.2+vite@3.0.0 chokidar: 3.5.3 sade: 1.8.1 terser: 5.14.2 @@ -519,12 +517,14 @@ importers: '@sveltejs/kit': workspace:* '@sveltejs/site-kit': ^2.1.0 '@types/node': ^16.11.36 + '@vitejs/plugin-legacy': ^2.0.1 flexsearch: ^0.7.21 marked: ^4.0.16 prism-svelte: ^0.5.0 prismjs: ^1.28.0 shiki-twoslash: ^3.0.2 svelte: ^3.48.0 + terser: '>=5.4.0 <6.0.0' typescript: ^4.7.4 vite: ^3.0.0 vite-imagetools: ^4.0.3 @@ -535,15 +535,17 @@ importers: '@sveltejs/kit': link:../../packages/kit '@sveltejs/site-kit': 2.1.0 '@types/node': 16.11.42 + '@vitejs/plugin-legacy': 2.0.1_terser@5.14.2+vite@3.0.0 flexsearch: 0.7.21 marked: 4.0.17 prism-svelte: 0.5.0 prismjs: 1.28.0 shiki-twoslash: 3.1.0 svelte: 3.48.0 + terser: 5.14.2 typescript: 4.7.4 - vite: 3.0.0 - vite-imagetools: 4.0.4 + vite: 3.0.0_terser@5.14.2 + vite-imagetools: 4.0.3 packages: @@ -575,10 +577,10 @@ packages: regenerator-runtime: 0.13.9 dev: true - /@babel/standalone/7.18.9: - resolution: {integrity: sha512-6E+p5azHMHcMkHzGFnA7Pqhtgfwx1cClwjMqomMHhdFupCLZDDpVQUctRGYE7p7nn7cXJZSI/L9en+tt30AP3w==} + /@babel/standalone/7.18.12: + resolution: {integrity: sha512-wDh3K5IUJiSMAY0MLYBFoCaj2RCZwvDz5BHn2uHat9KOsGWEVDFgFQFIOO+81Js2phFKNppLC45iOCsZVfJniw==} engines: {node: '>=6.9.0'} - dev: false + dev: true /@bcoe/v8-coverage/0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -1187,21 +1189,21 @@ packages: - supports-color dev: false - /@vitejs/plugin-legacy/2.0.0_terser@5.14.2+vite@3.0.0: - resolution: {integrity: sha512-cuc45C4BQo2VlOsHZML4fc3MPfSjOEFeezHxr+WWlOOmi+muy1rz2snnFiePtyjVc1CYGTsnxk13cXpzQvMZaw==} - engines: {node: '>=14.18.0'} + /@vitejs/plugin-legacy/2.0.1_terser@5.14.2+vite@3.0.0: + resolution: {integrity: sha512-kKC56rfsXwebApzyuZqdQlGmqTyH1ugy0l0rY58gx5OXzq4/t5/DCqGUoz53Db51OqfjRqsHfqmvq9or6w9k/Q==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: terser: ^5.4.0 vite: ^3.0.0 dependencies: - '@babel/standalone': 7.18.9 - core-js: 3.24.0 + '@babel/standalone': 7.18.12 + core-js: 3.24.1 magic-string: 0.26.2 regenerator-runtime: 0.13.9 - systemjs: 6.12.1 + systemjs: 6.12.3 terser: 5.14.2 vite: 3.0.0_terser@5.14.2 - dev: false + dev: true /abbrev/1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} @@ -1600,10 +1602,10 @@ packages: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} - /core-js/3.24.0: - resolution: {integrity: sha512-IeOyT8A6iK37Ep4kZDD423mpi6JfPRoPUdQwEWYiGolvn4o6j2diaRzNfDfpTdu3a5qMbrGUzKUpYpRY8jXCkQ==} + /core-js/3.24.1: + resolution: {integrity: sha512-0QTBSYSUZ6Gq21utGzkfITDylE8jWC9Ne1D2MrhvlsZBI1x39OdDIVbzSqtgMndIy6BlHxBXpMGqzZmnztg2rg==} requiresBuild: true - dev: false + dev: true /cross-env/7.0.3: resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} @@ -2278,7 +2280,7 @@ packages: dev: true /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: true /gitignore-parser/0.0.2: @@ -2982,8 +2984,8 @@ packages: tslib: 2.4.0 dev: true - /node-abi/3.22.0: - resolution: {integrity: sha512-u4uAs/4Zzmp/jjsD9cyFYDXeISfUWaAVWshPmDZOFOv4Xl4SbzTXm53I04C2uRueYJ+0t5PEtLH/owbn2Npf/w==} + /node-abi/3.24.0: + resolution: {integrity: sha512-YPG3Co0luSu6GwOBsmIdGW6Wx0NyNDLg/hriIyDllVsNwnI6UeqaWShxC3lbH4LtEQUgoLP3XR1ndXiDAWvmRw==} engines: {node: '>=10'} dependencies: semver: 7.3.7 @@ -3335,7 +3337,7 @@ packages: minimist: 1.2.6 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 - node-abi: 3.22.0 + node-abi: 3.24.0 pump: 3.0.0 rc: 1.2.8 simple-get: 4.0.1 @@ -3503,6 +3505,7 @@ packages: /regenerator-runtime/0.13.9: resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==} + dev: true /regexp.prototype.flags/1.4.3: resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} @@ -4159,9 +4162,9 @@ packages: typescript: 4.7.4 dev: true - /systemjs/6.12.1: - resolution: {integrity: sha512-hqTN6kW+pN6/qro6G9OZ7ceDQOcYno020zBQKpZQLsJhYTDMCMNfXi/Y8duF5iW+4WWZr42ry0MMkcRGpbwG2A==} - dev: false + /systemjs/6.12.3: + resolution: {integrity: sha512-TtYUN86Hs8V1QGAoj9ad1xmJmZS9Lurfi8Iu8QWOKaUDDuTH0Bpfdxz9qZIdxsmvAg3WMQnZ5/pkQvloh2sr/Q==} + dev: true /tar-fs/2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} @@ -4518,13 +4521,13 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-imagetools/4.0.4: - resolution: {integrity: sha512-ik1Sq4ueKYN2iBjxe3g8YxqM9aul2goQ2z8CuTKKxOG3M1nF63SRqialbXMuJVH8aKJ9A2oGhs1sktCAoo9EBg==} + /vite-imagetools/4.0.3: + resolution: {integrity: sha512-8MfpwoUvJBGNgrBhVNd+HIRH32+1yN9vtFVGEAAWxa+/9E1pXGu4Lwj3d9Ydi6HwR9sFi4ZQdgaRkQDGKX9O1Q==} engines: {node: '>=12.0.0'} dependencies: '@rollup/pluginutils': 4.2.1 imagetools-core: 3.0.3 - magic-string: 0.26.2 + magic-string: 0.25.9 dev: true /vite/3.0.0: diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json index 616f17709c90..9df873f15b4e 100644 --- a/sites/kit.svelte.dev/package.json +++ b/sites/kit.svelte.dev/package.json @@ -14,12 +14,14 @@ "@sveltejs/kit": "workspace:*", "@sveltejs/site-kit": "^2.1.0", "@types/node": "^16.11.36", + "@vitejs/plugin-legacy": "^2.0.1", "flexsearch": "^0.7.21", "marked": "^4.0.16", "prism-svelte": "^0.5.0", "prismjs": "^1.28.0", "shiki-twoslash": "^3.0.2", "svelte": "^3.48.0", + "terser": ">=5.4.0 <6.0.0", "typescript": "^4.7.4", "vite": "^3.0.0", "vite-imagetools": "^4.0.3" diff --git a/sites/kit.svelte.dev/vite.config.js b/sites/kit.svelte.dev/vite.config.js index 7c1529e4a506..1e3633cb9b10 100644 --- a/sites/kit.svelte.dev/vite.config.js +++ b/sites/kit.svelte.dev/vite.config.js @@ -1,12 +1,25 @@ import { sveltekit } from '@sveltejs/kit/vite'; import * as path from 'path'; import { imagetools } from 'vite-imagetools'; +import legacy from '@vitejs/plugin-legacy'; /** @type {import('vite').UserConfig} */ const config = { logLevel: 'info', - plugins: [imagetools(), sveltekit()], + plugins: [ + imagetools(), + legacy({ + targets: ['ie >= 11'], + additionalLegacyPolyfills: [ + 'custom-event-polyfill', + 'core-js/modules/es.promise.js', + 'whatwg-fetch', + 'regenerator-runtime/runtime' + ] + }), + sveltekit(), + ], resolve: { alias: { From 992bf324a2c1fe36776bea96625d6810f3e8fbe4 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Mon, 22 Aug 2022 23:09:56 +0300 Subject: [PATCH 04/91] carefull usage of 'composePath' for legacy --- packages/kit/src/runtime/client/utils.js | 30 ++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/runtime/client/utils.js b/packages/kit/src/runtime/client/utils.js index 8a2dafd744c7..a7b747532e65 100644 --- a/packages/kit/src/runtime/client/utils.js +++ b/packages/kit/src/runtime/client/utils.js @@ -24,8 +24,34 @@ export function scroll_state() { /** @param {Event} event */ export function find_anchor(event) { - const node = event - .composedPath() + /** @param {Event} event */ + function composedPath(event) { + if (event.composedPath) { + return event.composedPath(); + } + + /** + * path-composedPath-polyfill.js v1.0.0 + * Polyfill de Event.path y Event.composedPath + * [Back-compatibility: IE9+] + * Copyright (c) 2021, Emanuel Rojas Vásquez + * MIT License + * https://github.com/erovas/path-composedPath-polyfill.js + */ + + var target = event.target; + var path = []; + while(/** @type {any} */(target).parentNode !== null){ + path.push(target); + target = /** @type {any} */(target).parentNode; + } + + path.push(document, window); + + return path; + } + + const node = composedPath(event) .find((e) => e instanceof Node && e.nodeName.toUpperCase() === 'A'); // SVG elements have a lowercase name return /** @type {HTMLAnchorElement | SVGAElement | undefined} */ (node); } From ab16dc1e7ff48b2392a4923e240089996c1d9ed2 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Mon, 22 Aug 2022 23:12:42 +0300 Subject: [PATCH 05/91] carefull modern code usage in kit.svelte.dev, for legacy support --- .../src/lib/docs/Contents.svelte | 4 +- .../src/lib/search/SearchBox.svelte | 42 ++++++++++--------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/sites/kit.svelte.dev/src/lib/docs/Contents.svelte b/sites/kit.svelte.dev/src/lib/docs/Contents.svelte index 1b538565f360..bbf61ed43362 100644 --- a/sites/kit.svelte.dev/src/lib/docs/Contents.svelte +++ b/sites/kit.svelte.dev/src/lib/docs/Contents.svelte @@ -17,7 +17,9 @@ let positions = []; onMount(async () => { - await document.fonts.ready; + if (document.fonts) { + await document.fonts.ready; + } update(); highlight(); diff --git a/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte b/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte index 739bafcff138..6e0b28cfa8bb 100644 --- a/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte +++ b/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte @@ -20,30 +20,34 @@ let has_pending = false; onMount(async () => { - worker = new SearchWorker(); + if ('serviceWorker' in navigator) { + worker = new SearchWorker(); - worker.addEventListener('message', (event) => { - const { type, payload } = event.data; + worker.addEventListener('message', (event) => { + const { type, payload } = event.data; - if (type === 'ready') { - ready = true; - } + if (type === 'ready') { + ready = true; + } - if (type === 'results') { - search = payload; - } + if (type === 'results') { + search = payload; + } - if (type === 'recents') { - recent_searches = payload; - } - }); + if (type === 'recents') { + recent_searches = payload; + } + }); - worker.postMessage({ - type: 'init', - payload: { - origin: location.origin - } - }); + worker.postMessage({ + type: 'init', + payload: { + origin: location.origin + } + }); + } else { + console.warn("The search web worker can't be initialized in this platform, searching wouldn't work."); + } }); afterNavigate(() => { From be104beba35c6b6d05ad84976e8c6fc0f308c654 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Mon, 22 Aug 2022 23:27:40 +0300 Subject: [PATCH 06/91] inject scripts on HTML to the right path and add polyfills Dev mode has so much just thought, need to clean up the code. --- .../kit/src/core/generate_manifest/index.js | 1 + .../kit/src/runtime/server/page/render.js | 72 ++++++++++++++----- packages/kit/src/vite/index.js | 18 +++++ packages/kit/types/index.d.ts | 6 +- packages/kit/types/internal.d.ts | 4 ++ pnpm-lock.yaml | 7 ++ sites/kit.svelte.dev/package.json | 1 + sites/kit.svelte.dev/vite.config.js | 5 +- 8 files changed, 91 insertions(+), 23 deletions(-) diff --git a/packages/kit/src/core/generate_manifest/index.js b/packages/kit/src/core/generate_manifest/index.js index 946043484bb9..b3c534996fc7 100644 --- a/packages/kit/src/core/generate_manifest/index.js +++ b/packages/kit/src/core/generate_manifest/index.js @@ -50,6 +50,7 @@ export function generate_manifest({ build_data, relative_path, routes, format = mimeTypes: ${s(get_mime_lookup(build_data.manifest_data))}, _: { entry: ${s(build_data.client.entry)}, + entry_legacy: ${s(build_data.client.entry_legacy)}, nodes: [ ${Array.from(bundled_nodes.values()).map(node => loader(node.path)).join(',\n\t\t\t\t')} ], diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 0d21898e5b15..4366f229a1de 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -198,25 +198,6 @@ export async function render_response({ }); `; - let legacy_scripts = ''; - - if (entry_legacy) { - head += ``; - - legacy_scripts = [ - '', - ``, - `` - ].join('\n\t\t'); - } - // we use an anonymous function instead of an arrow function to support // older browsers (https://github.com/sveltejs/kit/pull/5417) const init_service_worker = ` @@ -280,6 +261,59 @@ export async function render_response({ body += `\n\t\t`; } + let legacy_scripts = '';// TODO: Get rid of this + + if (entry_legacy.file || entry_legacy.legacy_polyfills_file) { + // TODO: Make sure we have the appropriate scripts from Vite legacy plugin + + // TODO: Move the details to its own global def(e.g. `window.__KIT_DATA__`), to share between legacy&modern + const startDetails = `{ + target: document.querySelector('[data-sveltekit-hydrate="${target}"]').parentNode, + paths: ${s(options.paths)}, + route: ${!!page_config.router}, + spa: ${!resolve_opts.ssr}, + trailing_slash: ${s(options.trailing_slash)}, + hydrate: ${resolve_opts.ssr && page_config.hydrate ? `{ + status: ${status}, + error: ${error && serialize_error(error, e => e.stack)}, + node_ids: [${branch.map(({ node }) => node.index).join(', ')}], + legacy_nodes: [${branch.map(({ node }) => node.legacy).join(', ')}], + params: ${devalue(event.params)}, + routeId: ${s(event.routeId)} + }` : 'null'} + }`; + + // From vite plugin legacy: + // we set the entry path on the element as an attribute so that the + // script content will stay consistent - which allows using a constant + // hash value for CSP. + const legacyEntryId = 'vite-legacy-entry'; + + // TODO: Have interaction with the main non-legacy call to start, to not excecute it twice (on special cases). + const importAndStartCall = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src')).then(function(m){m.set_public_env(${s(options.public_env)}); m.start(${startDetails});});`; + + var legacyScripts = [ + '', + ]; + + if (entry_legacy.legacy_polyfills_file) { + legacyScripts.push(``); + } + + if (entry_legacy.file) { + legacyScripts = legacyScripts.concat([ + ``, + ``, + ]); + } + + body += ([''].concat(legacyScripts)).join('\n\t\t'); + + // TODO: Should it be added to CSP? + } + if (resolve_opts.ssr && page_config.hydrate) { /** @type {string[]} */ const serialized_data = []; diff --git a/packages/kit/src/vite/index.js b/packages/kit/src/vite/index.js index 03ae66c28a54..9c9351c553f7 100644 --- a/packages/kit/src/vite/index.js +++ b/packages/kit/src/vite/index.js @@ -169,6 +169,7 @@ function kit() { /** * @param {import('rollup').OutputAsset[]} assets * @param {import('rollup').OutputChunk[]} chunks + * @returns {import('types').BuildData['client']} */ function client_build_info(assets, chunks) { /** @type {import('vite').Manifest} */ @@ -176,12 +177,29 @@ function kit() { fs.readFileSync(`${paths.client_out_dir}/${vite_config.build.manifest}`, 'utf-8') ); + /** + * + * @param {string} entry + */ + const find_file_if_exist = (entry) => + (entry in vite_manifest) ? '/' + vite_manifest[entry].file : null;// TODO: Handle the "/" more correctly + const entry_id = posixify(path.relative(cwd, `${runtime_directory}/client/start.js`)); + const entry_legacy_id = posixify(path.relative(cwd, `${runtime_directory}/client/start-legacy.js`));// TODO: Use the convertion function? + const legacy_polyfills_id = 'vite/legacy-polyfills-legacy';// TODO: Use the convertion function? + // TODO: Support also modern polyfills? Just need another import + // TODO: Can we have automatic detection of legacy chunks to be configuraless? (detect legacy only by reading the manifest) + + const entry_legacy = { + file: find_file_if_exist(entry_legacy_id), + legacy_polyfills_file: find_file_if_exist(legacy_polyfills_id) + }; return { assets, chunks, entry: find_deps(vite_manifest, entry_id, false), + entry_legacy, vite_manifest }; } diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 4d693c3118eb..ce5bd52216c2 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -314,9 +314,9 @@ export interface SSRManifest { imports: string[]; stylesheets: string[]; }; - entry_legacy?: { - file: string; - polyfills: string; + entry_legacy: { + file: string | null; + legacy_polyfills_file: string | null; }; nodes: SSRNodeLoader[]; routes: SSRRoute[]; diff --git a/packages/kit/types/internal.d.ts b/packages/kit/types/internal.d.ts index 4f0d887ab36c..643561f3f4b5 100644 --- a/packages/kit/types/internal.d.ts +++ b/packages/kit/types/internal.d.ts @@ -50,6 +50,10 @@ export interface BuildData { imports: string[]; stylesheets: string[]; }; + entry_legacy: { + file: string | null; + legacy_polyfills_file: string | null; + }; vite_manifest: import('vite').Manifest; }; server: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 909f0cade843..4c3bdf6ddb02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -558,6 +558,7 @@ importers: svelte: ^3.48.0 terser: '>=5.4.0 <6.0.0' typescript: ^4.7.4 + unorm: ^1.6.0 vite: ^3.0.8 vite-imagetools: ^4.0.3 devDependencies: @@ -576,6 +577,7 @@ importers: svelte: 3.48.0 terser: 5.14.2 typescript: 4.7.4 + unorm: 1.6.0 vite: 3.0.9_terser@5.14.2 vite-imagetools: 4.0.3 @@ -4493,6 +4495,11 @@ packages: engines: {node: '>= 4.0.0'} dev: true + /unorm/1.6.0: + resolution: {integrity: sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==} + engines: {node: '>= 0.4.0'} + dev: true + /urix/0.1.0: resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} deprecated: Please see https://github.com/lydell/urix#deprecated diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json index bdbd1c2e2e11..e57c3249c14f 100644 --- a/sites/kit.svelte.dev/package.json +++ b/sites/kit.svelte.dev/package.json @@ -23,6 +23,7 @@ "svelte": "^3.48.0", "terser": ">=5.4.0 <6.0.0", "typescript": "^4.7.4", + "unorm": "^1.6.0", "vite": "^3.0.8", "vite-imagetools": "^4.0.3" }, diff --git a/sites/kit.svelte.dev/vite.config.js b/sites/kit.svelte.dev/vite.config.js index 1e3633cb9b10..b94f66da06d6 100644 --- a/sites/kit.svelte.dev/vite.config.js +++ b/sites/kit.svelte.dev/vite.config.js @@ -15,7 +15,10 @@ const config = { 'custom-event-polyfill', 'core-js/modules/es.promise.js', 'whatwg-fetch', - 'regenerator-runtime/runtime' + 'regenerator-runtime/runtime', + // 'global-this' should be used so 'regenerator-runtime' wouldn't do CSP issues + 'core-js/proposals/global-this', + 'unorm' ] }), sveltekit(), From 9bfd614d43ff1804801e346a2407b1836f2a872f Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 01:35:55 +0300 Subject: [PATCH 07/91] install missing & reorder additional legacy polyfills --- pnpm-lock.yaml | 15 ++++++++++++++- sites/kit.svelte.dev/package.json | 5 ++++- sites/kit.svelte.dev/vite.config.js | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c3bdf6ddb02..fa2437b3b336 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -550,10 +550,12 @@ importers: '@sveltejs/site-kit': ^2.1.0 '@types/node': ^16.11.36 '@vitejs/plugin-legacy': ^2.0.1 + custom-event-polyfill: ^1.0.7 flexsearch: ^0.7.21 marked: ^4.0.16 prism-svelte: ^0.5.0 prismjs: ^1.28.0 + regenerator-runtime: ^0.13.9 shiki-twoslash: ^3.0.2 svelte: ^3.48.0 terser: '>=5.4.0 <6.0.0' @@ -561,6 +563,7 @@ importers: unorm: ^1.6.0 vite: ^3.0.8 vite-imagetools: ^4.0.3 + whatwg-fetch: ^3.6.2 devDependencies: '@sveltejs/adapter-auto': link:../../packages/adapter-auto '@sveltejs/adapter-static': link:../../packages/adapter-static @@ -568,11 +571,12 @@ importers: '@sveltejs/kit': link:../../packages/kit '@sveltejs/site-kit': 2.1.0 '@types/node': 16.11.42 - '@vitejs/plugin-legacy': 2.0.1_terser@5.14.2+vite@3.0.9 + custom-event-polyfill: 1.0.7 flexsearch: 0.7.21 marked: 4.0.17 prism-svelte: 0.5.0 prismjs: 1.28.0 + regenerator-runtime: 0.13.9 shiki-twoslash: 3.1.0 svelte: 3.48.0 terser: 5.14.2 @@ -580,6 +584,7 @@ importers: unorm: 1.6.0 vite: 3.0.9_terser@5.14.2 vite-imagetools: 4.0.3 + whatwg-fetch: 3.6.2 packages: @@ -1695,6 +1700,10 @@ packages: stream-transform: 2.1.3 dev: true + /custom-event-polyfill/1.0.7: + resolution: {integrity: sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==} + dev: true + /data-uri-to-buffer/4.0.0: resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==} engines: {node: '>= 12'} @@ -4630,6 +4639,10 @@ packages: /webidl-conversions/3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + /whatwg-fetch/3.6.2: + resolution: {integrity: sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==} + dev: true + /whatwg-url/5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json index e57c3249c14f..482a2d22962a 100644 --- a/sites/kit.svelte.dev/package.json +++ b/sites/kit.svelte.dev/package.json @@ -15,17 +15,20 @@ "@sveltejs/site-kit": "^2.1.0", "@types/node": "^16.11.36", "@vitejs/plugin-legacy": "^2.0.1", + "custom-event-polyfill": "^1.0.7", "flexsearch": "^0.7.21", "marked": "^4.0.16", "prism-svelte": "^0.5.0", "prismjs": "^1.28.0", + "regenerator-runtime": "^0.13.9", "shiki-twoslash": "^3.0.2", "svelte": "^3.48.0", "terser": ">=5.4.0 <6.0.0", "typescript": "^4.7.4", "unorm": "^1.6.0", "vite": "^3.0.8", - "vite-imagetools": "^4.0.3" + "vite-imagetools": "^4.0.3", + "whatwg-fetch": "^3.6.2" }, "type": "module" } diff --git a/sites/kit.svelte.dev/vite.config.js b/sites/kit.svelte.dev/vite.config.js index b94f66da06d6..23ffe74f526b 100644 --- a/sites/kit.svelte.dev/vite.config.js +++ b/sites/kit.svelte.dev/vite.config.js @@ -15,9 +15,9 @@ const config = { 'custom-event-polyfill', 'core-js/modules/es.promise.js', 'whatwg-fetch', - 'regenerator-runtime/runtime', // 'global-this' should be used so 'regenerator-runtime' wouldn't do CSP issues 'core-js/proposals/global-this', + 'regenerator-runtime/runtime', 'unorm' ] }), From bc688b06bbad8e5230621042ed7534490d33e992 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 11:14:22 +0300 Subject: [PATCH 08/91] automatic reorder of dependencies --- packages/kit/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index 525837c3e0c1..7cd0306e87f9 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -20,8 +20,8 @@ "sade": "^1.8.1", "set-cookie-parser": "^2.4.8", "sirv": "^2.0.2", - "tiny-glob": "^0.2.9", "terser": ">=5.4.0 <6.0.0", + "tiny-glob": "^0.2.9", "undici": "^5.8.1" }, "devDependencies": { @@ -35,7 +35,7 @@ "@types/set-cookie-parser": "^2.4.2", "marked": "^4.0.16", "rollup": "^2.75.7", - "svelte": "^3.48.0", + "svelte": "file:C:/Src/svelte/svelte-3.49.0.tgz", "svelte-preprocess": "^4.10.6", "tiny-glob": "^0.2.9", "typescript": "^4.7.4", From 245525a8d76ee7204699e89573c3098ef6664a0f Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 13:24:00 +0300 Subject: [PATCH 09/91] clean unused code, and zero-configuration legacy support --- packages/kit/src/core/config/index.js | 7 --- packages/kit/src/core/config/index.spec.js | 1 - packages/kit/src/core/config/options.js | 10 ---- packages/kit/src/runtime/client/start.js | 5 -- .../kit/src/runtime/server/page/render.js | 6 +-- packages/kit/src/vite/build/build_server.js | 3 +- packages/kit/src/vite/dev/index.js | 52 ++++++------------- packages/kit/src/vite/index.js | 5 +- packages/kit/types/index.d.ts | 31 ----------- packages/kit/types/internal.d.ts | 5 +- sites/kit.svelte.dev/src/app.html | 3 +- 11 files changed, 21 insertions(+), 107 deletions(-) diff --git a/packages/kit/src/core/config/index.js b/packages/kit/src/core/config/index.js index 2bbc9683eae8..f903bb086b05 100644 --- a/packages/kit/src/core/config/index.js +++ b/packages/kit/src/core/config/index.js @@ -30,13 +30,6 @@ export function load_template(cwd, config) { throw new Error(`${relative} is missing ${tag}`); } }); - - if (config.kit.legacy) { - const tag = '%sveltekit.legacy_scripts%'; - if (contents.indexOf(tag) === -1) { - throw new Error(`${relative} is missing ${tag}`); - } - } } else { throw new Error(`${relative} does not exist`); } diff --git a/packages/kit/src/core/config/index.spec.js b/packages/kit/src/core/config/index.spec.js index f462851e464f..e9d6e0e66c44 100644 --- a/packages/kit/src/core/config/index.spec.js +++ b/packages/kit/src/core/config/index.spec.js @@ -120,7 +120,6 @@ const get_defaults = (prefix = '') => ({ ssr: undefined, target: undefined, trailingSlash: 'never', - legacy: null, version: { name: Date.now().toString(), pollInterval: 0 diff --git a/packages/kit/src/core/config/options.js b/packages/kit/src/core/config/options.js index 19f8624681e7..c82f008d8253 100644 --- a/packages/kit/src/core/config/options.js +++ b/packages/kit/src/core/config/options.js @@ -312,16 +312,6 @@ const options = object( trailingSlash: list(['never', 'always', 'ignore']), - legacy: validate(null, (input, keypath) => { - if (typeof input !== 'object' || Array.isArray(input)) { - throw new Error( - `${keypath} should be an object. See https://github.com/vitejs/vite/tree/main/packages/plugin-legacy for all avaliable options` - ); - } - - return input; - }), - version: object({ name: string(Date.now().toString()), pollInterval: number(0) diff --git a/packages/kit/src/runtime/client/start.js b/packages/kit/src/runtime/client/start.js index e9ee601ddd09..2c679c8a6cc2 100644 --- a/packages/kit/src/runtime/client/start.js +++ b/packages/kit/src/runtime/client/start.js @@ -18,7 +18,6 @@ export { set_public_env } from '../env-public.js'; * status: number; * error: Error | (import('../server/page/types').SerializedHttpError); * node_ids: number[]; - * legacy_nodes: number[]; * params: Record; * routeId: string | null; * }; @@ -35,10 +34,6 @@ export async function start({ paths, target, route, spa, trailing_slash, hydrate set_paths(paths); if (hydrate) { - if (import.meta.env.LEGACY) { - hydrate.nodes = hydrate.legacy_nodes; - } - await client._hydrate(hydrate); } diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 4366f229a1de..8814dd7bc55e 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -191,7 +191,6 @@ export async function render_response({ status: ${status}, error: ${error && serialize_error(error, e => e.stack)}, node_ids: [${branch.map(({ node }) => node.index).join(', ')}], - legacy_nodes: [${branch.map(({ node }) => node.legacy).join(', ')}], params: ${devalue(event.params)}, routeId: ${s(event.routeId)} }` : 'null'} @@ -261,8 +260,6 @@ export async function render_response({ body += `\n\t\t`; } - let legacy_scripts = '';// TODO: Get rid of this - if (entry_legacy.file || entry_legacy.legacy_polyfills_file) { // TODO: Make sure we have the appropriate scripts from Vite legacy plugin @@ -277,7 +274,6 @@ export async function render_response({ status: ${status}, error: ${error && serialize_error(error, e => e.stack)}, node_ids: [${branch.map(({ node }) => node.index).join(', ')}], - legacy_nodes: [${branch.map(({ node }) => node.legacy).join(', ')}], params: ${devalue(event.params)}, routeId: ${s(event.routeId)} }` : 'null'} @@ -374,7 +370,7 @@ export async function render_response({ // TODO flush chunks as early as we can const html = (await resolve_opts.transformPageChunk({ - html: options.template({ head, body, legacy_scripts, assets, nonce: /** @type {string} */ (csp.nonce) }), + html: options.template({ head, body, assets, nonce: /** @type {string} */ (csp.nonce) }), done: true })) || ''; diff --git a/packages/kit/src/vite/build/build_server.js b/packages/kit/src/vite/build/build_server.js index 4ecf5fd51cec..cb126b83c40d 100644 --- a/packages/kit/src/vite/build/build_server.js +++ b/packages/kit/src/vite/build/build_server.js @@ -24,10 +24,9 @@ import { set_prerendering } from '${runtime}/env.js'; import { set_private_env } from '${runtime}/env-private.js'; import { set_public_env } from '${runtime}/env-public.js'; -const template = ({ head, body, legacy_scripts, assets, nonce }) => ${s(template) +const template = ({ head, body, assets, nonce }) => ${s(template) .replace('%sveltekit.head%', '" + head + "') .replace('%sveltekit.body%', '" + body + "') - .replace('%sveltekit.legacy_scripts%', '" + legacy_scripts + "') .replace(/%sveltekit\.assets%/g, '" + assets + "') .replace(/%sveltekit\.nonce%/g, '" + nonce + "')}; diff --git a/packages/kit/src/vite/dev/index.js b/packages/kit/src/vite/dev/index.js index 3f7571540c5f..32e8ac6236cb 100644 --- a/packages/kit/src/vite/dev/index.js +++ b/packages/kit/src/vite/dev/index.js @@ -57,36 +57,21 @@ export async function dev(vite, vite_config, svelte_config, illegal_imports) { async function update_manifest() { ({ manifest_data } = await sync.create(svelte_config)); - const client_entry_file = `/@fs${runtime_prefix}/client/start.js`; - - /** @type {(filename: string) => string} */ - const make_legacy_file_name = (file) => { - const f = file.split('.'); - return `${f.slice(0, f.length - 1).join('.')}-legacy.${f.slice(f.length - 1)}`; - }; - - const legacy_entry_file = make_legacy_file_name(client_entry_file); - manifest = { appDir: svelte_config.kit.appDir, assets: new Set(manifest_data.assets.map((asset) => asset.file)), mimeTypes: get_mime_lookup(manifest_data), _: { entry: { - file: client_entry_file, + file: `/@fs${runtime_prefix}/client/start.js`, imports: [], stylesheets: [] }, - entry_legacy: svelte_config.kit.legacy ? { - file: legacy_entry_file, - polyfills: `/@fs${runtime_prefix}/client/vite/legacy-polyfills`// a guess instead of `assets + s(prefix + client_manifest['vite/legacy-polyfills'].file)` - } : undefined, - nodes: [ - ...manifest_data.nodes, - // TODO: Find out how to apply the legacy behaviour to these nodes - // 'vite/legacy-polyfills', - // ...manifest_data.nodes.map(make_legacy_file_name) - ].map((node, index) => { + entry_legacy: {// No legacy support in dev mode + file: null, + legacy_polyfills_file: null + }, + nodes: manifest_data.nodes.map((node, index) => { return async () => { /** @type {import('types').SSRNode} */ const result = {}; @@ -460,22 +445,15 @@ export async function dev(vite, vite_config, svelte_config, illegal_imports) { read: (file) => fs.readFileSync(path.join(svelte_config.kit.files.assets, file)), root, router: svelte_config.kit.browser.router, - template: ({ head, body, legacy_scripts, assets, nonce }) => { - var result = template - .replace(/%sveltekit\.assets%/g, assets) - .replace(/%sveltekit\.nonce%/g, nonce) - ; - - if (legacy_scripts != null) { - result = result.replace('%sveltekit.legacy_scripts%', legacy_scripts) - } - - // head and body must be replaced last, in case someone tries to sneak in %sveltekit.assets% etc - var result = result - .replace('%sveltekit.head%', () => head) - .replace('%sveltekit.body%', () => body) - - return result; + template: ({ head, body, assets, nonce }) => { + return ( + template + .replace(/%sveltekit\.assets%/g, assets) + .replace(/%sveltekit\.nonce%/g, nonce) + // head and body must be replaced last, in case someone tries to sneak in %sveltekit.assets% etc + .replace('%sveltekit.head%', () => head) + .replace('%sveltekit.body%', () => body) + ); }, template_contains_nonce: template.includes('%sveltekit.nonce%'), trailing_slash: svelte_config.kit.trailingSlash diff --git a/packages/kit/src/vite/index.js b/packages/kit/src/vite/index.js index 9c9351c553f7..4ef35ca7b406 100644 --- a/packages/kit/src/vite/index.js +++ b/packages/kit/src/vite/index.js @@ -185,10 +185,9 @@ function kit() { (entry in vite_manifest) ? '/' + vite_manifest[entry].file : null;// TODO: Handle the "/" more correctly const entry_id = posixify(path.relative(cwd, `${runtime_directory}/client/start.js`)); - const entry_legacy_id = posixify(path.relative(cwd, `${runtime_directory}/client/start-legacy.js`));// TODO: Use the convertion function? - const legacy_polyfills_id = 'vite/legacy-polyfills-legacy';// TODO: Use the convertion function? + const entry_legacy_id = posixify(path.relative(cwd, `${runtime_directory}/client/start-legacy.js`)); + const legacy_polyfills_id = 'vite/legacy-polyfills-legacy'; // TODO: Support also modern polyfills? Just need another import - // TODO: Can we have automatic detection of legacy chunks to be configuraless? (detect legacy only by reading the manifest) const entry_legacy = { file: find_file_if_exist(entry_legacy_id), diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index ce5bd52216c2..177b7aef5c6f 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -19,36 +19,6 @@ import { import { SSRNodeLoader, SSRRoute, ValidatedConfig } from './internal.js'; import { HttpError, Redirect } from '../src/index/private.js'; -interface ViteLegacyOptions { - /** - * default: 'defaults' - */ - targets?: string | string[] | { - [key: string]: string; - }; - /** - * default: false - */ - ignoreBrowserslistConfig?: boolean; - /** - * default: true - */ - polyfills?: boolean | string[]; - additionalLegacyPolyfills?: string[]; - /** - * default: false - */ - modernPolyfills?: boolean | string[]; - /** - * default: true - */ - renderLegacyChunks?: boolean; - /** - * default: false - */ - externalSystemJS?: boolean; -} - export interface Adapter { name: string; adapt(builder: Builder): MaybePromise; @@ -197,7 +167,6 @@ export interface KitConfig { files?: (filepath: string) => boolean; }; trailingSlash?: TrailingSlash; - legacy?: ViteLegacyOptions; version?: { name?: string; pollInterval?: number; diff --git a/packages/kit/types/internal.d.ts b/packages/kit/types/internal.d.ts index 643561f3f4b5..90453e111d76 100644 --- a/packages/kit/types/internal.d.ts +++ b/packages/kit/types/internal.d.ts @@ -196,6 +196,7 @@ export interface SSREndpoint { types: string[]; load(): Promise>>; } + export interface SSRNode { component: SSRComponentLoader; /** index into the `components` array in client-manifest.js */ @@ -227,8 +228,6 @@ export interface SSRNode { // store this in dev so we can print serialization errors server_id?: string; - - legacy?: string; } export type SSRNodeLoader = () => Promise; @@ -258,13 +257,11 @@ export interface SSROptions { template({ head, body, - legacy_scripts, assets, nonce }: { head: string; body: string; - legacy_scripts?: string; assets: string; nonce: string; }): string; diff --git a/sites/kit.svelte.dev/src/app.html b/sites/kit.svelte.dev/src/app.html index 921c63a8318b..281a243b7c05 100644 --- a/sites/kit.svelte.dev/src/app.html +++ b/sites/kit.svelte.dev/src/app.html @@ -13,8 +13,7 @@ - - %sveltekit.legacy_scripts% + %sveltekit.head% From e0e11fb22ccafc78dc84454ba0d9ea0565e65a35 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 13:35:51 +0300 Subject: [PATCH 10/91] remove the 'legacy' option from svelte.config.js --- sites/kit.svelte.dev/svelte.config.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sites/kit.svelte.dev/svelte.config.js b/sites/kit.svelte.dev/svelte.config.js index bee2cbef66ae..f59272ed425e 100644 --- a/sites/kit.svelte.dev/svelte.config.js +++ b/sites/kit.svelte.dev/svelte.config.js @@ -8,16 +8,6 @@ const config = { prerender: { default: true, entries: ['*', '/content.json'] - }, - - legacy: { - targets: ['ie >= 11'], - additionalLegacyPolyfills: [ - 'custom-event-polyfill', - 'core-js/modules/es.promise.js', - 'whatwg-fetch', - 'regenerator-runtime/runtime' - ] } } }; From dd99a8423e470d80eed673cae54075200bb86eb6 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 13:49:58 +0300 Subject: [PATCH 11/91] uninstall terser from kit --- packages/kit/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index de2030a29b6d..a7c7a630ca80 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -20,7 +20,6 @@ "sade": "^1.8.1", "set-cookie-parser": "^2.4.8", "sirv": "^2.0.2", - "terser": ">=5.4.0 <6.0.0", "tiny-glob": "^0.2.9", "undici": "^5.8.1" }, From 9dfaeed538f4b9fe4bc0526f3072a07896f26f4d Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 13:54:42 +0300 Subject: [PATCH 12/91] undo svelte versioning --- packages/kit/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index a7c7a630ca80..e67591d42e13 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -34,7 +34,7 @@ "@types/set-cookie-parser": "^2.4.2", "marked": "^4.0.16", "rollup": "^2.75.7", - "svelte": "file:C:/Src/svelte/svelte-3.49.0.tgz", + "svelte": "^3.48.0", "svelte-preprocess": "^4.10.6", "tiny-glob": "^0.2.9", "typescript": "^4.7.4", From 906e488f663719073da8fc2951e373eec1947861 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 14:00:30 +0300 Subject: [PATCH 13/91] update&fix? pnpm lock --- pnpm-lock.yaml | 455 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 298 insertions(+), 157 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d9e684573e61..d68dff9b7bbb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,17 +17,17 @@ importers: turbo: ^1.3.4 typescript: ^4.7.4 devDependencies: - '@changesets/cli': 2.23.0 - '@rollup/plugin-commonjs': 22.0.1_rollup@2.75.7 - '@rollup/plugin-json': 4.1.0_rollup@2.75.7 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.75.7 + '@changesets/cli': 2.24.3 + '@rollup/plugin-commonjs': 22.0.2_rollup@2.78.1 + '@rollup/plugin-json': 4.1.0_rollup@2.78.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.78.1 '@svitejs/changesets-changelog-github-compact': 0.1.1 - playwright: 1.25.0 + playwright: 1.25.1 prettier: 2.7.1 - rollup: 2.75.7 - svelte: 3.48.0 + rollup: 2.78.1 + svelte: 3.49.0 tiny-glob: 0.2.9 - turbo: 1.3.4 + turbo: 1.4.3 typescript: 4.7.4 packages/adapter-auto: @@ -290,14 +290,13 @@ importers: sirv: ^2.0.2 svelte: ^3.48.0 svelte-preprocess: ^4.10.6 - terser: '>=5.4.0 <6.0.0' tiny-glob: ^0.2.9 typescript: ^4.7.4 undici: ^5.8.1 uvu: ^0.5.3 vite: ^3.0.8 dependencies: - '@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.48.0+vite@3.0.9 + '@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.49.0+vite@3.0.9 cookie: 0.5.0 devalue: 2.0.1 kleur: 4.1.5 @@ -307,7 +306,6 @@ importers: sade: 1.8.1 set-cookie-parser: 2.5.0 sirv: 2.0.2 - terser: 5.14.2 tiny-glob: 0.2.9 undici: 5.8.1 devDependencies: @@ -321,11 +319,11 @@ importers: '@types/set-cookie-parser': 2.4.2 marked: 4.0.17 rollup: 2.75.7 - svelte: 3.48.0 - svelte-preprocess: 4.10.7_lvfi2wesz6u4l5rfbnetbucfmm + svelte: 3.49.0 + svelte-preprocess: 4.10.7_uslzfc62di2n2otc2tvfklnwji typescript: 4.7.4 uvu: 0.5.4 - vite: 3.0.9_terser@5.14.2 + vite: 3.0.9 packages/kit/test/apps/amp: specifiers: @@ -381,7 +379,7 @@ importers: svelte: 3.48.0 svelte-check: 2.8.0_svelte@3.48.0 typescript: 4.7.4 - vite: 3.0.8 + vite: 3.0.9 packages/kit/test/apps/options: specifiers: @@ -589,6 +587,7 @@ importers: '@sveltejs/kit': link:../../packages/kit '@sveltejs/site-kit': 2.1.0 '@types/node': 16.11.42 + '@vitejs/plugin-legacy': 2.0.1_terser@5.14.2+vite@3.0.9 custom-event-polyfill: 1.0.7 flexsearch: 0.7.21 marked: 4.0.17 @@ -596,7 +595,7 @@ importers: prismjs: 1.28.0 regenerator-runtime: 0.13.9 shiki-twoslash: 3.1.0 - svelte: 3.48.0 + svelte: 3.49.0 terser: 5.14.2 typescript: 4.7.4 unorm: 1.6.0 @@ -627,8 +626,8 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/runtime/7.18.6: - resolution: {integrity: sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ==} + /@babel/runtime/7.18.9: + resolution: {integrity: sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.9 @@ -643,14 +642,14 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@changesets/apply-release-plan/6.0.0: - resolution: {integrity: sha512-gp6nIdVdfYdwKww2+f8whckKmvfE4JEm4jJgBhTmooi0uzHWhnxvk6JIzQi89qEAMINN0SeVNnXiAtbFY0Mj3w==} + /@changesets/apply-release-plan/6.0.4: + resolution: {integrity: sha512-PutV/ymf8cZMqvaLe/Lh5cP3kBQ9FZl6oGQ3qRDxWD1ML+/uH3jrCE7S7Zw7IVSXkD0lnMD+1dAX7fsOJ6ZvgA==} dependencies: - '@babel/runtime': 7.18.6 - '@changesets/config': 2.0.0 + '@babel/runtime': 7.18.9 + '@changesets/config': 2.1.1 '@changesets/get-version-range-type': 0.3.2 - '@changesets/git': 1.3.2 - '@changesets/types': 5.0.0 + '@changesets/git': 1.4.1 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 fs-extra: 7.0.1 @@ -661,41 +660,41 @@ packages: semver: 5.7.1 dev: true - /@changesets/assemble-release-plan/5.1.3: - resolution: {integrity: sha512-I+TTkUoqvxBEuDLoJfJYKDXIJ+nyiTbVJ8KGhpXEsLq4N/ms/AStSbouJwF2d/p3cB+RCPr5+gXh31GSN4kA7w==} + /@changesets/assemble-release-plan/5.2.1: + resolution: {integrity: sha512-d6ckasOWlKF9Mzs82jhl6TKSCgVvfLoUK1ERySrTg2TQJdrVUteZue6uEIYUTA7SgMu67UOSwol6R9yj1nTdjw==} dependencies: - '@babel/runtime': 7.18.6 + '@babel/runtime': 7.18.9 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.2 - '@changesets/types': 5.0.0 + '@changesets/get-dependents-graph': 1.3.3 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 semver: 5.7.1 dev: true - /@changesets/changelog-git/0.1.11: - resolution: {integrity: sha512-sWJvAm+raRPeES9usNpZRkooeEB93lOpUN0Lmjz5vhVAb7XGIZrHEJ93155bpE1S0c4oJ5Di9ZWgzIwqhWP/Wg==} + /@changesets/changelog-git/0.1.12: + resolution: {integrity: sha512-Xv2CPjTBmwjl8l4ZyQ3xrsXZMq8WafPUpEonDpTmcb24XY8keVzt7ZSCJuDz035EiqrjmDKDhODoQ6XiHudlig==} dependencies: - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 dev: true - /@changesets/cli/2.23.0: - resolution: {integrity: sha512-Gi3tMi0Vr6eNd8GX6q73tbOm9XOzGfuLEm4PYVeWG2neg5DlRGNOjYwrFULJ/An3N9MHtHn4r5h1Qvnju9Ijug==} + /@changesets/cli/2.24.3: + resolution: {integrity: sha512-okhRV+0WCQJa2Kmil/WvN5TK1o3+1JYSjrsGHqhjv+PYcDgDDgQ6I9J9OMBO9lfmNIpN7xSO80/BzxgvReO4Wg==} hasBin: true dependencies: - '@babel/runtime': 7.18.6 - '@changesets/apply-release-plan': 6.0.0 - '@changesets/assemble-release-plan': 5.1.3 - '@changesets/changelog-git': 0.1.11 - '@changesets/config': 2.0.0 + '@babel/runtime': 7.18.9 + '@changesets/apply-release-plan': 6.0.4 + '@changesets/assemble-release-plan': 5.2.1 + '@changesets/changelog-git': 0.1.12 + '@changesets/config': 2.1.1 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.2 - '@changesets/get-release-plan': 3.0.9 - '@changesets/git': 1.3.2 + '@changesets/get-dependents-graph': 1.3.3 + '@changesets/get-release-plan': 3.0.14 + '@changesets/git': 1.4.1 '@changesets/logger': 0.0.5 - '@changesets/pre': 1.0.11 - '@changesets/read': 0.5.5 - '@changesets/types': 5.0.0 - '@changesets/write': 0.1.8 + '@changesets/pre': 1.0.12 + '@changesets/read': 0.5.7 + '@changesets/types': 5.1.0 + '@changesets/write': 0.1.9 '@manypkg/get-packages': 1.1.3 '@types/is-ci': 3.0.0 '@types/semver': 6.2.3 @@ -717,13 +716,13 @@ packages: tty-table: 4.1.6 dev: true - /@changesets/config/2.0.0: - resolution: {integrity: sha512-r5bIFY6CN3K6SQ+HZbjyE3HXrBIopONR47mmX7zUbORlybQXtympq9rVAOzc0Oflbap8QeIexc+hikfZoREXDg==} + /@changesets/config/2.1.1: + resolution: {integrity: sha512-nSRINMqHpdtBpNVT9Eh9HtmLhOwOTAeSbaqKM5pRmGfsvyaROTBXV84ujF9UsWNlV71YxFbxTbeZnwXSGQlyTw==} dependencies: '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.2 + '@changesets/get-dependents-graph': 1.3.3 '@changesets/logger': 0.0.5 - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.5 @@ -735,10 +734,10 @@ packages: extendable-error: 0.1.7 dev: true - /@changesets/get-dependents-graph/1.3.2: - resolution: {integrity: sha512-tsqA6qZRB86SQuApSoDvI8yEWdyIlo/WLI4NUEdhhxLMJ0dapdeT6rUZRgSZzK1X2nv5YwR0MxQBbDAiDibKrg==} + /@changesets/get-dependents-graph/1.3.3: + resolution: {integrity: sha512-h4fHEIt6X+zbxdcznt1e8QD7xgsXRAXd2qzLlyxoRDFSa6SxJrDAUyh7ZUNdhjBU4Byvp4+6acVWVgzmTy4UNQ==} dependencies: - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 @@ -754,15 +753,15 @@ packages: - encoding dev: true - /@changesets/get-release-plan/3.0.9: - resolution: {integrity: sha512-5C1r4DcOjVxcCvPmXpymeyT6mdSTLCNiB2L+5uf19BRkDKndJdIQorH5Fe2XBR2nHUcZQFT+2TXDzCepat969w==} + /@changesets/get-release-plan/3.0.14: + resolution: {integrity: sha512-xzSfeyIOvUnbqMuQXVKTYUizreWQfICwoQpvEHoePVbERLocc1tPo5lzR7dmVCFcaA/DcnbP6mxyioeq+JuzSg==} dependencies: - '@babel/runtime': 7.18.6 - '@changesets/assemble-release-plan': 5.1.3 - '@changesets/config': 2.0.0 - '@changesets/pre': 1.0.11 - '@changesets/read': 0.5.5 - '@changesets/types': 5.0.0 + '@babel/runtime': 7.18.9 + '@changesets/assemble-release-plan': 5.2.1 + '@changesets/config': 2.1.1 + '@changesets/pre': 1.0.12 + '@changesets/read': 0.5.7 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 dev: true @@ -770,12 +769,12 @@ packages: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} dev: true - /@changesets/git/1.3.2: - resolution: {integrity: sha512-p5UL+urAg0Nnpt70DLiBe2iSsMcDubTo9fTOD/61krmcJ466MGh71OHwdAwu1xG5+NKzeysdy1joRTg8CXcEXA==} + /@changesets/git/1.4.1: + resolution: {integrity: sha512-GWwRXEqBsQ3nEYcyvY/u2xUK86EKAevSoKV/IhELoZ13caZ1A1TSak/71vyKILtzuLnFPk5mepP5HjBxr7lZ9Q==} dependencies: - '@babel/runtime': 7.18.6 + '@babel/runtime': 7.18.9 '@changesets/errors': 0.1.4 - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 spawndamnit: 2.0.0 @@ -787,31 +786,31 @@ packages: chalk: 2.4.2 dev: true - /@changesets/parse/0.3.13: - resolution: {integrity: sha512-wh9Ifa0dungY6d2nMz6XxF6FZ/1I7j+mEgPAqrIyKS64nifTh1Ua82qKKMMK05CL7i4wiB2NYc3SfnnCX3RVeA==} + /@changesets/parse/0.3.14: + resolution: {integrity: sha512-SWnNVyC9vz61ueTbuxvA6b4HXcSx2iaWr2VEa37lPg1Vw+cEyQp7lOB219P7uow1xFfdtIEEsxbzXnqLAAaY8w==} dependencies: - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 js-yaml: 3.14.1 dev: true - /@changesets/pre/1.0.11: - resolution: {integrity: sha512-CXZnt4SV9waaC9cPLm7818+SxvLKIDHUxaiTXnJYDp1c56xIexx1BNfC1yMuOdzO2a3rAIcZua5Odxr3dwSKfg==} + /@changesets/pre/1.0.12: + resolution: {integrity: sha512-RFzWYBZx56MtgMesXjxx7ymyI829/rcIw/41hvz3VJPnY8mDscN7RJyYu7Xm7vts2Fcd+SRcO0T/Ws3I1/6J7g==} dependencies: - '@babel/runtime': 7.18.6 + '@babel/runtime': 7.18.9 '@changesets/errors': 0.1.4 - '@changesets/types': 5.0.0 + '@changesets/types': 5.1.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 dev: true - /@changesets/read/0.5.5: - resolution: {integrity: sha512-bzonrPWc29Tsjvgh+8CqJ0apQOwWim0zheeD4ZK44ApSa/GudnZJTODtA3yNOOuQzeZmL0NUebVoHIurtIkA7w==} + /@changesets/read/0.5.7: + resolution: {integrity: sha512-Iteg0ccTPpkJ+qFzY97k7qqdVE5Kz30TqPo9GibpBk2g8tcLFUqf+Qd0iXPLcyhUZpPL1U6Hia1gINHNKIKx4g==} dependencies: - '@babel/runtime': 7.18.6 - '@changesets/git': 1.3.2 + '@babel/runtime': 7.18.9 + '@changesets/git': 1.4.1 '@changesets/logger': 0.0.5 - '@changesets/parse': 0.3.13 - '@changesets/types': 5.0.0 + '@changesets/parse': 0.3.14 + '@changesets/types': 5.1.0 chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 @@ -821,15 +820,15 @@ packages: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} dev: true - /@changesets/types/5.0.0: - resolution: {integrity: sha512-IT1kBLSbAgTS4WtpU6P5ko054hq12vk4tgeIFRVE7Vnm4a/wgbNvBalgiKP0MjEXbCkZbItiGQHkCGxYWR55sA==} + /@changesets/types/5.1.0: + resolution: {integrity: sha512-uUByGATZCdaPkaO9JkBsgGDjEvHyY2Sb0e/J23+cwxBi5h0fxpLF/HObggO/Fw8T2nxK6zDfJbPsdQt5RwYFJA==} dev: true - /@changesets/write/0.1.8: - resolution: {integrity: sha512-oIHeFVMuP6jf0TPnKPpaFpvvAf3JBc+s2pmVChbeEgQTBTALoF51Z9kqxQfG4XONZPHZnqkmy564c7qohhhhTQ==} + /@changesets/write/0.1.9: + resolution: {integrity: sha512-E90ZrsrfJVOOQaP3Mm5Xd7uDwBAqq3z5paVEavTHKA8wxi7NAL8CmjgbGxSFuiP7ubnJA2BuHlrdE4z86voGOg==} dependencies: - '@babel/runtime': 7.18.6 - '@changesets/types': 5.0.0 + '@babel/runtime': 7.18.9 + '@changesets/types': 5.1.0 fs-extra: 7.0.1 human-id: 1.0.2 prettier: 1.19.1 @@ -873,29 +872,35 @@ packages: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.14 '@jridgewell/trace-mapping': 0.3.14 + dev: true /@jridgewell/resolve-uri/3.0.8: resolution: {integrity: sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w==} engines: {node: '>=6.0.0'} + dev: true /@jridgewell/set-array/1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} + dev: true /@jridgewell/source-map/0.3.2: resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} dependencies: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.14 + dev: true /@jridgewell/sourcemap-codec/1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true /@jridgewell/trace-mapping/0.3.14: resolution: {integrity: sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==} dependencies: '@jridgewell/resolve-uri': 3.0.8 '@jridgewell/sourcemap-codec': 1.4.14 + dev: true /@lukeed/csprng/1.0.1: resolution: {integrity: sha512-uSvJdwQU5nK+Vdf6zxcWAY2A8r7uqe+gePwLWzJ+fsQehq18pc0I2hJKwypZ2aLM90+Er9u1xn4iLJPZ+xlL4g==} @@ -912,7 +917,7 @@ packages: /@manypkg/find-root/1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.18.6 + '@babel/runtime': 7.18.9 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 @@ -921,7 +926,7 @@ packages: /@manypkg/get-packages/1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: - '@babel/runtime': 7.18.6 + '@babel/runtime': 7.18.9 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -1003,6 +1008,22 @@ packages: rollup: 2.75.7 dev: true + /@rollup/plugin-commonjs/22.0.2_rollup@2.78.1: + resolution: {integrity: sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==} + engines: {node: '>= 12.0.0'} + peerDependencies: + rollup: ^2.68.0 + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + commondir: 1.0.1 + estree-walker: 2.0.2 + glob: 7.2.3 + is-reference: 1.2.1 + magic-string: 0.25.9 + resolve: 1.22.1 + rollup: 2.78.1 + dev: true + /@rollup/plugin-json/4.1.0_rollup@2.75.7: resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: @@ -1012,6 +1033,15 @@ packages: rollup: 2.75.7 dev: true + /@rollup/plugin-json/4.1.0_rollup@2.78.1: + resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + rollup: 2.78.1 + dev: true + /@rollup/plugin-node-resolve/13.3.0_rollup@2.75.7: resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} @@ -1027,6 +1057,21 @@ packages: rollup: 2.75.7 dev: true + /@rollup/plugin-node-resolve/13.3.0_rollup@2.78.1: + resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} + engines: {node: '>= 10.0.0'} + peerDependencies: + rollup: ^2.42.0 + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@types/resolve': 1.17.1 + deepmerge: 4.2.2 + is-builtin-module: 3.1.0 + is-module: 1.0.0 + resolve: 1.22.0 + rollup: 2.78.1 + dev: true + /@rollup/pluginutils/3.1.0_rollup@2.75.7: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} @@ -1039,6 +1084,18 @@ packages: rollup: 2.75.7 dev: true + /@rollup/pluginutils/3.1.0_rollup@2.78.1: + resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.3.1 + rollup: 2.78.1 + dev: true + /@rollup/pluginutils/4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -1052,7 +1109,7 @@ packages: golden-fleece: 1.0.9 dev: true - /@sveltejs/vite-plugin-svelte/1.0.1_svelte@3.48.0+vite@3.0.9: + /@sveltejs/vite-plugin-svelte/1.0.1_svelte@3.49.0+vite@3.0.9: resolution: {integrity: sha512-PorCgUounn0VXcpeJu+hOweZODKmGuLHsLomwqSj+p26IwjjGffmYQfVHtiTWq+NqaUuuHWWG7vPge6UFw4Aeg==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -1068,9 +1125,9 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.26.2 - svelte: 3.48.0 - svelte-hmr: 0.14.12_svelte@3.48.0 - vite: 3.0.9_terser@5.14.2 + svelte: 3.49.0 + svelte-hmr: 0.14.12_svelte@3.49.0 + vite: 3.0.9 transitivePeerDependencies: - supports-color dev: false @@ -1099,8 +1156,8 @@ packages: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true - /@types/estree/0.0.52: - resolution: {integrity: sha512-BZWrtCU0bMVAIliIV+HJO1f1PR41M7NKjfxrFJwwhKI1KwhwOxYw1SXg9ao+CIMt774nFuGiG6eU+udtbEI9oQ==} + /@types/estree/1.0.0: + resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true /@types/gitignore-parser/0.0.0: @@ -1145,6 +1202,10 @@ packages: resolution: {integrity: sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==} dev: true + /@types/node/18.7.13: + resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} + dev: true + /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -1166,7 +1227,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 16.11.42 + '@types/node': 18.7.13 dev: true /@types/sade/1.7.4: @@ -1425,6 +1486,7 @@ packages: /buffer-from/1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true /buffer/5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} @@ -1620,6 +1682,7 @@ packages: /commander/2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true /commander/4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} @@ -1631,7 +1694,7 @@ packages: dev: true /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /console-clear/1.1.1: resolution: {integrity: sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==} @@ -1876,7 +1939,7 @@ packages: is-weakref: 1.0.2 object-inspect: 1.12.2 object-keys: 1.1.1 - object.assign: 4.1.2 + object.assign: 4.1.4 regexp.prototype.flags: 1.4.3 string.prototype.trimend: 1.0.5 string.prototype.trimstart: 1.0.5 @@ -2580,10 +2643,16 @@ packages: ci-info: 3.3.2 dev: true + /is-core-module/2.10.0: + resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} + dependencies: + has: 1.0.3 + /is-core-module/2.9.0: resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} dependencies: has: 1.0.3 + dev: true /is-date-object/1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} @@ -2650,7 +2719,7 @@ packages: /is-reference/1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: - '@types/estree': 0.0.52 + '@types/estree': 1.0.0 dev: true /is-regex/1.1.4: @@ -3130,8 +3199,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /object.assign/4.1.2: - resolution: {integrity: sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==} + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 @@ -3346,13 +3415,19 @@ packages: hasBin: true dev: true - /playwright/1.25.0: - resolution: {integrity: sha512-Z+pQNWI17Qx/tHhnmgMmPsptsisXpKgAnUvYv98kctlHUJaqMt2400P8kTw9vEPoC0xdxqu0JhxO7pDTmaaIKw==} + /playwright-core/1.25.1: + resolution: {integrity: sha512-lSvPCmA2n7LawD2Hw7gSCLScZ+vYRkhU8xH0AapMyzwN+ojoDqhkH/KIEUxwNu2PjPoE/fcE0wLAksdOhJ2O5g==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /playwright/1.25.1: + resolution: {integrity: sha512-kOlW7mllnQ70ALTwAor73q/FhdH9EEXLUqjdzqioYLcSVC4n4NBfDqeCikGuayFZrLECLkU6Hcbziy/szqTXSA==} engines: {node: '>=14'} hasBin: true requiresBuild: true dependencies: - playwright-core: 1.25.0 + playwright-core: 1.25.1 dev: true /polka/1.0.0-next.22: @@ -3611,7 +3686,7 @@ packages: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: - is-core-module: 2.9.0 + is-core-module: 2.10.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -3653,6 +3728,14 @@ packages: optionalDependencies: fsevents: 2.3.2 + /rollup/2.78.1: + resolution: {integrity: sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -3875,6 +3958,7 @@ packages: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + dev: true /source-map-url/0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} @@ -3884,6 +3968,7 @@ packages: /source-map/0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + dev: true /sourcemap-codec/1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} @@ -3899,7 +3984,7 @@ packages: resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.11 + spdx-license-ids: 3.0.12 dev: true /spdx-exceptions/2.3.0: @@ -3910,11 +3995,11 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.11 + spdx-license-ids: 3.0.12 dev: true - /spdx-license-ids/3.0.11: - resolution: {integrity: sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==} + /spdx-license-ids/3.0.12: + resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} dev: true /sprintf-js/1.0.3: @@ -4074,13 +4159,13 @@ packages: - sugarss dev: true - /svelte-hmr/0.14.12_svelte@3.48.0: + /svelte-hmr/0.14.12_svelte@3.49.0: resolution: {integrity: sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.48.0 + svelte: 3.49.0 dev: false /svelte-preprocess/4.10.7_lvfi2wesz6u4l5rfbnetbucfmm: @@ -4184,10 +4269,65 @@ packages: svelte: 3.48.0 dev: true + /svelte-preprocess/4.10.7_uslzfc62di2n2otc2tvfklnwji: + resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==} + engines: {node: '>= 9.11.2'} + requiresBuild: true + peerDependencies: + '@babel/core': ^7.10.2 + coffeescript: ^2.5.1 + less: ^3.11.3 || ^4.0.0 + node-sass: '*' + postcss: ^7 || ^8 + postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0 + pug: ^3.0.0 + sass: ^1.26.8 + stylus: ^0.55.0 + sugarss: ^2.0.0 + svelte: ^3.23.0 + typescript: ^3.9.5 || ^4.0.0 + peerDependenciesMeta: + '@babel/core': + optional: true + coffeescript: + optional: true + less: + optional: true + node-sass: + optional: true + postcss: + optional: true + postcss-load-config: + optional: true + pug: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + typescript: + optional: true + dependencies: + '@types/pug': 2.0.6 + '@types/sass': 1.43.1 + detect-indent: 6.1.0 + magic-string: 0.25.9 + sorcery: 0.10.0 + strip-indent: 3.0.0 + svelte: 3.49.0 + typescript: 4.7.4 + dev: true + /svelte/3.48.0: resolution: {integrity: sha512-fN2YRm/bGumvjUpu6yI3BpvZnpIm9I6A7HR4oUNYd7ggYyIwSA/BX7DJ+UXXffLp6XNcUijyLvttbPVCYa/3xQ==} engines: {node: '>= 8'} + /svelte/3.49.0: + resolution: {integrity: sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==} + engines: {node: '>= 8'} + /svelte2tsx/0.5.11_lvfi2wesz6u4l5rfbnetbucfmm: resolution: {integrity: sha512-Is95G1wqNvEUJZ9DITRS2zfMwVJRZztMduPs1vJJ0cm65WUg/avBl5vBXjHycQL/qmFpaqa3NG4qWnf7bCHPag==} peerDependencies: @@ -4250,6 +4390,7 @@ packages: acorn: 8.7.1 commander: 2.20.3 source-map-support: 0.5.21 + dev: true /test-exclude/6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} @@ -4344,137 +4485,137 @@ packages: safe-buffer: 5.2.1 dev: true - /turbo-android-arm64/1.3.4: - resolution: {integrity: sha512-rAbfiw5dT2rKV7L8XCL6nKwBxSz0TNknUT8F64pE+h3ESiT4y6Ow/hCdNxlb+hcee6lvZ8tB0cynXCVM5bthAA==} + /turbo-android-arm64/1.4.3: + resolution: {integrity: sha512-ZUvdoEHJkTkOFOO9PKWYrdONDBVqkNsvwEMufTVf07RXgqmbXDPkznzT4hcQm6xXyqWqJdjgSAMdlm+2nNE1Og==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /turbo-darwin-64/1.3.4: - resolution: {integrity: sha512-DZbRwVHH3nKOzVtijKWzkiKLLY+pBjawK90po7VRKMwdN2Db+JkWdu9+6wIqaxQ4WEYnYpwnTm0Aiyua0U/dNg==} + /turbo-darwin-64/1.4.3: + resolution: {integrity: sha512-gapoVm5qbu2TJS4lJ6fM3o2eAkLyXSxHihw/4NRAYmwHCH3at1/cIAnRcctB/HLL3ZaB/p3HKb8mnI7k6xNHOw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64/1.3.4: - resolution: {integrity: sha512-Qfe7iBad/XM4G22G0XAnEQnHiSUO1WR4MgvyHV022WABIf7CgGDsW6DUu/4DOWFlfTO+xCC0Qgu93w6Kli/9uw==} + /turbo-darwin-arm64/1.4.3: + resolution: {integrity: sha512-XUe6FTsHamEH7FfNslYYO04yecAaguhZuwW4kE9B/BAP8MUYsmVqONauLPyE/YqM6pf2K0xwVe+RlEGf53CWbg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-freebsd-64/1.3.4: - resolution: {integrity: sha512-lXFViR0fnoTRtnRtkeSA/10Q41h+fLgnYC62wzHNzPsq/kCYmiaXBg+gWRJom8Ka2nh+xWQdLG2Dh/uxK/+1Og==} + /turbo-freebsd-64/1.4.3: + resolution: {integrity: sha512-1CAjXmDClgMXdWZXreUfAbGBB2WB9TZHfJIdsgnDqt4fIcFGChknzYqc+Fj3tGHAczMpinGjBbWIzFuxOq/ofQ==} cpu: [x64] os: [freebsd] requiresBuild: true dev: true optional: true - /turbo-freebsd-arm64/1.3.4: - resolution: {integrity: sha512-VN9gPZcRaYhQOIo+NlIDIDNlJjhnyM7i+3WvWAK8y5p5GoZoDAahM36GDX05JNjVdPq95WJPnWcxoiQvwnctxg==} + /turbo-freebsd-arm64/1.4.3: + resolution: {integrity: sha512-j5C7j/vwabPKpr5d6YlLgHGHBZCOcXj3HdkBshDHTQ0wghH0NuCUUaesYxI3wva/4/Ec0dhIrb20Laa/HMxXLA==} cpu: [arm64] os: [freebsd] requiresBuild: true dev: true optional: true - /turbo-linux-32/1.3.4: - resolution: {integrity: sha512-h1oVx85jovYnAaP+KxSmFIPhlKFQmBwVkJBngALnHNU7HTN9+1t/VJ1WKjHEeLXrQ7ujeCMd/+TBm9XRd73RdA==} + /turbo-linux-32/1.4.3: + resolution: {integrity: sha512-vnc+StXIoQEnxIU43j7rEz/J+v+RV4dbUdUolBq0k9gkUV8KMCcqPkIa753K47E2KLNGKXMaYDI6AHQX1GAQZg==} cpu: [ia32] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-64/1.3.4: - resolution: {integrity: sha512-QJJeksggK9/s3VzS+iMTQh8gO6JLDxKBSc3qnpP1Kaq8hF+M1upfP9KhDFNguz8UEFlOvTblplNdqZdk/wtkXQ==} + /turbo-linux-64/1.4.3: + resolution: {integrity: sha512-KAUeIa8Ejt6BLrBGbVurlrjDxqh62tu75D4cqKqKfzWspcbEtmdqlV6qthXfm8SlzGSNuQXX0+qXEWds2FIZXg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm/1.3.4: - resolution: {integrity: sha512-vCVDcO4KNJak//UKsss/TnJw0ywYc8OyV88ZlSWyP3WtA+9D8DJNPOKodcR8IbKuV7Tqpr+f7cP+J9jGDkHjQw==} + /turbo-linux-arm/1.4.3: + resolution: {integrity: sha512-zZNoHUK5ioFyxAngh8tHe763Dzb22ne3LJkaZn0ExkFHJtWClWv536lPcDuQPpIH9W9iz5OwPKtN32DNpNwk8A==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64/1.3.4: - resolution: {integrity: sha512-SSyUvBxZmlS44LQ2hzX5gfDlQueH1Hx5/rFS9mJZKFdgMnAB2g7btxxEvnpm0lgpfP/c3LH0VRks3xYEoQvILg==} + /turbo-linux-arm64/1.4.3: + resolution: {integrity: sha512-rzB7w+RHCQkKr8aDxxozv/IzdN976CYyBiRocSf9QGU73uyAg8pCo3i0MiENSRjDC+tUbdbu2lEUwGXf9ziB9Q==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-mips64le/1.3.4: - resolution: {integrity: sha512-w7Ib7i/GZhyJRdvQSLA1Be7AOIPgJpuLLjrtT2gUl3wXd4JuiHDvhOS7E0B9izaxeD/2iygU2kQjqD4o9tejlw==} - cpu: [mips64el] + /turbo-linux-mips64le/1.4.3: + resolution: {integrity: sha512-Ztr1BM5NiUsHWjB7zpkP2RpRDA/fjbLaCbkyfyGlLmVkrSkh05NFBD03IWs2LSLy/wb6vRpL3MQ4FKcb97Tn8w==} + cpu: [mipsel] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-ppc64le/1.3.4: - resolution: {integrity: sha512-xATyouJSGmfgQM6lLk4Da5HrsAw8qoPUArrBuDK1p3Rw1gcRnmlJL10mr6ZmZyRu+3o4M8UlThfus5q8eETmBw==} + /turbo-linux-ppc64le/1.4.3: + resolution: {integrity: sha512-tJaFJWxwfy/iLd69VHZj6JcXy9hO8LQ+ZUOna/p/wiy5WrFVgEYlD+4gfECfRZ+52EIelMgXl97vACaN1WMhLw==} cpu: [ppc64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-32/1.3.4: - resolution: {integrity: sha512-1oXgiGxkWuC/7rlBZTng7qC2zjAZ7lYLDDh3ePAycZzp6BprlxqT5+xA0kFJo+WqGRdAQVhanlET2bLGOdBQBQ==} + /turbo-windows-32/1.4.3: + resolution: {integrity: sha512-w9LyYd+DW3PYFXu9vQiie5lfdqmVIKLV0h181C49hempkIXfgQAosXfaugYWDwBc0GEBoBIQB0vGQKE7gt5nzA==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-64/1.3.4: - resolution: {integrity: sha512-k7K/oC+399Gtwol42ALvt0espWmZZR7qlRwfgFS3BF4pEetxjGFJMXKNWUMDkOqsHhMxvLIiDbWPmY3fTIWL7g==} + /turbo-windows-64/1.4.3: + resolution: {integrity: sha512-qPCqemxxOrXyqqig3fVQozRkOwo5oJSsQ3FTZE5YlNu2NwwWvY1mC0X4WTZIDsbj4oHqr0riqC7RGKbjQm1IIQ==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64/1.3.4: - resolution: {integrity: sha512-jHBuTvQ3t/OElxn//kwHZR2mlPdmpcV7BZy+n18+wwx6ydGj5QDOrer7Dwk81YbA5KtOkp086Xpgr75T73wsSA==} + /turbo-windows-arm64/1.4.3: + resolution: {integrity: sha512-djnOOBjw33AnUx2SR6TMOpDr3nKLnVD+HcZvnQz70HyE331AKWjBoEE4rtUOteLAfViWAp3afbiljFSOnbU00Q==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo/1.3.4: - resolution: {integrity: sha512-MsjlfAL29leQaIMdHGnIpK6IKZA4HwSAwDSIoBAs9EAKfAXIsnjLoF50dKDnBlaq5d4aVmiHsT6RYVcTKhSgBQ==} + /turbo/1.4.3: + resolution: {integrity: sha512-g08eD2HdO/XW5xGHnXr0cXGiWnrgFBI6pN/3u0EOTeerKAsWIZU0ZrpSnl3whRtImeBB/gQu7Eu1waM2VOxzgw==} hasBin: true requiresBuild: true optionalDependencies: - turbo-android-arm64: 1.3.4 - turbo-darwin-64: 1.3.4 - turbo-darwin-arm64: 1.3.4 - turbo-freebsd-64: 1.3.4 - turbo-freebsd-arm64: 1.3.4 - turbo-linux-32: 1.3.4 - turbo-linux-64: 1.3.4 - turbo-linux-arm: 1.3.4 - turbo-linux-arm64: 1.3.4 - turbo-linux-mips64le: 1.3.4 - turbo-linux-ppc64le: 1.3.4 - turbo-windows-32: 1.3.4 - turbo-windows-64: 1.3.4 - turbo-windows-arm64: 1.3.4 + turbo-android-arm64: 1.4.3 + turbo-darwin-64: 1.4.3 + turbo-darwin-arm64: 1.4.3 + turbo-freebsd-64: 1.4.3 + turbo-freebsd-arm64: 1.4.3 + turbo-linux-32: 1.4.3 + turbo-linux-64: 1.4.3 + turbo-linux-arm: 1.4.3 + turbo-linux-arm64: 1.4.3 + turbo-linux-mips64le: 1.4.3 + turbo-linux-ppc64le: 1.4.3 + turbo-windows-32: 1.4.3 + turbo-windows-64: 1.4.3 + turbo-windows-arm64: 1.4.3 dev: true /type-fest/0.13.1: @@ -4607,7 +4748,6 @@ packages: rollup: 2.75.7 optionalDependencies: fsevents: 2.3.2 - dev: true /vite/3.0.9_terser@5.14.2: resolution: {integrity: sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==} @@ -4635,6 +4775,7 @@ packages: terser: 5.14.2 optionalDependencies: fsevents: 2.3.2 + dev: true /vscode-oniguruma/1.6.2: resolution: {integrity: sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==} @@ -4780,8 +4921,8 @@ packages: engines: {node: '>=10'} dev: true - /yargs-parser/21.0.1: - resolution: {integrity: sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==} + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} dev: true @@ -4831,7 +4972,7 @@ packages: require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 - yargs-parser: 21.0.1 + yargs-parser: 21.1.1 dev: true /yargs/8.0.2: From 01a7fc545bd21cfce485a5070463454cc0143f06 Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Wed, 24 Aug 2022 16:11:55 +0300 Subject: [PATCH 14/91] improve disable searching on legacy browsers --- .../src/lib/search/SearchBox.svelte | 47 ++++++++++--------- .../kit.svelte.dev/src/routes/+layout.svelte | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte b/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte index 6e0b28cfa8bb..d5b94bbeb57f 100644 --- a/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte +++ b/sites/kit.svelte.dev/src/lib/search/SearchBox.svelte @@ -20,34 +20,35 @@ let has_pending = false; onMount(async () => { - if ('serviceWorker' in navigator) { - worker = new SearchWorker(); + if (!('serviceWorker' in navigator)) { + console.warn("The search web worker can't be initialized in this platform, searching wouldn't work."); + return; + } - worker.addEventListener('message', (event) => { - const { type, payload } = event.data; + worker = new SearchWorker(); - if (type === 'ready') { - ready = true; - } + worker.addEventListener('message', (event) => { + const { type, payload } = event.data; - if (type === 'results') { - search = payload; - } + if (type === 'ready') { + ready = true; + } - if (type === 'recents') { - recent_searches = payload; - } - }); + if (type === 'results') { + search = payload; + } - worker.postMessage({ - type: 'init', - payload: { - origin: location.origin - } - }); - } else { - console.warn("The search web worker can't be initialized in this platform, searching wouldn't work."); - } + if (type === 'recents') { + recent_searches = payload; + } + }); + + worker.postMessage({ + type: 'init', + payload: { + origin: location.origin + } + }); }); afterNavigate(() => { diff --git a/sites/kit.svelte.dev/src/routes/+layout.svelte b/sites/kit.svelte.dev/src/routes/+layout.svelte index 5c7871032c88..4b1feaa4402d 100644 --- a/sites/kit.svelte.dev/src/routes/+layout.svelte +++ b/sites/kit.svelte.dev/src/routes/+layout.svelte @@ -16,7 +16,7 @@