@sveltejs/kit 2.0.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ // we expose this as a separate entry point (rather than treating client.js as the entry point)
2
+ // so that everything other than `start` can be treeshaken
3
+ export { start } from './client.js';
@@ -1,9 +1,10 @@
1
- import { DEV } from 'esm-env';
1
+ import { BROWSER, DEV } from 'esm-env';
2
2
  import { hash } from '../hash.js';
3
3
 
4
4
  let loading = 0;
5
5
 
6
- export const native_fetch = window.fetch;
6
+ /** @type {typeof fetch} */
7
+ export const native_fetch = BROWSER ? window.fetch : /** @type {any} */ (() => {});
7
8
 
8
9
  export function lock_fetch() {
9
10
  loading += 1;
@@ -13,7 +14,7 @@ export function unlock_fetch() {
13
14
  loading -= 1;
14
15
  }
15
16
 
16
- if (DEV) {
17
+ if (DEV && BROWSER) {
17
18
  let can_inspect_stack_trace = false;
18
19
 
19
20
  const check_stack_trace = async () => {
@@ -61,7 +62,7 @@ if (DEV) {
61
62
 
62
63
  return native_fetch(input, init);
63
64
  };
64
- } else {
65
+ } else if (BROWSER) {
65
66
  window.fetch = (input, init) => {
66
67
  const method = input instanceof Request ? input.method : init?.method || 'GET';
67
68
 
@@ -1,16 +1,3 @@
1
- import { applyAction } from '../app/forms.js';
2
- import {
3
- afterNavigate,
4
- beforeNavigate,
5
- onNavigate,
6
- goto,
7
- invalidate,
8
- invalidateAll,
9
- preloadCode,
10
- preloadData,
11
- pushState,
12
- replaceState
13
- } from '../app/navigation.js';
14
1
  import { SvelteComponent } from 'svelte';
15
2
  import { ClientHooks, CSRPageNode, CSRPageNodeLoader, CSRRoute, TrailingSlash, Uses } from 'types';
16
3
  import { Page, ParamMatcher } from '@sveltejs/kit';
@@ -42,34 +29,6 @@ export interface SvelteKitApp {
42
29
  root: typeof SvelteComponent;
43
30
  }
44
31
 
45
- export interface Client {
46
- // public API, exposed via $app/navigation
47
- after_navigate: typeof afterNavigate;
48
- before_navigate: typeof beforeNavigate;
49
- on_navigate: typeof onNavigate;
50
- disable_scroll_handling(): void;
51
- goto: typeof goto;
52
- invalidate: typeof invalidate;
53
- invalidate_all: typeof invalidateAll;
54
- preload_code: typeof preloadCode;
55
- preload_data: typeof preloadData;
56
- push_state: typeof pushState;
57
- replace_state: typeof replaceState;
58
- apply_action: typeof applyAction;
59
-
60
- // private API
61
- _hydrate(opts: {
62
- status: number;
63
- error: App.Error | null;
64
- node_ids: number[];
65
- params: Record<string, string>;
66
- route: { id: string | null };
67
- data: Array<import('types').ServerDataNode | null>;
68
- form: Record<string, any> | null;
69
- }): Promise<void>;
70
- _start_router(): void;
71
- }
72
-
73
32
  export type NavigationIntent = {
74
33
  /** `url.pathname + url.search` */
75
34
  id: string;
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '2.0.8';
4
+ export const VERSION = '2.1.0';
package/types/index.d.ts CHANGED
@@ -1884,11 +1884,6 @@ declare module '$app/environment' {
1884
1884
  }
1885
1885
 
1886
1886
  declare module '$app/forms' {
1887
- /**
1888
- * This action updates the `form` property of the current page with the given data and updates `$page.status`.
1889
- * In case of an error, it redirects to the nearest error page.
1890
- * */
1891
- export function applyAction<Success extends Record<string, unknown> | undefined, Failure extends Record<string, unknown> | undefined>(result: import("@sveltejs/kit").ActionResult<Success, Failure>): Promise<void>;
1892
1887
  /**
1893
1888
  * Use this function to deserialize the response from a form submission.
1894
1889
  * Usage:
@@ -1931,14 +1926,47 @@ declare module '$app/forms' {
1931
1926
  export function enhance<Success extends Record<string, unknown> | undefined, Failure extends Record<string, unknown> | undefined>(form_element: HTMLFormElement, submit?: import("@sveltejs/kit").SubmitFunction<Success, Failure>): {
1932
1927
  destroy(): void;
1933
1928
  };
1929
+ /**
1930
+ * This action updates the `form` property of the current page with the given data and updates `$page.status`.
1931
+ * In case of an error, it redirects to the nearest error page.
1932
+ * */
1933
+ export function applyAction<Success extends Record<string, unknown> | undefined, Failure extends Record<string, unknown> | undefined>(result: import("@sveltejs/kit").ActionResult<Success, Failure>): Promise<void>;
1934
1934
  }
1935
1935
 
1936
1936
  declare module '$app/navigation' {
1937
+ /**
1938
+ * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a new URL.
1939
+ *
1940
+ * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
1941
+ * */
1942
+ export function afterNavigate(callback: (navigation: import('@sveltejs/kit').AfterNavigate) => void): void;
1943
+ /**
1944
+ * A navigation interceptor that triggers before we navigate to a new URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls.
1945
+ *
1946
+ * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response.
1947
+ *
1948
+ * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`.
1949
+ *
1950
+ * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`.
1951
+ *
1952
+ * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
1953
+ * */
1954
+ export function beforeNavigate(callback: (navigation: import('@sveltejs/kit').BeforeNavigate) => void): void;
1955
+ /**
1956
+ * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations.
1957
+ *
1958
+ * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user.
1959
+ *
1960
+ * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated.
1961
+ *
1962
+ * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
1963
+ * */
1964
+ export function onNavigate(callback: (navigation: import('@sveltejs/kit').OnNavigate) => MaybePromise<void>): void;
1937
1965
  /**
1938
1966
  * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling.
1939
1967
  * This is generally discouraged, since it breaks user expectations.
1940
1968
  * */
1941
- export const disableScrollHandling: () => void;
1969
+ export function disableScrollHandling(): void;
1942
1970
  /**
1943
1971
  * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
1944
1972
  * For external URLs, use `window.location = url` instead of calling `goto(url)`.
@@ -1946,13 +1974,13 @@ declare module '$app/navigation' {
1946
1974
  * @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
1947
1975
  * @param {Object} opts Options related to the navigation
1948
1976
  * */
1949
- export const goto: (url: string | URL, opts?: {
1950
- replaceState?: boolean;
1951
- noScroll?: boolean;
1952
- keepFocus?: boolean;
1953
- invalidateAll?: boolean;
1954
- state?: App.PageState;
1955
- }) => Promise<void>;
1977
+ export function goto(url: string | URL, opts?: {
1978
+ replaceState?: boolean | undefined;
1979
+ noScroll?: boolean | undefined;
1980
+ keepFocus?: boolean | undefined;
1981
+ invalidateAll?: boolean | undefined;
1982
+ state?: App.PageState | undefined;
1983
+ } | undefined): Promise<void>;
1956
1984
  /**
1957
1985
  * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated.
1958
1986
  *
@@ -1968,13 +1996,13 @@ declare module '$app/navigation' {
1968
1996
  *
1969
1997
  * invalidate((url) => url.pathname === '/path');
1970
1998
  * ```
1971
- * @param url The invalidated URL
1999
+ * @param resource The invalidated URL
1972
2000
  * */
1973
- export const invalidate: (url: string | URL | ((url: URL) => boolean)) => Promise<void>;
2001
+ export function invalidate(resource: string | URL | ((url: URL) => boolean)): Promise<void>;
1974
2002
  /**
1975
2003
  * Causes all `load` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated.
1976
2004
  * */
1977
- export const invalidateAll: () => Promise<void>;
2005
+ export function invalidateAll(): Promise<void>;
1978
2006
  /**
1979
2007
  * Programmatically preloads the given page, which means
1980
2008
  * 1. ensuring that the code for the page is loaded, and
@@ -1986,7 +2014,14 @@ declare module '$app/navigation' {
1986
2014
  *
1987
2015
  * @param href Page to preload
1988
2016
  * */
1989
- export const preloadData: (href: string) => Promise<Record<string, any>>;
2017
+ export function preloadData(href: string): Promise<{
2018
+ type: 'loaded';
2019
+ status: number;
2020
+ data: Record<string, any>;
2021
+ } | {
2022
+ type: 'redirect';
2023
+ location: string;
2024
+ }>;
1990
2025
  /**
1991
2026
  * Programmatically imports the code for routes that haven't yet been fetched.
1992
2027
  * Typically, you might call this to speed up subsequent navigation.
@@ -1997,45 +2032,17 @@ declare module '$app/navigation' {
1997
2032
  * Returns a Promise that resolves when the modules have been imported.
1998
2033
  *
1999
2034
  * */
2000
- export const preloadCode: (url: string) => Promise<void>;
2001
- /**
2002
- * A navigation interceptor that triggers before we navigate to a new URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls.
2003
- *
2004
- * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response.
2005
- *
2006
- * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`.
2007
- *
2008
- * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`.
2009
- *
2010
- * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
2011
- * */
2012
- export const beforeNavigate: (callback: (navigation: import('@sveltejs/kit').BeforeNavigate) => void) => void;
2013
- /**
2014
- * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations.
2015
- *
2016
- * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user.
2017
- *
2018
- * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated.
2019
- *
2020
- * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
2021
- * */
2022
- export const onNavigate: (callback: (navigation: import('@sveltejs/kit').OnNavigate) => MaybePromise<(() => void) | void>) => void;
2023
- /**
2024
- * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a new URL.
2025
- *
2026
- * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted.
2027
- * */
2028
- export const afterNavigate: (callback: (navigation: import('@sveltejs/kit').AfterNavigate) => void) => void;
2035
+ export function preloadCode(pathname: string): Promise<void>;
2029
2036
  /**
2030
2037
  * Programmatically create a new history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://kit.svelte.dev/docs/shallow-routing).
2031
2038
  *
2032
2039
  * */
2033
- export const pushState: (url: string | URL, state: App.PageState) => void;
2040
+ export function pushState(url: string | URL, state: App.PageState): void;
2034
2041
  /**
2035
2042
  * Programmatically replace the current history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://kit.svelte.dev/docs/shallow-routing).
2036
2043
  *
2037
2044
  * */
2038
- export const replaceState: (url: string | URL, state: App.PageState) => void;
2045
+ export function replaceState(url: string | URL, state: App.PageState): void;
2039
2046
  type MaybePromise<T> = T | Promise<T>;
2040
2047
  }
2041
2048
 
@@ -89,18 +89,18 @@
89
89
  "sveltekit",
90
90
  "browser",
91
91
  "dev",
92
- "applyAction",
93
92
  "deserialize",
94
93
  "enhance",
94
+ "applyAction",
95
+ "afterNavigate",
96
+ "beforeNavigate",
97
+ "onNavigate",
95
98
  "disableScrollHandling",
96
99
  "goto",
97
100
  "invalidate",
98
101
  "invalidateAll",
99
102
  "preloadData",
100
103
  "preloadCode",
101
- "beforeNavigate",
102
- "onNavigate",
103
- "afterNavigate",
104
104
  "pushState",
105
105
  "replaceState",
106
106
  "resolveRoute",
@@ -122,7 +122,7 @@
122
122
  "../src/exports/vite/index.js",
123
123
  "../src/runtime/app/environment.js",
124
124
  "../src/runtime/app/forms.js",
125
- "../src/runtime/app/navigation.js",
125
+ "../src/runtime/client/client.js",
126
126
  "../src/runtime/app/paths.js",
127
127
  "../src/runtime/app/stores.js"
128
128
  ],
@@ -143,5 +143,5 @@
143
143
  null,
144
144
  null
145
145
  ],
146
- "mappings": ";;;;;;;;;kBA2BiBA,OAAOA;;;;;;;;;;;;aAYZC,cAAcA;;;;;;aAMdC,cAAcA;;;;;;;;;;;;;;;kBAeTC,aAAaA;;;;;;;;;;;;;;;;kBAgBbC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4FPC,MAAMA;;;;;;;;;;;;;;;;;;;;;kBAqBNC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyDPC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAu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
2
- import { create_updated_store, notifiable_store } from './utils.js';
3
- import { BROWSER } from 'esm-env';
4
-
5
- /** @type {import('./types.js').Client} */
6
- export let client;
7
-
8
- /**
9
- * @param {{
10
- * client: import('./types.js').Client;
11
- * }} opts
12
- */
13
- export function init(opts) {
14
- client = opts.client;
15
- }
16
-
17
- /**
18
- * @template {keyof typeof client} T
19
- * @param {T} key
20
- * @returns {typeof client[T]}
21
- */
22
- export function client_method(key) {
23
- if (!BROWSER) {
24
- if (
25
- key === 'before_navigate' ||
26
- key === 'after_navigate' ||
27
- key === 'on_navigate' ||
28
- key === 'push_state' ||
29
- key === 'replace_state'
30
- ) {
31
- // @ts-expect-error doesn't recognize that both keys here return void so expects a async function
32
- return () => {};
33
- } else {
34
- /** @type {Record<string, string>} */
35
- const name_lookup = {
36
- disable_scroll_handling: 'disableScrollHandling',
37
- preload_data: 'preloadData',
38
- preload_code: 'preloadCode',
39
- invalidate_all: 'invalidateAll'
40
- };
41
-
42
- return () => {
43
- throw new Error(`Cannot call ${name_lookup[key] ?? key}(...) on the server`);
44
- };
45
- }
46
- } else {
47
- // @ts-expect-error
48
- return (...args) => client[key](...args);
49
- }
50
- }
51
-
52
- export const stores = {
53
- url: /* @__PURE__ */ notifiable_store({}),
54
- page: /* @__PURE__ */ notifiable_store({}),
55
- navigating: /* @__PURE__ */ writable(
56
- /** @type {import('@sveltejs/kit').Navigation | null} */ (null)
57
- ),
58
- updated: /* @__PURE__ */ create_updated_store()
59
- };
@@ -1,28 +0,0 @@
1
- import { DEV } from 'esm-env';
2
- import { create_client } from './client.js';
3
- import { init } from './singletons.js';
4
-
5
- /**
6
- * @param {import('./types.js').SvelteKitApp} app
7
- * @param {HTMLElement} target
8
- * @param {Parameters<import('./types.js').Client['_hydrate']>[0]} [hydrate]
9
- */
10
- export async function start(app, target, hydrate) {
11
- if (DEV && target === document.body) {
12
- console.warn(
13
- 'Placing %sveltekit.body% directly inside <body> is not recommended, as your app may break for users who have certain browser extensions installed.\n\nConsider wrapping it in an element:\n\n<div style="display: contents">\n %sveltekit.body%\n</div>'
14
- );
15
- }
16
-
17
- const client = create_client(app, target);
18
-
19
- init({ client });
20
-
21
- if (hydrate) {
22
- await client._hydrate(hydrate);
23
- } else {
24
- client.goto(location.href, { replaceState: true });
25
- }
26
-
27
- client._start_router();
28
- }