@sveltejs/kit 3.0.0-next.2 → 3.0.0-next.21

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.
Files changed (195) hide show
  1. package/package.json +62 -36
  2. package/src/cli.js +15 -12
  3. package/src/constants.js +6 -1
  4. package/src/core/adapt/builder.js +66 -72
  5. package/src/core/adapt/index.js +17 -6
  6. package/src/core/config/index.js +134 -80
  7. package/src/core/config/options.js +295 -273
  8. package/src/core/config/types.d.ts +1 -1
  9. package/src/core/env.js +146 -16
  10. package/src/core/generate_manifest/index.js +18 -15
  11. package/src/core/postbuild/analyse.js +8 -20
  12. package/src/core/postbuild/crawl.js +22 -6
  13. package/src/core/postbuild/entities.js +8 -2
  14. package/src/core/postbuild/fallback.js +4 -2
  15. package/src/core/postbuild/prerender.js +222 -70
  16. package/src/core/postbuild/queue.js +2 -1
  17. package/src/core/sync/create_manifest_data/conflict.js +1 -1
  18. package/src/core/sync/create_manifest_data/index.js +82 -62
  19. package/src/core/sync/sync.js +40 -31
  20. package/src/core/sync/ts.js +1 -1
  21. package/src/core/sync/utils.js +22 -2
  22. package/src/core/sync/{write_non_ambient.js → write_app_types.js} +107 -58
  23. package/src/core/sync/write_client_manifest.js +14 -29
  24. package/src/core/sync/write_env.js +7 -5
  25. package/src/core/sync/write_server.js +37 -45
  26. package/src/core/sync/write_tsconfig/index.js +274 -0
  27. package/src/core/sync/write_tsconfig/test-app/package.json +7 -0
  28. package/src/core/sync/write_tsconfig/utils.js +77 -0
  29. package/src/core/sync/write_tsconfig/validate.js +128 -0
  30. package/src/core/sync/write_types/index.js +127 -123
  31. package/src/core/utils.js +30 -5
  32. package/src/exports/env/index.js +77 -0
  33. package/src/exports/env/public.d.ts +55 -0
  34. package/src/exports/hooks/index.js +3 -9
  35. package/src/exports/hooks/public.d.ts +195 -0
  36. package/src/exports/hooks/sequence.js +9 -6
  37. package/src/exports/index.js +52 -29
  38. package/src/exports/internal/client.js +5 -0
  39. package/src/exports/internal/env.js +8 -5
  40. package/src/exports/internal/index.js +1 -90
  41. package/src/exports/internal/{event.js → server/event.js} +2 -3
  42. package/src/exports/internal/server/index.js +37 -0
  43. package/src/exports/internal/server/telemetry.js +95 -0
  44. package/src/exports/internal/shared.js +90 -0
  45. package/src/exports/node/index.js +64 -22
  46. package/src/exports/params/index.js +70 -0
  47. package/src/exports/params/public.d.ts +63 -0
  48. package/src/exports/public.d.ts +50 -1733
  49. package/src/exports/remote/index.js +11 -0
  50. package/src/exports/remote/public.d.ts +519 -0
  51. package/src/exports/url.js +86 -0
  52. package/src/exports/vite/build/build_server.js +54 -65
  53. package/src/exports/vite/build/remote.js +24 -19
  54. package/src/exports/vite/build/utils.js +0 -8
  55. package/src/exports/vite/dev/index.js +218 -146
  56. package/src/exports/vite/index.js +1590 -858
  57. package/src/exports/vite/module_ids.js +2 -2
  58. package/src/exports/vite/preview/index.js +40 -32
  59. package/src/exports/vite/public.d.ts +588 -0
  60. package/src/exports/vite/utils.js +84 -46
  61. package/src/pathname.js +55 -0
  62. package/src/runner.js +15 -0
  63. package/src/runtime/app/env/internal.js +4 -4
  64. package/src/runtime/app/env/types.d.ts +1 -1
  65. package/src/runtime/app/environment/index.js +3 -3
  66. package/src/runtime/app/{forms.js → forms/index.js} +73 -42
  67. package/src/runtime/app/forms/public.d.ts +2 -0
  68. package/src/runtime/app/forms/types.d.ts +56 -0
  69. package/src/runtime/app/internal/transport.js +53 -0
  70. package/src/runtime/app/manifest/index.js +1 -0
  71. package/src/runtime/app/{navigation.js → navigation/index.js} +2 -1
  72. package/src/runtime/app/navigation/public.d.ts +237 -0
  73. package/src/runtime/app/paths/client.js +37 -37
  74. package/src/runtime/app/paths/index.js +1 -1
  75. package/src/runtime/app/paths/internal/client.js +34 -2
  76. package/src/runtime/app/paths/internal/server.js +6 -23
  77. package/src/runtime/app/paths/internal.d.ts +3 -0
  78. package/src/runtime/app/paths/public.d.ts +1 -29
  79. package/src/runtime/app/paths/server.js +36 -17
  80. package/src/runtime/app/paths/types.d.ts +11 -19
  81. package/src/runtime/app/server/index.js +2 -2
  82. package/src/runtime/app/server/public.d.ts +201 -0
  83. package/src/runtime/app/server/remote/command.js +13 -11
  84. package/src/runtime/app/server/remote/form.js +61 -39
  85. package/src/runtime/app/server/remote/prerender.js +45 -45
  86. package/src/runtime/app/server/remote/query.js +106 -108
  87. package/src/runtime/app/server/remote/requested.js +27 -19
  88. package/src/runtime/app/server/remote/shared.js +76 -76
  89. package/src/runtime/app/service-worker/index.js +24 -0
  90. package/src/runtime/app/state/client.js +4 -2
  91. package/src/runtime/app/state/index.js +7 -5
  92. package/src/runtime/app/state/public.d.ts +72 -0
  93. package/src/runtime/app/state/server.js +3 -0
  94. package/src/runtime/app/stores.js +15 -78
  95. package/src/runtime/client/bundle.js +1 -1
  96. package/src/runtime/client/client-entry.js +3 -0
  97. package/src/runtime/client/client.js +1336 -648
  98. package/src/runtime/client/constants.js +3 -6
  99. package/src/runtime/client/entry.js +24 -3
  100. package/src/runtime/client/fetcher.js +25 -25
  101. package/src/runtime/client/ndjson.js +1 -1
  102. package/src/runtime/client/parse.js +1 -1
  103. package/src/runtime/client/payload.js +17 -0
  104. package/src/runtime/client/remote-functions/cache.svelte.js +3 -1
  105. package/src/runtime/client/remote-functions/command.svelte.js +37 -61
  106. package/src/runtime/client/remote-functions/form.svelte.js +267 -178
  107. package/src/runtime/client/remote-functions/prerender.svelte.js +32 -11
  108. package/src/runtime/client/remote-functions/query/index.js +10 -17
  109. package/src/runtime/client/remote-functions/query/instance.svelte.js +64 -18
  110. package/src/runtime/client/remote-functions/query/proxy.js +5 -5
  111. package/src/runtime/client/remote-functions/query-batch.svelte.js +61 -70
  112. package/src/runtime/client/remote-functions/query-live/index.js +1 -1
  113. package/src/runtime/client/remote-functions/query-live/instance.svelte.js +63 -21
  114. package/src/runtime/client/remote-functions/query-live/iterator.js +15 -12
  115. package/src/runtime/client/remote-functions/query-live/proxy.js +2 -12
  116. package/src/runtime/client/remote-functions/shared.svelte.js +90 -65
  117. package/src/runtime/client/snapshots.js +147 -0
  118. package/src/runtime/client/state.svelte.js +94 -55
  119. package/src/runtime/client/stream.js +3 -2
  120. package/src/runtime/client/types.d.ts +13 -9
  121. package/src/runtime/client/utils.js +22 -110
  122. package/src/runtime/components/root.svelte +56 -0
  123. package/src/runtime/env/dynamic/private.js +7 -0
  124. package/src/runtime/env/dynamic/public.js +7 -0
  125. package/src/runtime/env/static/private.js +6 -0
  126. package/src/runtime/env/static/public.js +6 -0
  127. package/src/runtime/form-utils.js +172 -61
  128. package/src/runtime/pathname.js +20 -32
  129. package/src/runtime/props.svelte.js +72 -0
  130. package/src/runtime/server/constants.js +0 -3
  131. package/src/runtime/server/cookie.js +72 -55
  132. package/src/runtime/server/csrf.js +65 -0
  133. package/src/runtime/server/data/index.js +49 -53
  134. package/src/runtime/server/dev.js +22 -0
  135. package/src/runtime/server/endpoint.js +6 -7
  136. package/src/runtime/server/env_module.js +0 -5
  137. package/src/runtime/server/errors.js +160 -0
  138. package/src/runtime/server/fetch.js +32 -39
  139. package/src/runtime/server/index.js +90 -64
  140. package/src/runtime/server/internal.js +71 -0
  141. package/src/runtime/server/page/actions.js +85 -64
  142. package/src/runtime/server/page/crypto.js +2 -2
  143. package/src/runtime/server/page/csp.js +88 -104
  144. package/src/runtime/server/page/data_serializer.js +24 -25
  145. package/src/runtime/server/page/index.js +36 -53
  146. package/src/runtime/server/page/load_data.js +50 -57
  147. package/src/runtime/server/page/render.js +173 -239
  148. package/src/runtime/server/page/respond_with_error.js +17 -31
  149. package/src/runtime/server/page/serialize_data.js +2 -13
  150. package/src/runtime/server/page/server_routing.js +85 -26
  151. package/src/runtime/server/remote-functions.js +640 -0
  152. package/src/runtime/server/respond.js +190 -131
  153. package/src/runtime/server/sourcemaps.js +183 -0
  154. package/src/runtime/server/state.js +53 -0
  155. package/src/runtime/server/utils.js +13 -155
  156. package/src/runtime/shared.js +20 -40
  157. package/src/runtime/utils.js +3 -0
  158. package/src/types/ambient-private.d.ts +11 -1
  159. package/src/types/ambient.d.ts +87 -36
  160. package/src/types/global-private.d.ts +25 -25
  161. package/src/types/internal.d.ts +163 -157
  162. package/src/types/private.d.ts +41 -1
  163. package/src/utils/error.js +28 -4
  164. package/src/utils/escape.js +9 -25
  165. package/src/utils/features.js +1 -1
  166. package/src/utils/filesystem.js +1 -23
  167. package/src/utils/fork.js +7 -2
  168. package/src/utils/hash.js +21 -0
  169. package/src/utils/http.js +8 -7
  170. package/src/utils/import.js +9 -2
  171. package/src/utils/imports.js +83 -0
  172. package/src/utils/mime.js +9 -0
  173. package/src/utils/page_nodes.js +6 -7
  174. package/src/utils/params.js +67 -0
  175. package/src/utils/regex.js +9 -0
  176. package/src/utils/routing.js +145 -73
  177. package/src/utils/shared-iterator.js +5 -0
  178. package/src/utils/streaming.js +14 -4
  179. package/src/utils/url.js +33 -2
  180. package/src/version.js +1 -1
  181. package/types/index.d.ts +2616 -2433
  182. package/types/index.d.ts.map +120 -106
  183. package/src/core/sync/write_ambient.js +0 -18
  184. package/src/core/sync/write_root.js +0 -148
  185. package/src/core/sync/write_tsconfig.js +0 -250
  186. package/src/exports/internal/server.js +0 -22
  187. package/src/exports/node/polyfills.js +0 -30
  188. package/src/runtime/server/app.js +0 -9
  189. package/src/runtime/server/remote.js +0 -457
  190. package/src/runtime/shared-server.js +0 -7
  191. package/src/runtime/telemetry/otel.js +0 -21
  192. package/src/runtime/telemetry/record_span.js +0 -65
  193. package/src/types/synthetic/$lib.md +0 -5
  194. /package/src/exports/internal/{remote-functions.js → server/remote-functions.js} +0 -0
  195. /package/src/{runtime/telemetry/noop.js → telemetry.js} +0 -0
