From b0a3fa176633ffc0c9d8103f5908563dfe92d595 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Wed, 28 Jun 2023 23:56:40 +0200 Subject: [PATCH 01/11] fix: ensure createEventDispatcher and ActionReturn work with generic function types (#8872) fixes #8860 This contains a small but unfortunately unavoidable breaking change: If you used `never` to type that the second parameter of `createEventDispatcher` shouldn't be set or that the action accepts no parameters (which the docs recommended for a short time), then you need to change that to `null` and `undefined` respectively --- .changeset/long-humans-dress.md | 5 +++++ documentation/docs/05-misc/03-typescript.md | 2 +- .../docs/05-misc/04-v4-migration-guide.md | 6 +++--- .../svelte/src/runtime/action/public.d.ts | 17 +++++++-------- .../svelte/src/runtime/internal/public.d.ts | 10 ++++----- packages/svelte/test/types/actions.ts | 21 ++++++++----------- .../test/types/create-event-dispatcher.ts | 2 +- 7 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 .changeset/long-humans-dress.md diff --git a/.changeset/long-humans-dress.md b/.changeset/long-humans-dress.md new file mode 100644 index 0000000000..bc9cf8b40e --- /dev/null +++ b/.changeset/long-humans-dress.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: ensure `createEventDispatcher` and `ActionReturn` work with types from generic function parameters diff --git a/documentation/docs/05-misc/03-typescript.md b/documentation/docs/05-misc/03-typescript.md index 36378365fd..778e13ce37 100644 --- a/documentation/docs/05-misc/03-typescript.md +++ b/documentation/docs/05-misc/03-typescript.md @@ -96,7 +96,7 @@ Events can be typed with `createEventDispatcher`: import { createEventDispatcher } from 'svelte'; const dispatch = createEventDispatcher<{ - event: never; // does not accept a payload + event: null; // does not accept a payload type: string; // has a required string payload click: string | null; // has an optional string payload }>(); diff --git a/documentation/docs/05-misc/04-v4-migration-guide.md b/documentation/docs/05-misc/04-v4-migration-guide.md index 25faea67ce..7da5f3e118 100644 --- a/documentation/docs/05-misc/04-v4-migration-guide.md +++ b/documentation/docs/05-misc/04-v4-migration-guide.md @@ -36,7 +36,7 @@ import { createEventDispatcher } from 'svelte'; const dispatch = createEventDispatcher<{ optional: number | null; required: string; - noArgument: never; + noArgument: null; }>(); // Svelte version 3: @@ -50,10 +50,10 @@ dispatch('required'); // error, missing argument dispatch('noArgument', 'surprise'); // error, cannot pass an argument ``` -- `Action` and `ActionReturn` have a default parameter type of `never` now, which means you need to type the generic if you want to specify that this action receives a parameter. The migration script will migrate this automatically ([#7442](https://github.com/sveltejs/svelte/pull/7442)) +- `Action` and `ActionReturn` have a default parameter type of `undefined` now, which means you need to type the generic if you want to specify that this action receives a parameter. The migration script will migrate this automatically ([#7442](https://github.com/sveltejs/svelte/pull/7442)) ```diff --const action: Action = (node, params) => { .. } // this is now an error, as params is expected to not exist +-const action: Action = (node, params) => { .. } // this is now an error if you use params in any way +const action: Action = (node, params) => { .. } // params is of type string ``` diff --git a/packages/svelte/src/runtime/action/public.d.ts b/packages/svelte/src/runtime/action/public.d.ts index d52b8a726a..afd92e116d 100644 --- a/packages/svelte/src/runtime/action/public.d.ts +++ b/packages/svelte/src/runtime/action/public.d.ts @@ -1,8 +1,8 @@ /** * Actions can return an object containing the two properties defined in this interface. Both are optional. * - update: An action can have a parameter. This method will be called whenever that parameter changes, - * immediately after Svelte has applied updates to the markup. `ActionReturn` and `ActionReturn` both - * mean that the action accepts no parameters, which makes it illegal to set the `update` method. + * immediately after Svelte has applied updates to the markup. `ActionReturn` and `ActionReturn` both + * mean that the action accepts no parameters. * - destroy: Method that is called after the element is unmounted * * Additionally, you can specify which additional attributes and events the action enables on the applied element. @@ -27,10 +27,10 @@ * Docs: https://svelte.dev/docs/svelte-action */ export interface ActionReturn< - Parameter = never, + Parameter = undefined, Attributes extends Record = Record > { - update?: [Parameter] extends [never] ? never : (parameter: Parameter) => void; + update?: (parameter: Parameter) => void; destroy?: () => void; /** * ### DO NOT USE THIS @@ -50,7 +50,7 @@ export interface ActionReturn< * // ... * } * ``` - * `Action` and `Action` both signal that the action accepts no parameters. + * `Action` and `Action` both signal that the action accepts no parameters. * * You can return an object with methods `update` and `destroy` from the function and type which additional attributes and events it has. * See interface `ActionReturn` for more details. @@ -59,13 +59,11 @@ export interface ActionReturn< */ export interface Action< Element = HTMLElement, - Parameter = never, + Parameter = undefined, Attributes extends Record = Record > { ( - ...args: [Parameter] extends [never] - ? [node: Node] - : undefined extends Parameter + ...args: undefined extends Parameter ? [node: Node, parameter?: Parameter] : [node: Node, parameter: Parameter] ): void | ActionReturn; @@ -73,4 +71,3 @@ export interface Action< // Implementation notes: // - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode -// - [X] extends [never] is needed, X extends never would reduce the whole resulting type to never and not to one of the condition outcomes diff --git a/packages/svelte/src/runtime/internal/public.d.ts b/packages/svelte/src/runtime/internal/public.d.ts index 6eab766077..1f1011740d 100644 --- a/packages/svelte/src/runtime/internal/public.d.ts +++ b/packages/svelte/src/runtime/internal/public.d.ts @@ -80,14 +80,12 @@ export interface DispatchOptions { export interface EventDispatcher> { // Implementation notes: // - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode - // - [X] extends [never] is needed, X extends never would reduce the whole resulting type to never and not to one of the condition outcomes + // - | null | undefined is added for convenience, as they are equivalent for the custom event constructor (both result in a null detail) ( - ...args: [EventMap[Type]] extends [never] - ? [type: Type, parameter?: null | undefined, options?: DispatchOptions] - : null extends EventMap[Type] - ? [type: Type, parameter?: EventMap[Type], options?: DispatchOptions] + ...args: null extends EventMap[Type] + ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] : undefined extends EventMap[Type] - ? [type: Type, parameter?: EventMap[Type], options?: DispatchOptions] + ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] : [type: Type, parameter: EventMap[Type], options?: DispatchOptions] ): boolean; } diff --git a/packages/svelte/test/types/actions.ts b/packages/svelte/test/types/actions.ts index bc1225a8ca..da4e660a1a 100644 --- a/packages/svelte/test/types/actions.ts +++ b/packages/svelte/test/types/actions.ts @@ -1,4 +1,4 @@ -import type { Action, ActionReturn } from '$runtime/action'; +import type { Action, ActionReturn } from '$runtime/action/public'; // ---------------- Action @@ -65,30 +65,27 @@ const optional4: Action = (_node, _param?) => }; optional4; -const no: Action = (_node) => {}; +const no: Action = (_node) => {}; // @ts-expect-error second param no(null as any, true); no(null as any); // @ts-expect-error second param no(null as any, 'string'); -const no1: Action = (_node) => { +const no1: Action = (_node) => { return { destroy: () => {} }; }; no1; -// @ts-expect-error param given -const no2: Action = (_node, _param?) => {}; -no2; +const no2: Action = (_node, _param?) => {}; +no2(null as any); -// @ts-expect-error param given -const no3: Action = (_node, _param) => {}; +const no3: Action = (_node, _param) => {}; no3; -// @ts-expect-error update method given -const no4: Action = (_node) => { +const no4: Action = (_node) => { return { update: () => {}, destroy: () => {} @@ -106,7 +103,7 @@ requiredReturn; const optionalReturn: ActionReturn = { update: (p) => { p === true; - // @ts-expect-error could be undefined + // @ts-expect-error (only in strict mode) could be undefined p.toString(); } }; @@ -118,7 +115,7 @@ const invalidProperty: ActionReturn = { }; invalidProperty; -type Attributes = ActionReturn['$$_attributes']; +type Attributes = ActionReturn['$$_attributes']; const attributes: Attributes = { a: 'a' }; attributes; // @ts-expect-error wrong type diff --git a/packages/svelte/test/types/create-event-dispatcher.ts b/packages/svelte/test/types/create-event-dispatcher.ts index 31f06f71b5..f85196930b 100644 --- a/packages/svelte/test/types/create-event-dispatcher.ts +++ b/packages/svelte/test/types/create-event-dispatcher.ts @@ -1,7 +1,7 @@ import { createEventDispatcher } from '$runtime/internal/lifecycle'; const dispatch = createEventDispatcher<{ - loaded: never; + loaded: null; change: string; valid: boolean; optional: number | null; From 90860550ae33909bbd3a04e52ecaec5d754f5d21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Jun 2023 09:35:31 +0200 Subject: [PATCH 02/11] Version Packages (#8855) Co-authored-by: github-actions[bot] --- .changeset/eight-emus-allow.md | 5 ----- .changeset/long-humans-dress.md | 5 ----- .changeset/neat-feet-accept.md | 5 ----- .changeset/pretty-tools-whisper.md | 5 ----- .changeset/thick-trains-unite.md | 5 ----- packages/svelte/CHANGELOG.md | 20 ++++++++++++++++---- packages/svelte/package.json | 2 +- packages/svelte/src/shared/version.js | 2 +- 8 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 .changeset/eight-emus-allow.md delete mode 100644 .changeset/long-humans-dress.md delete mode 100644 .changeset/neat-feet-accept.md delete mode 100644 .changeset/pretty-tools-whisper.md delete mode 100644 .changeset/thick-trains-unite.md diff --git a/.changeset/eight-emus-allow.md b/.changeset/eight-emus-allow.md deleted file mode 100644 index 4c6e084391..0000000000 --- a/.changeset/eight-emus-allow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'svelte': patch ---- - -fix: ensure identifiers in destructuring contexts don't clash with existing ones diff --git a/.changeset/long-humans-dress.md b/.changeset/long-humans-dress.md deleted file mode 100644 index bc9cf8b40e..0000000000 --- a/.changeset/long-humans-dress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'svelte': patch ---- - -fix: ensure `createEventDispatcher` and `ActionReturn` work with types from generic function parameters diff --git a/.changeset/neat-feet-accept.md b/.changeset/neat-feet-accept.md deleted file mode 100644 index f045be3c2f..0000000000 --- a/.changeset/neat-feet-accept.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'svelte': patch ---- - -fix: apply transition to `` with local transition diff --git a/.changeset/pretty-tools-whisper.md b/.changeset/pretty-tools-whisper.md deleted file mode 100644 index 8af633242f..0000000000 --- a/.changeset/pretty-tools-whisper.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'svelte': patch ---- - -fix: relax a11y "no redundant role" rule for li, ul, ol diff --git a/.changeset/thick-trains-unite.md b/.changeset/thick-trains-unite.md deleted file mode 100644 index 18795469cd..0000000000 --- a/.changeset/thick-trains-unite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'svelte': patch ---- - -fix: remove tsconfig.json from published package diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md index ae461231a3..ffa517208d 100644 --- a/packages/svelte/CHANGELOG.md +++ b/packages/svelte/CHANGELOG.md @@ -1,5 +1,19 @@ # svelte +## 4.0.1 + +### Patch Changes + +- fix: ensure identifiers in destructuring contexts don't clash with existing ones ([#8840](https://github.com/sveltejs/svelte/pull/8840)) + +- fix: ensure `createEventDispatcher` and `ActionReturn` work with types from generic function parameters ([#8872](https://github.com/sveltejs/svelte/pull/8872)) + +- fix: apply transition to `` with local transition ([#8865](https://github.com/sveltejs/svelte/pull/8865)) + +- fix: relax a11y "no redundant role" rule for li, ul, ol ([#8867](https://github.com/sveltejs/svelte/pull/8867)) + +- fix: remove tsconfig.json from published package ([#8859](https://github.com/sveltejs/svelte/pull/8859)) + ## 4.0.0 ### Major Changes @@ -24,8 +38,8 @@ - breaking: Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7442](https://github.com/sveltejs/svelte/pull/7442)) -- breaking: Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions -(see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136)) +- breaking: Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions + (see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136)) - breaking: Overhaul and drastically improve creating custom elements with Svelte (see PR for list of changes and migration instructions) ([#8457](https://github.com/sveltejs/svelte/pull/8457)) @@ -49,7 +63,6 @@ ### Minor Changes - - Add a way to modify attributes for script/style preprocessors ([#8618](https://github.com/sveltejs/svelte/pull/8618)) - Improve hydration speed by adding `data-svelte-h` attribute to detect unchanged HTML elements ([#7426](https://github.com/sveltejs/svelte/pull/7426)) @@ -70,7 +83,6 @@ ### Patch Changes - - Bind `null` option and input values consistently ([#8312](https://github.com/sveltejs/svelte/issues/8312)) - Allow `$store` to be used with changing values including nullish values ([#7555](https://github.com/sveltejs/svelte/issues/7555)) diff --git a/packages/svelte/package.json b/packages/svelte/package.json index db67187f5f..22c457602d 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "4.0.0", + "version": "4.0.1", "description": "Cybernetically enhanced web apps", "type": "module", "module": "src/runtime/index.js", diff --git a/packages/svelte/src/shared/version.js b/packages/svelte/src/shared/version.js index 8ad21bf987..835c2fda5b 100644 --- a/packages/svelte/src/shared/version.js +++ b/packages/svelte/src/shared/version.js @@ -6,5 +6,5 @@ * https://svelte.dev/docs/svelte-compiler#svelte-version * @type {string} */ -export const VERSION = '4.0.0'; +export const VERSION = '4.0.1'; export const PUBLIC_VERSION = '4'; From 1de2144daee3dfec58169c41b9ece5148bd5bf88 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 29 Jun 2023 09:35:00 +0200 Subject: [PATCH 03/11] chore: tests for #8872 --- packages/svelte/test/types/actions.ts | 8 +++++++ .../test/types/create-event-dispatcher.ts | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/packages/svelte/test/types/actions.ts b/packages/svelte/test/types/actions.ts index da4e660a1a..2e5444481a 100644 --- a/packages/svelte/test/types/actions.ts +++ b/packages/svelte/test/types/actions.ts @@ -124,3 +124,11 @@ invalidAttributes1; // @ts-expect-error missing prop const invalidAttributes2: Attributes = {}; invalidAttributes2; + +function generic_action(_node: HTMLElement, param: T): ActionReturn { + return { + update: (p) => p === param, + destroy: () => {} + }; +} +generic_action; diff --git a/packages/svelte/test/types/create-event-dispatcher.ts b/packages/svelte/test/types/create-event-dispatcher.ts index f85196930b..296550dbfa 100644 --- a/packages/svelte/test/types/create-event-dispatcher.ts +++ b/packages/svelte/test/types/create-event-dispatcher.ts @@ -41,3 +41,24 @@ dispatch('optional', undefined, { cancelable: true }); dispatch('optional', 'string'); // @ts-expect-error: wrong type of option dispatch('optional', undefined, { cancelabled: true }); + +function generic_fn(t: T) { + const dispatch = createEventDispatcher<{ + required: T; + optional: T | null; + }>(); + + dispatch('required', t); + dispatch('optional', t); + dispatch('optional', null); + dispatch('optional', undefined); + // @ts-expect-error: wrong type of optional detail + dispatch('optional', 'string'); + // @ts-expect-error: wrong type of required detail + dispatch('required', 'string'); + // @ts-expect-error: wrong type of optional detail + dispatch('optional', true); + // @ts-expect-error: wrong type of required detail + dispatch('required', true); +} +generic_fn; From 270cfce065e47753011626412af6e39c84023356 Mon Sep 17 00:00:00 2001 From: L <6723574+louisgv@users.noreply.github.com> Date: Thu, 29 Jun 2023 05:42:00 -0400 Subject: [PATCH 04/11] chore: adding default for disclose version (#8874) --- .changeset/proud-cycles-hunt.md | 5 +++++ packages/svelte/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/proud-cycles-hunt.md diff --git a/.changeset/proud-cycles-hunt.md b/.changeset/proud-cycles-hunt.md new file mode 100644 index 0000000000..5f0f88cb69 --- /dev/null +++ b/.changeset/proud-cycles-hunt.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: align `disclose-version` exports specification diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 22c457602d..0b554d0efa 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -58,7 +58,7 @@ "default": "./src/runtime/store/index.js" }, "./internal/disclose-version": { - "import": "./src/runtime/internal/disclose-version/index.js" + "default": "./src/runtime/internal/disclose-version/index.js" }, "./transition": { "types": "./types/index.d.ts", From 678faf4f36757a678f6ef86ef9facb50635183fd Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Thu, 29 Jun 2023 17:04:57 +0530 Subject: [PATCH 05/11] chore(site): update deps --- pnpm-lock.yaml | 428 +++++++++++++++++++++++++++++----- sites/svelte.dev/package.json | 10 +- 2 files changed, 374 insertions(+), 64 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af127651c2..56d3238bb4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: version: 1.1.0 '@typescript-eslint/eslint-plugin': specifier: ^5.60.0 - version: 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3) + version: 5.60.0(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.6) eslint: specifier: ^8.43.0 version: 8.43.0 @@ -104,7 +104,7 @@ importers: version: 15.1.0(rollup@3.25.1) '@sveltejs/eslint-config': specifier: ^6.0.4 - version: 6.0.4(@typescript-eslint/eslint-plugin@5.60.0)(@typescript-eslint/parser@5.60.0)(eslint-config-prettier@8.8.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@47.0.0)(eslint@8.43.0)(typescript@5.1.3) + version: 6.0.4(@typescript-eslint/eslint-plugin@5.60.1)(@typescript-eslint/parser@5.60.1)(eslint-config-prettier@8.8.0)(eslint-plugin-svelte@2.32.0)(eslint-plugin-unicorn@47.0.0)(eslint@8.43.0)(typescript@5.1.3) '@types/aria-query': specifier: ^5.0.1 version: 5.0.1 @@ -157,8 +157,8 @@ importers: specifier: ^2.26.0 version: 2.26.0 '@sveltejs/repl': - specifier: 0.5.0-next.7 - version: 0.5.0-next.7(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.20.5)(svelte@packages+svelte) + specifier: 0.5.0-next.8 + version: 0.5.0-next.8(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.21.0)(svelte@packages+svelte) cookie: specifier: ^0.5.0 version: 0.5.0 @@ -180,10 +180,10 @@ importers: version: 2.4.1 '@sveltejs/adapter-vercel': specifier: ^3.0.1 - version: 3.0.1(@sveltejs/kit@1.20.5) + version: 3.0.1(@sveltejs/kit@1.21.0) '@sveltejs/kit': - specifier: ^1.20.5 - version: 1.20.5(svelte@packages+svelte)(vite@4.3.9) + specifier: ^1.21.0 + version: 1.21.0(svelte@packages+svelte)(vite@4.3.9) '@sveltejs/site-kit': specifier: 6.0.0-next.18 version: 6.0.0-next.18(@sveltejs/kit@1.20.5)(svelte@packages+svelte) @@ -194,8 +194,8 @@ importers: specifier: ^5.0.0 version: 5.0.0 '@types/node': - specifier: ^20.3.1 - version: 20.3.1 + specifier: ^20.3.2 + version: 20.3.2 '@types/prettier': specifier: ^2.7.3 version: 2.7.3 @@ -236,11 +236,11 @@ importers: specifier: ^0.8.5 version: 0.8.5 shiki: - specifier: ^0.14.2 - version: 0.14.2 + specifier: ^0.14.3 + version: 0.14.3 shiki-twoslash: specifier: ^3.1.2 - version: 3.1.2(typescript@5.1.3) + version: 3.1.2(typescript@5.1.6) svelte: specifier: workspace:* version: link:../../packages/svelte @@ -249,16 +249,16 @@ importers: version: 3.4.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte) svelte-preprocess: specifier: ^5.0.4 - version: 5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.3) + version: 5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.6) tiny-glob: specifier: ^0.2.9 version: 0.2.9 typescript: - specifier: ^5.1.3 - version: 5.1.3 + specifier: ^5.1.6 + version: 5.1.6 vite: specifier: ^4.3.9 - version: 4.3.9(@types/node@20.3.1)(sass@1.63.6) + version: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vite-imagetools: specifier: ^5.0.4 version: 5.0.4 @@ -1690,12 +1690,12 @@ packages: - supports-color dev: false - /@sveltejs/adapter-vercel@3.0.1(@sveltejs/kit@1.20.5): + /@sveltejs/adapter-vercel@3.0.1(@sveltejs/kit@1.21.0): resolution: {integrity: sha512-PBY3YRm7Q7Prax07mxD/rvcho2CntGkYncAIkz2DtG5NTcVG5JZ1RM627it5zYYtc2/RB3YjMkZuCMBqDCiPkA==} peerDependencies: '@sveltejs/kit': ^1.5.0 dependencies: - '@sveltejs/kit': 1.20.5(svelte@packages+svelte)(vite@4.3.9) + '@sveltejs/kit': 1.21.0(svelte@packages+svelte)(vite@4.3.9) '@vercel/nft': 0.22.6 esbuild: 0.17.19 transitivePeerDependencies: @@ -1703,7 +1703,7 @@ packages: - supports-color dev: true - /@sveltejs/eslint-config@6.0.4(@typescript-eslint/eslint-plugin@5.60.0)(@typescript-eslint/parser@5.60.0)(eslint-config-prettier@8.8.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@47.0.0)(eslint@8.43.0)(typescript@5.1.3): + /@sveltejs/eslint-config@6.0.4(@typescript-eslint/eslint-plugin@5.60.1)(@typescript-eslint/parser@5.60.1)(eslint-config-prettier@8.8.0)(eslint-plugin-svelte@2.32.0)(eslint-plugin-unicorn@47.0.0)(eslint@8.43.0)(typescript@5.1.3): resolution: {integrity: sha512-U9pwmDs+DbmsnCgTfu6Bacdwqn0DuI1IQNSiQqTgzVyYfaaj+zy9ZoQCiJfxFBGXHkklyXuRHp0KMx346N0lcQ==} peerDependencies: '@typescript-eslint/eslint-plugin': '>= 5' @@ -1714,11 +1714,11 @@ packages: eslint-plugin-unicorn: '>= 47' typescript: '>= 4' dependencies: - '@typescript-eslint/eslint-plugin': 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3) - '@typescript-eslint/parser': 5.60.0(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/eslint-plugin': 5.60.1(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.60.1(eslint@8.43.0)(typescript@5.1.3) eslint: 8.43.0 eslint-config-prettier: 8.8.0(eslint@8.43.0) - eslint-plugin-svelte: 2.31.0(eslint@8.43.0)(svelte@packages+svelte) + eslint-plugin-svelte: 2.32.0(eslint@8.43.0)(svelte@packages+svelte) eslint-plugin-unicorn: 47.0.0(eslint@8.43.0) typescript: 5.1.3 dev: true @@ -1748,9 +1748,36 @@ packages: vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) transitivePeerDependencies: - supports-color + dev: true - /@sveltejs/repl@0.5.0-next.7(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.20.5)(svelte@packages+svelte): - resolution: {integrity: sha512-A3xz9rAyPmCnb63AvK7zl4xDB7rFPapQh5IJyoWdFqdCp/j9jxAN9S/PN9V4DqpakNfLyb+zr12Gf4GAV4sWjA==} + /@sveltejs/kit@1.21.0(svelte@packages+svelte)(vite@4.3.9): + resolution: {integrity: sha512-CBsYoI34SjtOQp0eG85dmVnvTR3Pjs8VgAQhO0CgQja9BIorKl808F1X8EunPhCcyek5r5lKQE1Mmbi0RuzHqA==} + engines: {node: ^16.14 || >=18} + hasBin: true + requiresBuild: true + peerDependencies: + svelte: ^3.54.0 || ^4.0.0-next.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte': 2.4.2(svelte@packages+svelte)(vite@4.3.9) + '@types/cookie': 0.5.1 + cookie: 0.5.0 + devalue: 4.3.2 + esm-env: 1.0.0 + kleur: 4.1.5 + magic-string: 0.30.0 + mime: 3.0.0 + sade: 1.8.1 + set-cookie-parser: 2.6.0 + sirv: 2.0.3 + svelte: link:packages/svelte + undici: 5.22.1 + vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) + transitivePeerDependencies: + - supports-color + + /@sveltejs/repl@0.5.0-next.8(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.21.0)(svelte@packages+svelte): + resolution: {integrity: sha512-kEEXAqukfFRIrjnO8Hur/h+bys+Krv36dR29jp4uomXDRNTI/IXHvsAL6HcBwykKH9tVm+yiJzFaPaiC9Ggx2g==} peerDependencies: svelte: ^3.54.0 || ^4.0.0-next.0 || ^4.0.0 dependencies: @@ -1770,7 +1797,7 @@ packages: '@replit/codemirror-lang-svelte': 6.0.0(@codemirror/autocomplete@6.8.1)(@codemirror/lang-css@6.2.0)(@codemirror/lang-html@6.4.5)(@codemirror/lang-javascript@6.1.9)(@codemirror/language@6.8.0)(@codemirror/state@6.2.1)(@codemirror/view@6.14.0)(@lezer/common@1.0.3)(@lezer/highlight@1.1.6)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7) '@rich_harris/svelte-split-pane': 1.1.1(svelte@packages+svelte) '@rollup/browser': 3.25.3 - '@sveltejs/site-kit': 5.2.2(@sveltejs/kit@1.20.5)(svelte@packages+svelte) + '@sveltejs/site-kit': 5.2.2(@sveltejs/kit@1.21.0)(svelte@packages+svelte) acorn: 8.9.0 codemirror: 6.0.1(@lezer/common@1.0.3) esm-env: 1.0.0 @@ -1788,13 +1815,13 @@ packages: - '@sveltejs/kit' dev: false - /@sveltejs/site-kit@5.2.2(@sveltejs/kit@1.20.5)(svelte@packages+svelte): + /@sveltejs/site-kit@5.2.2(@sveltejs/kit@1.21.0)(svelte@packages+svelte): resolution: {integrity: sha512-XLLxVUV/dYytCsUeODAkjtzlaIBSn1kdcH5U36OuN7gMsPEHDy5L/dsWjf1/vDln3JStH5lqZPEN8Fovm33KhA==} peerDependencies: '@sveltejs/kit': ^1.0.0 svelte: ^3.54.0 dependencies: - '@sveltejs/kit': 1.20.5(svelte@packages+svelte)(vite@4.3.9) + '@sveltejs/kit': 1.21.0(svelte@packages+svelte)(vite@4.3.9) esm-env: 1.0.0 svelte: link:packages/svelte svelte-local-storage-store: 0.4.0(svelte@packages+svelte) @@ -1823,7 +1850,7 @@ packages: '@sveltejs/vite-plugin-svelte': 2.4.2(svelte@packages+svelte)(vite@4.3.9) debug: 4.3.4 svelte: link:packages/svelte - vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) + vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) transitivePeerDependencies: - supports-color @@ -1841,7 +1868,7 @@ packages: magic-string: 0.30.0 svelte: link:packages/svelte svelte-hmr: 0.15.2(svelte@packages+svelte) - vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) + vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vitefu: 0.2.4(vite@4.3.9) transitivePeerDependencies: - supports-color @@ -1917,6 +1944,10 @@ packages: /@types/node@20.3.1: resolution: {integrity: sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==} + dev: true + + /@types/node@20.3.2: + resolution: {integrity: sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==} /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -1949,10 +1980,10 @@ packages: /@types/websocket@1.0.5: resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==} dependencies: - '@types/node': 20.3.1 + '@types/node': 20.3.2 dev: false - /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3): + /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1964,10 +1995,38 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.60.0(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.60.1(eslint@8.43.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/type-utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/type-utils': 5.60.0(eslint@8.43.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.6) + debug: 4.3.4 + eslint: 8.43.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + natural-compare-lite: 1.4.0 + semver: 7.5.3 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.3): + resolution: {integrity: sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.5.1 + '@typescript-eslint/parser': 5.60.1(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/type-utils': 5.60.1(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/utils': 5.60.1(eslint@8.43.0)(typescript@5.1.3) debug: 4.3.4 eslint: 8.43.0 grapheme-splitter: 1.0.4 @@ -1980,8 +2039,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@5.60.0(eslint@8.43.0)(typescript@5.1.3): - resolution: {integrity: sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==} + /@typescript-eslint/parser@5.60.1(eslint@8.43.0)(typescript@5.1.3): + resolution: {integrity: sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1990,9 +2049,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3) + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.3) debug: 4.3.4 eslint: 8.43.0 typescript: 5.1.3 @@ -2000,6 +2059,26 @@ packages: - supports-color dev: true + /@typescript-eslint/parser@5.60.1(eslint@8.43.0)(typescript@5.1.6): + resolution: {integrity: sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.6) + debug: 4.3.4 + eslint: 8.43.0 + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager@5.60.0: resolution: {integrity: sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2008,7 +2087,15 @@ packages: '@typescript-eslint/visitor-keys': 5.60.0 dev: true - /@typescript-eslint/type-utils@5.60.0(eslint@8.43.0)(typescript@5.1.3): + /@typescript-eslint/scope-manager@5.60.1: + resolution: {integrity: sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + dev: true + + /@typescript-eslint/type-utils@5.60.0(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2018,8 +2105,28 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3) - '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.6) + '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.6) + debug: 4.3.4 + eslint: 8.43.0 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/type-utils@5.60.1(eslint@8.43.0)(typescript@5.1.3): + resolution: {integrity: sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.3) + '@typescript-eslint/utils': 5.60.1(eslint@8.43.0)(typescript@5.1.3) debug: 4.3.4 eslint: 8.43.0 tsutils: 3.21.0(typescript@5.1.3) @@ -2033,7 +2140,12 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.60.0(typescript@5.1.3): + /@typescript-eslint/types@5.60.1: + resolution: {integrity: sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.60.0(typescript@5.1.6): resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2048,13 +2160,55 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.3 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.1.3): + resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.3 tsutils: 3.21.0(typescript@5.1.3) typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.60.0(eslint@8.43.0)(typescript@5.1.3): + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.1.6): + resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/visitor-keys': 5.60.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.3 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@5.60.0(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2065,7 +2219,27 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.60.0 '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.6) + eslint: 8.43.0 + eslint-scope: 5.1.1 + semver: 7.5.3 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/utils@5.60.1(eslint@8.43.0)(typescript@5.1.3): + resolution: {integrity: sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.43.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.0 + '@typescript-eslint/scope-manager': 5.60.1 + '@typescript-eslint/types': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.3) eslint: 8.43.0 eslint-scope: 5.1.1 semver: 7.5.3 @@ -2082,6 +2256,14 @@ packages: eslint-visitor-keys: 3.4.1 dev: true + /@typescript-eslint/visitor-keys@5.60.1: + resolution: {integrity: sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.60.1 + eslint-visitor-keys: 3.4.1 + dev: true + /@typescript/twoslash@3.1.0: resolution: {integrity: sha512-kTwMUQ8xtAZaC4wb2XuLkPqFVBj2dNBueMQ89NWEuw87k2nLBbuafeG5cob/QEr6YduxIdTVUjix0MtC7mPlmg==} dependencies: @@ -3206,6 +3388,34 @@ packages: - ts-node dev: true + /eslint-plugin-svelte@2.32.0(eslint@8.43.0)(svelte@packages+svelte): + resolution: {integrity: sha512-q8uxR4wFmAkb+RX2qIJIO+xAjecInZuGYXbXOvpxMwv7Y5oQrq5WOkiYwLqPZk6p1L5UmSr54duloKiBucDL7A==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0-0 + svelte: ^3.37.0 || ^4.0.0 + peerDependenciesMeta: + svelte: + optional: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.43.0) + '@jridgewell/sourcemap-codec': 1.4.15 + debug: 4.3.4 + eslint: 8.43.0 + esutils: 2.0.3 + known-css-properties: 0.27.0 + postcss: 8.4.24 + postcss-load-config: 3.1.4(postcss@8.4.24) + postcss-safe-parser: 6.0.0(postcss@8.4.24) + postcss-selector-parser: 6.0.13 + semver: 7.5.3 + svelte: link:packages/svelte + svelte-eslint-parser: 0.32.0(svelte@packages+svelte) + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /eslint-plugin-unicorn@47.0.0(eslint@8.43.0): resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==} engines: {node: '>=16'} @@ -5471,7 +5681,7 @@ packages: rechoir: 0.6.2 dev: true - /shiki-twoslash@3.1.2(typescript@5.1.3): + /shiki-twoslash@3.1.2(typescript@5.1.6): resolution: {integrity: sha512-JBcRIIizi+exIA/OUhYkV6jtyeZco0ykCkIRd5sgwIt1Pm4pz+maoaRZpm6SkhPwvif4fCA7xOtJOykhpIV64Q==} peerDependencies: typescript: '>3' @@ -5480,7 +5690,7 @@ packages: '@typescript/vfs': 1.3.4 fenceparser: 1.1.1 shiki: 0.10.1 - typescript: 5.1.3 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -5493,8 +5703,8 @@ packages: vscode-textmate: 5.2.0 dev: true - /shiki@0.14.2: - resolution: {integrity: sha512-ltSZlSLOuSY0M0Y75KA+ieRaZ0Trf5Wl3gutE7jzLuIcWxLp5i/uEnLoQWNvgKXQ5OMpGkJnVMRLAuzjc0LJ2A==} + /shiki@0.14.3: + resolution: {integrity: sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==} dependencies: ansi-sequence-parser: 1.1.0 jsonc-parser: 3.2.0 @@ -5762,8 +5972,8 @@ packages: picocolors: 1.0.0 sade: 1.8.1 svelte: link:packages/svelte - svelte-preprocess: 5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.3) - typescript: 5.1.3 + svelte-preprocess: 5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - '@babel/core' - coffeescript @@ -5793,6 +6003,23 @@ packages: svelte: link:packages/svelte dev: true + /svelte-eslint-parser@0.32.0(svelte@packages+svelte): + resolution: {integrity: sha512-Q8Nh3GHHoWZMv3Ej4zw+3+gyWPR8I5pPTJXEOvW+JOgwhGXqGKh7mOKNlVcEPtk+PCGiK9TPaRtvRkKoJR327A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + svelte: ^3.37.0 || ^4.0.0 + peerDependenciesMeta: + svelte: + optional: true + dependencies: + eslint-scope: 7.2.0 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + postcss: 8.4.24 + postcss-scss: 4.0.6(postcss@8.4.24) + svelte: link:packages/svelte + dev: true + /svelte-hmr@0.15.2(svelte@packages+svelte): resolution: {integrity: sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==} engines: {node: ^12.20 || ^14.13.1 || >= 16} @@ -5823,7 +6050,7 @@ packages: svelte: link:packages/svelte dev: true - /svelte-preprocess@5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.3): + /svelte-preprocess@5.0.4(postcss@8.4.24)(sass@1.63.6)(svelte@packages+svelte)(typescript@5.1.6): resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} engines: {node: '>= 14.10.0'} requiresBuild: true @@ -5869,7 +6096,7 @@ packages: sorcery: 0.11.0 strip-indent: 3.0.0 svelte: link:packages/svelte - typescript: 5.1.3 + typescript: 5.1.6 dev: true /symbol-tree@3.2.4: @@ -6028,6 +6255,16 @@ packages: typescript: 5.1.3 dev: true + /tsutils@3.21.0(typescript@5.1.6): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 5.1.6 + dev: true + /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} @@ -6115,6 +6352,12 @@ packages: hasBin: true dev: true + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /ufo@1.1.2: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true @@ -6203,7 +6446,7 @@ packages: - rollup dev: true - /vite-node@0.31.4(@types/node@20.3.1): + /vite-node@0.31.4(@types/node@14.18.51): resolution: {integrity: sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6213,7 +6456,7 @@ packages: mlly: 1.4.0 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) + vite: 4.3.9(@types/node@14.18.51) transitivePeerDependencies: - '@types/node' - less @@ -6224,6 +6467,39 @@ packages: - terser dev: true + /vite@4.3.9(@types/node@14.18.51): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 14.18.51 + esbuild: 0.17.19 + postcss: 8.4.24 + rollup: 3.25.1 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /vite@4.3.9(@types/node@20.3.1)(sass@1.63.6): resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6256,6 +6532,40 @@ packages: sass: 1.63.6 optionalDependencies: fsevents: 2.3.2 + dev: true + + /vite@4.3.9(@types/node@20.3.2)(sass@1.63.6): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.3.2 + esbuild: 0.17.19 + postcss: 8.4.24 + rollup: 3.25.1 + sass: 1.63.6 + optionalDependencies: + fsevents: 2.3.2 /vitefu@0.2.4(vite@4.3.9): resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} @@ -6265,7 +6575,7 @@ packages: vite: optional: true dependencies: - vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) + vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) /vitest@0.31.4(happy-dom@9.20.3)(jsdom@21.1.2)(playwright@1.35.1): resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} @@ -6300,7 +6610,7 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 20.3.1 + '@types/node': 14.18.51 '@vitest/expect': 0.31.4 '@vitest/runner': 0.31.4 '@vitest/snapshot': 0.31.4 @@ -6323,8 +6633,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.3.9(@types/node@20.3.1)(sass@1.63.6) - vite-node: 0.31.4(@types/node@20.3.1) + vite: 4.3.9(@types/node@14.18.51) + vite-node: 0.31.4(@types/node@14.18.51) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/sites/svelte.dev/package.json b/sites/svelte.dev/package.json index 83bf612472..5ce7aca6ad 100644 --- a/sites/svelte.dev/package.json +++ b/sites/svelte.dev/package.json @@ -19,7 +19,7 @@ "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15", "@supabase/supabase-js": "^2.26.0", - "@sveltejs/repl": "0.5.0-next.7", + "@sveltejs/repl": "0.5.0-next.8", "cookie": "^0.5.0", "devalue": "^4.3.2", "do-not-zip": "^1.0.0", @@ -29,11 +29,11 @@ "devDependencies": { "@resvg/resvg-js": "^2.4.1", "@sveltejs/adapter-vercel": "^3.0.1", - "@sveltejs/kit": "^1.20.5", + "@sveltejs/kit": "^1.21.0", "@sveltejs/site-kit": "6.0.0-next.18", "@sveltejs/vite-plugin-svelte": "^2.4.2", "@types/marked": "^5.0.0", - "@types/node": "^20.3.1", + "@types/node": "^20.3.2", "@types/prettier": "^2.7.3", "degit": "^2.8.4", "dotenv": "^16.3.1", @@ -47,13 +47,13 @@ "satori": "^0.10.1", "satori-html": "^0.3.2", "shelljs": "^0.8.5", - "shiki": "^0.14.2", + "shiki": "^0.14.3", "shiki-twoslash": "^3.1.2", "svelte": "workspace:*", "svelte-check": "^3.4.4", "svelte-preprocess": "^5.0.4", "tiny-glob": "^0.2.9", - "typescript": "^5.1.3", + "typescript": "^5.1.6", "vite": "^4.3.9", "vite-imagetools": "^5.0.4" } From 867806f983364708d8ad52c9126c4c0c3099413a Mon Sep 17 00:00:00 2001 From: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:34:38 +0545 Subject: [PATCH 06/11] chore: fix site deploys (#8878) force Vercel to rebuild sharp everytime - it's prone to breaking at some point and we'd have to clear the cache --- sites/svelte.dev/vercel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/svelte.dev/vercel.json b/sites/svelte.dev/vercel.json index f7c95d1eda..03d3178382 100644 --- a/sites/svelte.dev/vercel.json +++ b/sites/svelte.dev/vercel.json @@ -3,5 +3,5 @@ "github": { "silent": true }, - "buildCommand": "cd ../../packages/svelte && pnpm prepublishOnly && cd ../../sites/svelte.dev && pnpm build" -} \ No newline at end of file + "buildCommand": "cd ../../packages/svelte && pnpm prepublishOnly && cd ../../sites/svelte.dev && pnpm rebuild sharp && pnpm build" +} From d3d1fb563f6bfc77863b4fdc41aa6710762a7236 Mon Sep 17 00:00:00 2001 From: Puru Vijay <47742487+PuruVJ@users.noreply.github.com> Date: Thu, 29 Jun 2023 22:59:47 +0530 Subject: [PATCH 07/11] blog: post about svelte.dev overhaul (#8766) Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> --- .../blog/2023-06-29-svelte-dev-overhaul.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 documentation/blog/2023-06-29-svelte-dev-overhaul.md diff --git a/documentation/blog/2023-06-29-svelte-dev-overhaul.md b/documentation/blog/2023-06-29-svelte-dev-overhaul.md new file mode 100644 index 0000000000..b7782abcc2 --- /dev/null +++ b/documentation/blog/2023-06-29-svelte-dev-overhaul.md @@ -0,0 +1,96 @@ +--- +title: 'svelte.dev: A complete overhaul' +description: 'The new site comes with accessibility fixes, new features and bottom navbar' +author: Puru Vijay +authorURL: https://puruvj.dev +--- + +When the initial version of Svelte v3 was released four years ago, it included the single-page documentation that folks have been familiar with. That documentation structure had stayed the same as Svelte's API surface increased steadily and more details were added. As a result, the single page got larger and larger to the point where it was becoming difficult to find things. The community had been asking for a revamp, and now it's here! + +Meet the new [svelte.dev](https://svelte.dev) — a complete overhaul of the old website. + +## Multi-page docs + +The table of contents had grown to be quite large and you had to scroll across half a dozen screens to see the whole thing. We heard you! The docs are all split up into multiple pages now and all pages list their sections in the righthand sidebar. + +All modules exposed by Svelte are also listed in the sidebar under the `Runtime` section: + +- [svelte](/docs/svelte) +- [svelte/store](/docs/svelte-store) +- [svelte/motion](/docs/svelte-motion) +- [svelte/transition](/docs/svelte-transition) +- [svelte/animate](/docs/svelte-animate) +- [svelte/easing](/docs/svelte-easing) +- [svelte/action](/docs/svelte-action) + +> [svelte/compiler](/docs/svelte-compiler) is under **Compiler and API** section + +We've also taken extra care to ensure that all the links from the old website will be redirected to the correct new page. + +## Search + +The lack of search functionality could make finding stuff a nuisance as Ctrl+F only returns results in order of occurrence and not order of importance. While Ctrl+F did have its benefits such as not requiring JS, now that the site has multiple pages, it's not an option anymore. + +And for that, the new website comes with a search bar, which searches through the docs and the API surface. Hit Ctrl+K (or CMD+F for Mac users) and start searching — it even works without JavaScript! + +## Lights, TypeScript, Action! + +The new website comes with a JavaScript / TypeScript toggle, so you can view the docs in your preferred flavour. Every module's exported types are listed at the bottom of the page for easy reference. The types are automatically generated from Svelte's source code, so they're always up to date. + +All the JavaScript and TypeScript code snippets have type hints available. Just hover over the variable to see its type. This allows the docs to be type checked at build time, which ensures they're never out of date. + +We also (finally!) added documentation for [Actions](/docs/svelte-action). Svelte Actions are a way to interact with the DOM, and are a great way to add interactivity to your app. The docs for Actions are also available in TypeScript. + +```svelte + + +
+``` + +## Dark mode + +After many years of users asking for dark mode on the website so they can read the docs for their night-time coding sessions, we finally added it! The website now has a dark mode toggle, which is also synced with your OS's dark mode settings. It can be toggled from the top navbar (bottom navbar on mobile). + +## Updated REPL + +The REPL has been rewritten from scratch to be fully typesafe and comes with features like dark mode. It was reimplemented to upgrade to CodeMirror 6 which comes with many accessibility improvements, multi-select mode, performance improvements, tree-shaking, and many more features. + +## Redesigned homepage + +Is it a website redesign if the homepage doesn't get the same amount of love? 🙃 + +The homepage has also been updated to align with [kit.svelte.dev](https://kit.svelte.dev) and features the beautiful Svelte Machine by [@vedam](https://github.com/vedam). + +## Bottom navigation! + +We sent out a [tweet](https://twitter.com/Rich_Harris/status/1664712880791404546) about experimenting with bottom navigation bar on mobile rather than the conventional top navbar. The response was overwhelmingly positive, so we went ahead and added it! This makes it easier to navigate the website on mobile with just one hand. We also made sure that you'll get to where you want with as few interactions as possible. If you're in the docs section of the site, you'll likely want to browse other documentation pages, which is why the navbar will show these by default when opening it with the option to go one level up to the general site navigation. + +If you're on mobile, you can already see it at the bottom. If you're on desktop, you can see it by resizing your browser window to a smaller size. + +## Unification of Svelte websites + +Now [svelte.dev](https://svelte.dev), [kit.svelte.dev](https://kit.svelte.dev), and [learn.svelte.dev](https://learn.svelte.dev) all use the same design system and are more consistent with each other. This makes it easier to navigate between the websites and also makes it easier to maintain them. We have a package shared across the sites called `@sveltejs/site-kit`, which went through rigorous changes over last 4 months as we have been moving all common code into this package. + +For example, we implemented the dark mode toggle in `@sveltejs/site-kit`. We then simply updated the package on [learn.svelte.dev](https://learn.svelte.dev) and [kit.svelte.dev](https://kit.svelte.dev) and those sites got the dark mode toggle automatically (this is also the reason why those sites got the dark mode toggle before the [svelte.dev](https://svelte.dev) relaunch). + +## What's next + +We have many more things planned to do post-launch. Some of them are: + +- Redesigned blog page +- Improved search +- Playground: a unified REPL and Examples page +- Unify the infrastructure of the Svelte REPL and [learn.svelte.dev](https://learn.svelte.dev) by creating a webcontainer-based REPL with rollup as a fallback +- Address any feedback From 1a3e50b6b7ebb4628446c4f852880e52c14213cd Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:57:40 +0200 Subject: [PATCH 08/11] fix: check srcset when hydrating to prevent needless requests (#8868) --------- Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- .changeset/six-teachers-divide.md | 5 ++ .../render_dom/wrappers/Element/Attribute.js | 13 ++++- packages/svelte/src/runtime/internal/utils.js | 37 ++++++++++++- packages/svelte/test/utils/utils.test.js | 52 ++++++++++++++++++- 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 .changeset/six-teachers-divide.md diff --git a/.changeset/six-teachers-divide.md b/.changeset/six-teachers-divide.md new file mode 100644 index 0000000000..a11f257fef --- /dev/null +++ b/.changeset/six-teachers-divide.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: check srcset when hydrating to prevent needless requests diff --git a/packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js b/packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js index d646261377..0459b55b03 100644 --- a/packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js +++ b/packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js @@ -64,6 +64,9 @@ export default class AttributeWrapper extends BaseAttributeWrapper { /** @type {boolean} */ is_src; + /** @type {boolean} */ + is_srcset; + /** @type {boolean} */ is_select_value_attribute; @@ -120,6 +123,9 @@ export default class AttributeWrapper extends BaseAttributeWrapper { this.is_src = this.name === 'src' && (!this.parent.node.namespace || this.parent.node.namespace === namespaces.html); + this.is_srcset = + this.name === 'srcset' && + (!this.parent.node.namespace || this.parent.node.namespace === namespaces.html); this.should_cache = should_cache(this); } @@ -164,6 +170,11 @@ export default class AttributeWrapper extends BaseAttributeWrapper { b`if (!@src_url_equal(${element.var}.src, ${init})) ${method}(${element.var}, "${name}", ${this.last});` ); updater = b`${method}(${element.var}, "${name}", ${should_cache ? this.last : value});`; + } else if (this.is_srcset) { + block.chunks.hydrate.push( + b`if (!@srcset_url_equal(${element.var}, ${init})) ${method}(${element.var}, "${name}", ${this.last});` + ); + updater = b`${method}(${element.var}, "${name}", ${should_cache ? this.last : value});`; } else if (property_name) { block.chunks.hydrate.push(b`${element.var}.${property_name} = ${init};`); updater = block.renderer.options.dev @@ -403,7 +414,7 @@ Object.keys(attribute_lookup).forEach((name) => { /** @param {AttributeWrapper} attribute */ function should_cache(attribute) { - return attribute.is_src || attribute.node.should_cache(); + return attribute.is_src || attribute.is_srcset || attribute.node.should_cache(); } const regex_contains_checked_or_group = /checked|group/; diff --git a/packages/svelte/src/runtime/internal/utils.js b/packages/svelte/src/runtime/internal/utils.js index df97d49598..190c4534c6 100644 --- a/packages/svelte/src/runtime/internal/utils.js +++ b/packages/svelte/src/runtime/internal/utils.js @@ -68,15 +68,50 @@ export function safe_not_equal(a, b) { let src_url_equal_anchor; -/** @returns {boolean} */ +/** + * @param {string} element_src + * @param {string} url + * @returns {boolean} + */ export function src_url_equal(element_src, url) { + if (element_src === url) return true; if (!src_url_equal_anchor) { src_url_equal_anchor = document.createElement('a'); } + // This is actually faster than doing URL(..).href src_url_equal_anchor.href = url; return element_src === src_url_equal_anchor.href; } +/** @param {string} srcset */ +function split_srcset(srcset) { + return srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean)); +} + +/** + * @param {HTMLSourceElement | HTMLImageElement} element_srcset + * @param {string} srcset + * @returns {boolean} + */ +export function srcset_url_equal(element_srcset, srcset) { + const element_urls = split_srcset(element_srcset.srcset); + const urls = split_srcset(srcset); + + return ( + urls.length === element_urls.length && + urls.every( + ([url, width], i) => + width === element_urls[i][1] && + // We need to test both ways because Vite will create an a full URL with + // `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the + // relative URLs inside srcset are not automatically resolved to absolute URLs by + // browsers (in contrast to img.src). This means both SSR and DOM code could + // contain relative or absolute URLs. + (src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0])) + ) + ); +} + /** @returns {boolean} */ export function not_equal(a, b) { return a != a ? b == b : a !== b; diff --git a/packages/svelte/test/utils/utils.test.js b/packages/svelte/test/utils/utils.test.js index cbdba7db32..301361ea3d 100644 --- a/packages/svelte/test/utils/utils.test.js +++ b/packages/svelte/test/utils/utils.test.js @@ -1,4 +1,4 @@ -import { assert, describe, it } from 'vitest'; +import { afterAll, assert, beforeAll, describe, it } from 'vitest'; import '../../src/compiler/compile/nodes/Slot.js'; // this needs to come first to force ESM to load things in a specific order to prevent circular dependency errors import { CONTENTEDITABLE_BINDINGS, @@ -9,7 +9,7 @@ import { } from '../../src/compiler/compile/utils/contenteditable.js'; import get_name_from_filename from '../../src/compiler/compile/utils/get_name_from_filename.js'; import { trim_end, trim_start } from '../../src/compiler/utils/trim.js'; -import { split_css_unit } from '../../src/runtime/internal/utils.js'; +import { split_css_unit, srcset_url_equal } from '../../src/runtime/internal/utils.js'; describe('utils', () => { describe('trim', () => { @@ -116,4 +116,52 @@ describe('utils', () => { }); }); }); + + describe('srcset_url_equal', () => { + function create_element(srcset) { + return /** @type {HTMLImageElement} */ ({ + srcset + }); + } + + let old_document; + + beforeAll(() => { + const host = 'https://svelte.dev'; + let _href = ''; + old_document = global.document; + global.document = /** @type {any} */ ({ + createElement: () => + /** @type {any} */ ({ + get href() { + return _href; + }, + set href(value) { + _href = host + value; + } + }) + }); + }); + + afterAll(() => { + global.document = old_document; + }); + + it('should return true if urls are equal', () => { + assert.ok(srcset_url_equal(create_element('a'), 'a')); + assert.ok(srcset_url_equal(create_element('a 1x'), 'a 1x')); + assert.ok(srcset_url_equal(create_element('a 1x, b 2x'), 'a 1x, b 2x')); + assert.ok(srcset_url_equal(create_element('a 1x, b 2x'), 'a 1x, b 2x')); + }); + + it('should return true if urls are equal (abs/rel URLs)', () => { + assert.ok(srcset_url_equal(create_element('https://svelte.dev/a'), '/a')); + assert.ok(srcset_url_equal(create_element('/a'), 'https://svelte.dev/a')); + }); + + it('should return false if urls are different', () => { + assert.notOk(srcset_url_equal(create_element('a 1x'), 'b 1x')); + assert.notOk(srcset_url_equal(create_element('a 2x'), 'a 1x')); + }); + }); }); From a590bc12a721c33bf545f4add6ae56dd02f8a011 Mon Sep 17 00:00:00 2001 From: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> Date: Fri, 30 Jun 2023 21:11:23 +0545 Subject: [PATCH 09/11] site: fix docs "edit this page" link (#8888) --- sites/svelte.dev/src/routes/docs/[slug]/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/svelte.dev/src/routes/docs/[slug]/+page.svelte b/sites/svelte.dev/src/routes/docs/[slug]/+page.svelte index cae083211b..a052bfd5ab 100644 --- a/sites/svelte.dev/src/routes/docs/[slug]/+page.svelte +++ b/sites/svelte.dev/src/routes/docs/[slug]/+page.svelte @@ -24,7 +24,7 @@
Edit this page on GitHub From cfa5447ea5df1702ae058d10f08975a412ea1515 Mon Sep 17 00:00:00 2001 From: Brad Dougherty Date: Fri, 30 Jun 2023 13:00:39 -0400 Subject: [PATCH 10/11] docs: fix typo in v4 migration guide (#8890) --- documentation/docs/05-misc/04-v4-migration-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/05-misc/04-v4-migration-guide.md b/documentation/docs/05-misc/04-v4-migration-guide.md index 7da5f3e118..0f660b68a1 100644 --- a/documentation/docs/05-misc/04-v4-migration-guide.md +++ b/documentation/docs/05-misc/04-v4-migration-guide.md @@ -152,7 +152,7 @@ The order in which preprocessors are applied has changed. Now, preprocessors are - the `inert` attribute is now applied to outroing elements to make them invisible to assistive technology and prevent interaction. ([#8628](https://github.com/sveltejs/svelte/pull/8628)) - the runtime now uses `classList.toggle(name, boolean)` which may not work in very old browsers. Consider using a [polyfill](https://github.com/eligrey/classList.js) if you need to support these browsers. ([#8629](https://github.com/sveltejs/svelte/issues/8629)) -- the runtime now uses the `CustomElement` constructor which may not work in very old browsers. Consider using a [polyfill](https://github.com/theftprevention/event-constructor-polyfill/tree/master) if you need to support these browsers. ([#8775](https://github.com/sveltejs/svelte/pull/8775)) +- the runtime now uses the `CustomEvent` constructor which may not work in very old browsers. Consider using a [polyfill](https://github.com/theftprevention/event-constructor-polyfill/tree/master) if you need to support these browsers. ([#8775](https://github.com/sveltejs/svelte/pull/8775)) - people implementing their own stores from scratch using the `StartStopNotifier` interface (which is passed to the create function of `writable` etc) from `svelte/store` now need to pass an update function in addition to the set function. This has no effect on people using stores or creating stores using the existing Svelte stores. ([#6750](https://github.com/sveltejs/svelte/issues/6750)) - `derived` will now throw an error on falsy values instead of stores passed to it. ([#7947](https://github.com/sveltejs/svelte/issues/7947)) - type definitions for `svelte/internal` were removed to further discourage usage of those internal methods which are not public API. Most of these will likely change for Svelte 5 From 4d71ab72c1329e330bee1942d1d477ae34fc0ed8 Mon Sep 17 00:00:00 2001 From: Dani Sandoval Date: Fri, 30 Jun 2023 11:06:47 -0600 Subject: [PATCH 11/11] docs: "What's new in Svelte" July newsletter (#8853) --- ...023-07-01-whats-new-in-svelte-july-2023.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 documentation/blog/2023-07-01-whats-new-in-svelte-july-2023.md diff --git a/documentation/blog/2023-07-01-whats-new-in-svelte-july-2023.md b/documentation/blog/2023-07-01-whats-new-in-svelte-july-2023.md new file mode 100644 index 0000000000..afb39a5539 --- /dev/null +++ b/documentation/blog/2023-07-01-whats-new-in-svelte-july-2023.md @@ -0,0 +1,95 @@ +--- +title: "What's new in Svelte: July 2023" +description: "Svelte 4.0, new website and a tour around the community" +author: Dani Sandoval +authorURL: https://dreamindani.com +--- + +Svelte 4 is out and folks have been building! There's a bunch of new showcases, libraries and tutorials to share. So let's get right into it... + +## What's new in Svelte +The big news this month was the release of Svelte 4.0! You can read all about it in the [Announcing Svelte 4 post](https://svelte.dev/blog/svelte-4). From performance fixes and developer experience improvements to [a brand new site, docs and tutorial](https://svelte.dev/blog/svelte-dev-overhaul)... this new release sets the stage for Svelte 5 with minimal breaking changes. + +If you're already on Node.js 16, it's possible you won't see any breaking changes in your project. But be sure to read the [migration guide](https://svelte.dev/docs/v4-migration-guide) for all the details. + +For a full list of all the changes to the Svelte compiler, including unreleased changes, check out the [CHANGELOG](https://github.com/sveltejs/svelte/blob/master/packages/svelte/CHANGELOG.md). + +## What's new in SvelteKit +This month there were lots of awesome [bug fixes](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md), so be sure to upgrade to the latest version! There are also a few new features to mention: +- The new `event.isSubRequest` boolean indicates whether this is a same-origin fetch request to one of the app's own APIs during a server request (**1.21.0**, [Docs](https://kit.svelte.dev/docs/types#public-types-requestevent), [#10170](https://github.com/sveltejs/kit/pull/10170)) +- A new config option, `config.kit.env.privatePrefix` will set a private prefix on environment variables. This defaults to `''` (**1.21.0**, [Docs](https://kit.svelte.dev/docs/configuration), [#9996](https://github.com/sveltejs/kit/pull/9996)) +- `VERSION` is now exported and accessible via `@sveltejs/kit`. This can be used for feature detection or anything else that requires knowledge of the current version of SvelteKit (**1.21.0**, [Docs](https://kit.svelte.dev/docs/modules#sveltejs-kit-version), [#9969](https://github.com/sveltejs/kit/pull/9969)) + +For adapter-specific changes, check out the CHANGELOGs in each of [the `adapter` directories](https://github.com/sveltejs/kit/tree/master/packages). + +--- + +## Community Showcase + +**Apps & Sites built with Svelte** +- [Heerdle](https://github.com/DreaminDani/heerdle) is a remake of Spotify's now-defunct Heardle - the daily music guessing game +- [Meoweler](https://meoweler.com/) is a travel site filled with cats and helpful facts about popular destinations +- [A tech lead from IKEA](https://www.reddit.com/r/sveltejs/comments/13w4zg3/comment/jmaxial/?utm_source=share&utm_medium=web2x&context=3) gave a few more details on the way they build pages (and page template) using Svelte +- [The Quest to Replace Passwords](https://notes.ekzhang.com/papers/passwords) features an interactive comparison visualization for all the popular password management tools +- [audiogest](https://audiogest.app/en) lets you turn speech to text & summarize any audio in one click +- [heroify](https://www.heroify.lol/) generates 3D graphics for your website with AI +- [Diesel Legacy: The Brazen Age](https://store.steampowered.com/app/1959140/Diesel_Legacy_The_Brazen_Age/) is a fighting game whose leaderboard and profile pages were all built in Svelte +- [markmyimages](https://www.markmyimages.com/) is a watermarking tool with bulk image resize, rename, effects, and more +- [md.robino.dev](https://github.com/rossrobino/md) is a web based markdown editor +- [YABin](https://github.com/Yureien/YABin) is Yet Another Pastebin with some very specific features + +**Learning Resources** +- [Announcing Svelte 4 post](https://svelte.dev/blog/svelte-4) +- [svelte.dev: A complete overhaul](https://svelte.dev/blog/svelte-dev-overhaul) + +_Featuring Svelte Contributors and Ambassadors_ +- [Dev Vlog: June 2023](https://www.youtube.com/watch?v=AOXq89h8saI) - Svelte 4.0 with Rich Harris +- [PodRocket: Svelte 4](https://podrocket.logrocket.com/svelte-4) with Geoff +- [This Dot Media: Svelte 4 Launch Party](https://www.youtube.com/watch?v=-9gy_leMmcQ) with Simon, Ben, Geoff, and Puru +- [Exposing Svelte: Between Two Nerds](https://www.youtube.com/watch?v=kAfotLrebhY) is a comedic conversation between Rich Harris and Dax Raad +- [Community Tutorial: Self-hosting SvelteKit with a VPS, Docker, CapRover and GitHub Actions](https://www.youtube.com/watch?v=KbIFRVvdgA8) with Stanislav Khromov +- [SvelteKit and Storybook](https://www.youtube.com/watch?v=1wH7rR7hZlg) with Jeppe Reinhold +- This Week in Svelte: + - [2023 June 2](https://www.youtube.com/watch?v=B2AOYWs6eko) - SvelteKit 1.20.1, Svelte 4 pre-release, Headless UI libraries + - [2023 June 9](https://www.youtube.com/watch?v=OG70PKD0hEU) - Updates, Self-hosting SvelteKit, Passing styles to children + - [2023 June 16](https://www.youtube.com/watch?v=GNEbC5K34Po) - Svelte 4 next.1, how to create a hamburger menu, group layouts + - [2023 June 23](https://www.youtube.com/watch?v=o-qnnbMbmE4) - Svelte 4, Popovers and hover, Real Time requests with SvelteKit +- Svelte Radio + - [SvelteLab - a Svelte REPL for SvelteKit](https://www.svelteradio.com/episodes/sveltelab-a-svelte-repl-for-sveltekit-with-antonio-and-paolo) with Antonio and Paolo + - [Svelte Radio Live - Svelte 4 Summer Special](https://www.youtube.com/watch?v=72TIVhRtyWE) with Simon and Puru +- [Svelte Society - London June 2023](https://www.youtube.com/watch?v=EkH0aMgeIKw) +- [Using The Svelte Context API With Stores](https://www.youtube.com/watch?v=dp-7NvLDrK4), [Impossible FLIP Layout Animations With Svelte And GSAP](https://www.youtube.com/watch?v=ecP8RwpkiQw) and [Create Beautiful Presentations With Svelte](https://www.youtube.com/watch?v=67lqa5kTQkA) by Joy of Code + + +_To Watch_ +- [Server-side filtered, paginated and sorted Table in SvelteKit](https://www.youtube.com/watch?v=VgCU0cVWgJE) by hartenfellerdev +- [Best Icon Library for Svelte and SvelteKit in 2023](https://www.youtube.com/watch?v=qJP6hC4YIhk) by SvelteRust + +_To Read_ +- [From Zero to Production with SvelteKit](https://www.okupter.com/events/from-zero-to-production-with-sveltekit) by Justin Ahinon +- [Thoughts on Svelte(Kit), one year and 3 billion requests later](https://claudioholanda.ch/en/blog/svelte-kit-after-3-billion-requests/) by Claudio Holanda +- [How I published a gratitude journaling app for iOS and Android using SvelteKit and Capacitor](https://khromov.se/how-i-published-a-gratitude-journaling-app-for-ios-and-android-using-sveltekit-and-capacitor/) by Stanislav Khromov +- [Learning by doing - Vue devs build a Svelte Single Page App](https://www.blackspike.com/blog/learning-svelte-by-building-a-single-page-application/) by Black Spike +- [Generate Breadcrumb and Navigation in SvelteKit](https://blog.aakashgoplani.in/generate-breadcrumb-and-navigation-in-sveltekit), [SvelteKit Authentication using SvelteKitAuth and OAuth providers: A Comprehensive Guide](https://blog.aakashgoplani.in/sveltekit-authentication-using-sveltekitauth-and-oauth-providers-a-comprehensive-guide) and [SvelteKitAuth with Salesforce OAuth provider](https://blog.aakashgoplani.in/sveltekitauth-with-salesforce-oauth-provider) by Aakash Goplani +- [Instantly find and remove Svelte component orphans](https://node-jz.medium.com/instantly-find-and-remove-svelte-component-orphans-9b2838ea2d99) by Jeremy Zaborowski +- [Migration Guide from Routify to SvelteKit Router](https://blog.aakashgoplani.in/migration-guide-from-routify-to-sveltekit-router) by Aakash Goplani +- [Creating 3D data visualization using Threlte and D3](https://www.datavizcubed.com/) by DataViz Cubed +- [Svelte Real‑time Multiplayer Game: User Presence](https://rodneylab.com/svelte-realtime-multiplayer-game/) and [SvelteKit PostCSS Tutorial: use Future CSS Today](https://rodneylab.com/sveltekit-postcss-tutorial/) by Rodney Lab +- [SvelteKit’s World of Routing: Unleash power of your app using Dynamic Routes and Parameters](https://www.inow.dev/sveltekits-world-of-routing-unleash-power-of-your-app-using-dynamic-routes-and-parameters/) by Igor Nowosad + + +**Libraries, Tools & Components** +- [The Vercel AI SDK](https://vercel.com/blog/introducing-the-vercel-ai-sdk) is an interoperable, streaming-enabled, edge-ready software development kit for AI apps built with React and Svelte +- [Superforms 1.0](https://superforms.rocks/) has been released. Check out the [migration guide](https://superforms.rocks/migration) and [new feature list](https://superforms.rocks/whats-new-v1) for more details +- [Panda CSS](https://panda-css.com/docs/getting-started/svelte) is CSS-in-JS with build time generated styles, RSC compatibility and multi-variant support +- [svelte-section-list](https://github.com/TIKramer/svelte-section-list) is a headless Svelte npm package that provides drag-and-drop functionality for managing items and sections +- [WebStorm](https://twitter.com/tomblachut/status/1669759906579185681?t=6WzLPUi65wsLtbVvYky7UQ&s=19) is starting to use the Svelte Language Server in its IDE tooling +- [shadcn-svelte](https://www.shadcn-svelte.com/) is an unofficial port of [shadcn/ui](https://github.com/shadcn/ui) to Svelte that makes it easy to build your component library from common base components +- [sveltekit-multibuild](https://github.com/MrNNP/sveltekit-multibuild) is a starter repo to create Android apps, web sites, desktop apps, and Chrome extensions automatically +- [SvelteKit AI Chatbot](https://github.com/jianyuan/sveltekit-ai-chatbot) is an open-source AI chatbot app template built with SvelteKit, the Vercel AI SDK, OpenAI, and Vercel KV. +- [KitAI](https://kit-ai.vercel.app/) provides batteries-included AI templates for SvelteKit and Next.js +- [Svelte Form Builder](https://github.com/pragmatic-engineering/svelte-form-builder-community) is a no-code drag&drop form builder for Svelte + +Thanks for reading! As always, feel free to let us know if we missed anything on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.gg/svelte). + +Until next time 👋