@@ -22,62 +22,97 @@
22
22
  */
23
23
  declare namespace App {
24
24
  /**
25
- * Defines the common shape of expected and unexpected errors. Expected errors are thrown using the `error` function. Unexpected errors are handled by the `handleError` hooks which should return this shape.
25
+ * Defines the common shape of expected and unexpected errors. Expected errors are thrown using the `error` function. Every error passes through the `handleError` hooks, which must return this shape (with `status` and `message` optional, since they default to those of the caught error).
26
26
  */
27
27
  export interface Error {
28
+ status: number;
28
29
  message: string;
29
30
  }
30
31
 
31
32
  /**
32
33
  * The interface that defines `event.locals`, which can be accessed in server [hooks](https://svelte.dev/docs/kit/hooks) (`handle`, and `handleError`), server-only `load` functions, and `+server.js` files.
33
34
  */
35
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
34
36
  export interface Locals {}
35
37
 
36
38
  /**
37
- * Defines the common shape of the [page.data state](https://svelte.dev/docs/kit/$app-state#page) and [$page.data store](https://svelte.dev/docs/kit/$app-stores#page) - that is, the data that is shared between all pages.
39
+ * Defines the common shape of the [page.data state](https://svelte.dev/docs/kit/$app-state#page) - that is, the data that is shared between all pages.
38
40
  * The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly.
39
41
  * Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`).
40
42
  */
43
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
41
44
  export interface PageData {}
42
45
 
43
46
  /**
44
- * The shape of the `page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
47
+ * The shape of the `page.state` object, which can be manipulated using [`goto`](https://svelte.dev/docs/kit/$app-navigation#goto).
45
48
  */
49
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
46
50
  export interface PageState {}
47
51
 
48
52
  /**
49
53
  * If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#Platform-specific-context) via `event.platform`, you can specify it here.
50
54
  */
55
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
51
56
  export interface Platform {}
52
57
  }
53
58
 
54
59
  /**
55
- * This module is only available to [service workers](https://svelte.dev/docs/kit/service-workers).
60
+ * This module is available to [service workers](https://svelte.dev/docs/kit/service-workers) and other contexts.
61
+ * It exports information about the build output, static files, prerendered pages, and routes.
56
62
  */
57
- declare module '$service-worker' {
63
+ declare module '$app/manifest' {
58
64
  /**
59
- * The `base` path of the deployment. Typically this is equivalent to `config.kit.paths.base`, but it is calculated from `location.pathname` meaning that it will continue to work correctly if the site is deployed to a subdirectory.
60
- * Note that there is a `base` but no `assets`, since service workers cannot be used if `config.kit.paths.assets` is specified.
61
- */
62
- export const base: string;
63
- /**
64
- * An array of URL strings representing the files generated by Vite, suitable for caching with `cache.addAll(build)`.
65
+ * An array of `{ path: string }` objects representing the files generated by Vite.
66
+ * The path is relative to the [base path](https://svelte.dev/docs/kit/configuration#paths), and is intended for use with `cache.add(...)` inside a [service worker](https://svelte.dev/docs/kit/service-workers).
65
67
  * During development, this is an empty array.
66
68
  */
67
- export const build: string[];
69
+ export const immutable: Array<{ path: string }>;
68
70
  /**
69
- * An array of URL strings representing the files in your static directory, or whatever directory is specified by `config.kit.files.assets`. You can customize which files are included from `static` directory using [`config.kit.serviceWorker.files`](https://svelte.dev/docs/kit/configuration#serviceWorker)
71
+ * An array of `{ path: AssetPath }` objects representing the files in your `static` directory, or whatever directory is specified by `config.files.assets`.
72
+ * The path is relative to the [base path](https://svelte.dev/docs/kit/configuration#paths), and can be used with [`asset(...)`](https://svelte.dev/docs/kit/$app-paths#asset).
70
73
  */
71
- export const files: string[];
74
+ export const assets: Array<{ path: import('$app/types').AssetPath }>;
72
75
  /**
73
- * An array of pathnames corresponding to prerendered pages and endpoints.
76
+ * An array of `{ path: Path }` objects representing prerendered pages and endpoints, relative to the [base path](https://svelte.dev/docs/kit/configuration#paths).
74
77
  * During development, this is an empty array.
75
78
  */
76
- export const prerendered: string[];
77
- /**
78
- * See [`config.kit.version`](https://svelte.dev/docs/kit/configuration#version). It's useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches.
79
- */
80
- export const version: string;
79
+ export const prerendered: Array<{ path: import('$app/types').Path }>;
80
+ /**
81
+ * A route in your app, along with its capabilities. `page` indicates the presence of a `+page`,
82
+ * while `endpoint` indicates the presence of a `+server`. Both are `true` when both files exist.
83
+ */
84
+ export type ManifestRoute =
85
+ | {
86
+ id: Exclude<import('$app/types').PageRouteId, import('$app/types').EndpointRouteId>;
87
+ page: true;
88
+ endpoint: false;
89
+ }
90
+ | {
91
+ id: Exclude<import('$app/types').EndpointRouteId, import('$app/types').PageRouteId>;
92
+ page: false;
93
+ endpoint: true;
94
+ }
95
+ | {
96
+ id: Extract<import('$app/types').PageRouteId, import('$app/types').EndpointRouteId>;
97
+ page: true;
98
+ endpoint: true;
99
+ };
100
+ /**
101
+ * An array of objects representing the routes in your app. Only routes that the router can match
102
+ * are included — directories that merely hold a `+layout` are not routes of their own.
103
+ *
104
+ * Each object has an `id`, plus `page` and `endpoint` booleans describing whether the route has a
105
+ * `+page` and/or a `+server`. Both are `true` for a route that has both, so the capabilities can
106
+ * be filtered independently:
107
+ *
108
+ * ```js
109
+ * import { routes } from '$app/manifest';
110
+ *
111
+ * const pages = routes.filter((route) => route.page);
112
+ * const endpoints = routes.filter((route) => route.endpoint);
113
+ * ```
114
+ */
115
+ export const routes: ManifestRoute[];
81
116
  }
82
117
 
83
118
  /**
@@ -91,16 +126,32 @@ declare module '$app/types' {
91
126
  // These are all functions so that we can leverage function overloads to get the correct type.
92
127
  // Using the return types directly would error with a "not the same type" error.
93
128
  // https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces
129
+ PageRouteId(): string;
130
+ EndpointRouteId(): string;
94
131
  RouteId(): string;
95
132
  RouteParams(): Record<string, Record<string, string>>;
96
133
  LayoutParams(): Record<string, Record<string, string>>;
97
- Pathname(): string;
134
+ Path(): string;
98
135
  ResolvedPathname(): string;
99
- Asset(): string;
136
+ AssetPath(): string;
100
137
  }
101
138
 
102
139
  /**
103
- * A union of all the route IDs in your app. Used for `page.route.id` and `event.route.id`.
140
+ * A union of the route IDs in your app that have a `+page`.
141
+ *
142
+ * A route ID can be in both `PageRouteId` and `EndpointRouteId`, if its directory contains both a `+page` and a `+server`.
143
+ */
144
+ export type PageRouteId = ReturnType<AppTypes['PageRouteId']>;
145
+
146
+ /**
147
+ * A union of the route IDs in your app that have a `+server`.
148
+ *
149
+ * A route ID can be in both `PageRouteId` and `EndpointRouteId`, if its directory contains both a `+page` and a `+server`.
150
+ */
151
+ export type EndpointRouteId = ReturnType<AppTypes['EndpointRouteId']>;
152
+
153
+ /**
154
+ * A union of all the route IDs in your app — the union of `PageRouteId` and `EndpointRouteId`. Used for `page.route.id` and `event.route.id`.
104
155
  */
105
156
  export type RouteId = ReturnType<AppTypes['RouteId']>;
106
157
 
@@ -116,33 +167,33 @@ declare module '$app/types' {
116
167
  ? ReturnType<AppTypes['RouteParams']>[T]
117
168
  : Record<string, never>;
118
169
 
170
+ /**
171
+ * The route IDs accepted by `LayoutParams`. Like `RouteId`, these preserve route groups and `[param]` syntax, but they identify directories containing layouts rather than matchable routes.
172
+ */
173
+ type LayoutParamsId = keyof ReturnType<AppTypes['LayoutParams']>;
174
+
119
175
  /**
120
176
  * A utility for getting the parameters associated with a given layout, which is similar to `RouteParams` but also includes optional parameters for any child route.
121
177
  */
122
- export type LayoutParams<T extends RouteId> = T extends keyof ReturnType<AppTypes['LayoutParams']>
123
- ? ReturnType<AppTypes['LayoutParams']>[T]
124
- : Record<string, never>;
178
+ export type LayoutParams<T extends LayoutParamsId> = ReturnType<AppTypes['LayoutParams']>[T];
125
179
 
126
180
  /**
127
- * A union of all valid pathnames in your app.
181
+ * A union of all valid paths in your app, relative to the `base` path.
128
182
  */
129
- export type Pathname = ReturnType<AppTypes['Pathname']>;
183
+ export type Path = ReturnType<AppTypes['Path']>;
130
184
 
131
185
  /**
132
- * `Pathname`, but possibly suffixed with a search string and/or hash.
186
+ * `Path`, but possibly suffixed with a search string and/or hash.
133
187
  */
134
- export type PathnameWithSearchOrHash =
135
- | Pathname
136
- | `${Pathname}?${string}`
137
- | `${Pathname}#${string}`;
188
+ export type PathnameWithSearchOrHash = Path | `${Path}?${string}` | `${Path}#${string}`;
138
189
 
139
190
  /**
140
- * `Pathname`, but possibly prefixed with a base path. Used for `page.url.pathname`.
191
+ * `Path`, but prefixed with a base path. Used for `page.url.pathname`.
141
192
  */
142
193
  export type ResolvedPathname = ReturnType<AppTypes['ResolvedPathname']>;
143
194
 
144
195
  /**
145
- * A union of all the filenames of assets contained in your `static` directory.
196
+ * A union of all the filenames of assets contained in your `static` directory, relative to the `base` path.
146
197
  */
147
- export type Asset = ReturnType<AppTypes['Asset']>;
198
+ export type AssetPath = ReturnType<AppTypes['AssetPath']>;
148
199
  }
@@ -1,9 +1,13 @@
1
+ import { SvelteKitPayload } from 'types';
2
+
1
3
  declare global {
2
4
  const __SVELTEKIT_ADAPTER_NAME__: string;
3
5
  const __SVELTEKIT_APP_DIR__: string;
4
6
  const __SVELTEKIT_APP_VERSION__: string;
5
7
  const __SVELTEKIT_APP_VERSION_FILE__: string;
6
8
  const __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: number;
9
+ /** True if version checks are enabled (i.e. `bundleStrategy !== 'inline'`) */
10
+ const __SVELTEKIT_APP_VERSION_CHECKS_ENABLED__: boolean;
7
11
  /**
8
12
  * True if the user ran `vite dev`. This is different from `esm-env` because
9
13
  * it is influenced by `NODE_ENV` which can still be true during `vite preview`
@@ -13,13 +17,13 @@ declare global {
13
17
  const __SVELTEKIT_PATHS_ASSETS__: string;
14
18
  const __SVELTEKIT_PATHS_BASE__: string;
15
19
  const __SVELTEKIT_PATHS_RELATIVE__: boolean;
16
- /** True if `config.kit.experimental.instrumentation.server` is `true` */
20
+ /** True if `config.tracing.server` is `true` */
17
21
  const __SVELTEKIT_SERVER_TRACING_ENABLED__: boolean;
18
- /** True if `config.kit.experimental.forkPreloads` is `true` */
22
+ /** True if `config.experimental.forkPreloads` is `true` */
19
23
  const __SVELTEKIT_FORK_PRELOADS__: boolean;
20
- /** True if `config.kit.router.resolution === 'client'` */
24
+ /** True if `config.router.resolution === 'client'` */
21
25
  const __SVELTEKIT_CLIENT_ROUTING__: boolean;
22
- /** True if `config.kit.router.type === 'hash'` */
26
+ /** True if `config.router.type === 'hash'` */
23
27
  const __SVELTEKIT_HASH_ROUTING__: boolean;
24
28
  /**
25
29
  * True if any node in the manifest has a server load function.
@@ -31,28 +35,25 @@ declare global {
31
35
  * Used for treeshaking universal load code from client bundles when no universal loads exist.
32
36
  */
33
37
  const __SVELTEKIT_HAS_UNIVERSAL_LOAD__: boolean;
34
- /** The `__sveltekit_abc123` object in the init `<script>` */
35
- const __SVELTEKIT_PAYLOAD__: {
36
- /** The basepath, usually relative to the current page */
37
- base: string;
38
- /** Path to externally-hosted assets */
39
- assets?: string;
40
- /** Public environment variables */
41
- env?: Record<string, string>;
42
- /** Serialized data from query/form/command functions */
43
- query?: Record<string, any>;
44
- /** Serialized data from prerender functions */
45
- prerender?: Record<string, any>;
46
- /** Create a placeholder promise */
47
- defer?: (id: number) => Promise<any>;
48
- /** Resolve a placeholder promise */
49
- resolve?: (data: { id: number; data: any; error: any }) => void;
50
- };
51
38
  /**
52
- * The Vite `root` setting used to construct paths to nodes and components
53
- * for the SSR manifest during development
39
+ * The `__sveltekit_abc123` object in the init `<script>`.
40
+ * Should only be used when bundleStrategy !== 'inline' to avoid SvelteKit runtime changing on every build, preventing cacheability.
41
+ */
42
+ const __SVELTEKIT_PAYLOAD__: SvelteKitPayload;
43
+ /**
44
+ * Whether the `experimental.async` flag is applied
45
+ */
46
+ const __SVELTEKIT_SUPPORTS_ASYNC__: boolean;
47
+ /**
48
+ * Manifest data placeholders used by `$app/manifest`. During build, these
49
+ * are bare identifiers (fake globals) that the bundler leaves as unresolved
50
+ * references. They are replaced with real values by scanning the output
51
+ * chunks after each build completes.
54
52
  */
55
- const __SVELTEKIT_ROOT__: string;
53
+ const __SVELTEKIT_MANIFEST_IMMUTABLE__: string[];
54
+ const __SVELTEKIT_MANIFEST_ASSETS__: string[];
55
+ const __SVELTEKIT_MANIFEST_PRERENDERED__: string[];
56
+ const __SVELTEKIT_MANIFEST_ROUTES__: Array<{ id: string }>;
56
57
  /**
57
58
  * This makes the use of specific features visible at both dev and build time, in such a
58
59
  * way that we can error when they are not supported by the target platform.
@@ -68,7 +69,6 @@ declare global {
68
69
  * to throw an error if the feature would fail in production.
69
70
  */
70
71
  var __SVELTEKIT_TRACK__: (label: string) => void;
71
- var __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__: boolean;
72
72
  var Bun: object;
73
73
  var Deno: object;
74
74
  }