@sveltejs/kit 1.0.0-next.36 → 1.0.0-next.362

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 (64) hide show
  1. package/README.md +12 -9
  2. package/assets/app/env.js +28 -0
  3. package/assets/app/navigation.js +24 -0
  4. package/assets/app/paths.js +1 -0
  5. package/assets/app/stores.js +97 -0
  6. package/assets/client/singletons.js +13 -0
  7. package/assets/client/start.js +1793 -0
  8. package/assets/components/error.svelte +18 -2
  9. package/assets/env.js +8 -0
  10. package/assets/paths.js +13 -0
  11. package/assets/server/index.js +3460 -0
  12. package/dist/chunks/_commonjsHelpers.js +3 -0
  13. package/dist/chunks/error.js +661 -0
  14. package/dist/chunks/index.js +15744 -0
  15. package/dist/chunks/index2.js +210 -0
  16. package/dist/chunks/multipart-parser.js +445 -0
  17. package/dist/chunks/sync.js +980 -0
  18. package/dist/chunks/write_tsconfig.js +274 -0
  19. package/dist/cli.js +64 -117
  20. package/dist/hooks.js +28 -0
  21. package/dist/node/polyfills.js +12237 -0
  22. package/dist/node.js +5855 -0
  23. package/dist/vite.js +3141 -0
  24. package/package.json +100 -55
  25. package/types/ambient.d.ts +345 -0
  26. package/types/index.d.ts +293 -0
  27. package/types/internal.d.ts +318 -0
  28. package/types/private.d.ts +235 -0
  29. package/CHANGELOG.md +0 -377
  30. package/assets/runtime/app/navigation.js +0 -23
  31. package/assets/runtime/app/navigation.js.map +0 -1
  32. package/assets/runtime/app/paths.js +0 -2
  33. package/assets/runtime/app/paths.js.map +0 -1
  34. package/assets/runtime/app/stores.js +0 -78
  35. package/assets/runtime/app/stores.js.map +0 -1
  36. package/assets/runtime/internal/singletons.js +0 -15
  37. package/assets/runtime/internal/singletons.js.map +0 -1
  38. package/assets/runtime/internal/start.js +0 -614
  39. package/assets/runtime/internal/start.js.map +0 -1
  40. package/assets/runtime/utils-85ebcc60.js +0 -18
  41. package/assets/runtime/utils-85ebcc60.js.map +0 -1
  42. package/dist/api.js +0 -28
  43. package/dist/api.js.map +0 -1
  44. package/dist/cli.js.map +0 -1
  45. package/dist/create_app.js +0 -502
  46. package/dist/create_app.js.map +0 -1
  47. package/dist/index.js +0 -327
  48. package/dist/index.js.map +0 -1
  49. package/dist/index2.js +0 -3497
  50. package/dist/index2.js.map +0 -1
  51. package/dist/index3.js +0 -296
  52. package/dist/index3.js.map +0 -1
  53. package/dist/index4.js +0 -311
  54. package/dist/index4.js.map +0 -1
  55. package/dist/index5.js +0 -221
  56. package/dist/index5.js.map +0 -1
  57. package/dist/index6.js +0 -730
  58. package/dist/index6.js.map +0 -1
  59. package/dist/renderer.js +0 -2429
  60. package/dist/renderer.js.map +0 -1
  61. package/dist/standard.js +0 -100
  62. package/dist/standard.js.map +0 -1
  63. package/dist/utils.js +0 -61
  64. package/dist/utils.js.map +0 -1
@@ -0,0 +1,235 @@
1
+ // This module contains types that are visible in the documentation,
2
+ // but which cannot be imported from `@sveltejs/kit`. Care should
3
+ // be taken to avoid breaking changes when editing this file
4
+
5
+ export interface AdapterEntry {
6
+ /**
7
+ * A string that uniquely identifies an HTTP service (e.g. serverless function) and is used for deduplication.
8
+ * For example, `/foo/a-[b]` and `/foo/[c]` are different routes, but would both
9
+ * be represented in a Netlify _redirects file as `/foo/:param`, so they share an ID
10
+ */
11
+ id: string;
12
+
13
+ /**
14
+ * A function that compares the candidate route with the current route to determine
15
+ * if it should be treated as a fallback for the current route. For example, `/foo/[c]`
16
+ * is a fallback for `/foo/a-[b]`, and `/[...catchall]` is a fallback for all routes
17
+ */
18
+ filter: (route: RouteDefinition) => boolean;
19
+
20
+ /**
21
+ * A function that is invoked once the entry has been created. This is where you
22
+ * should write the function to the filesystem and generate redirect manifests.
23
+ */
24
+ complete: (entry: {
25
+ generateManifest: (opts: { relativePath: string; format?: 'esm' | 'cjs' }) => string;
26
+ }) => MaybePromise<void>;
27
+ }
28
+
29
+ export type BodyValidator<T> = {
30
+ [P in keyof T]: T[P] extends { [k: string]: unknown }
31
+ ? BodyValidator<T[P]> // recurse when T[P] is an object
32
+ : T[P] extends BigInt | Function | Symbol
33
+ ? never
34
+ : T[P];
35
+ };
36
+
37
+ // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts
38
+ //
39
+ // MIT License
40
+ //
41
+ // Copyright (c) 2021-present, Joshua Hemphill
42
+ // Copyright (c) 2021, Tecnico Corporation
43
+ //
44
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ // of this software and associated documentation files (the "Software"), to deal
46
+ // in the Software without restriction, including without limitation the rights
47
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ // copies of the Software, and to permit persons to whom the Software is
49
+ // furnished to do so, subject to the following conditions:
50
+ //
51
+ // The above copyright notice and this permission notice shall be included in all
52
+ // copies or substantial portions of the Software.
53
+ //
54
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ // SOFTWARE.
61
+
62
+ export namespace Csp {
63
+ type ActionSource = 'strict-dynamic' | 'report-sample';
64
+ type BaseSource = 'self' | 'unsafe-eval' | 'unsafe-hashes' | 'unsafe-inline' | 'none';
65
+ type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`;
66
+ type FrameSource = HostSource | SchemeSource | 'self' | 'none';
67
+ type HostNameScheme = `${string}.${string}` | 'localhost';
68
+ type HostSource = `${HostProtocolSchemes}${HostNameScheme}${PortScheme}`;
69
+ type HostProtocolSchemes = `${string}://` | '';
70
+ type HttpDelineator = '/' | '?' | '#' | '\\';
71
+ type PortScheme = `:${number}` | '' | ':*';
72
+ type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
73
+ type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
74
+ type Sources = Source[];
75
+ type UriPath = `${HttpDelineator}${string}`;
76
+ }
77
+
78
+ export interface CspDirectives {
79
+ 'child-src'?: Csp.Sources;
80
+ 'default-src'?: Array<Csp.Source | Csp.ActionSource>;
81
+ 'frame-src'?: Csp.Sources;
82
+ 'worker-src'?: Csp.Sources;
83
+ 'connect-src'?: Csp.Sources;
84
+ 'font-src'?: Csp.Sources;
85
+ 'img-src'?: Csp.Sources;
86
+ 'manifest-src'?: Csp.Sources;
87
+ 'media-src'?: Csp.Sources;
88
+ 'object-src'?: Csp.Sources;
89
+ 'prefetch-src'?: Csp.Sources;
90
+ 'script-src'?: Array<Csp.Source | Csp.ActionSource>;
91
+ 'script-src-elem'?: Csp.Sources;
92
+ 'script-src-attr'?: Csp.Sources;
93
+ 'style-src'?: Array<Csp.Source | Csp.ActionSource>;
94
+ 'style-src-elem'?: Csp.Sources;
95
+ 'style-src-attr'?: Csp.Sources;
96
+ 'base-uri'?: Array<Csp.Source | Csp.ActionSource>;
97
+ sandbox?: Array<
98
+ | 'allow-downloads-without-user-activation'
99
+ | 'allow-forms'
100
+ | 'allow-modals'
101
+ | 'allow-orientation-lock'
102
+ | 'allow-pointer-lock'
103
+ | 'allow-popups'
104
+ | 'allow-popups-to-escape-sandbox'
105
+ | 'allow-presentation'
106
+ | 'allow-same-origin'
107
+ | 'allow-scripts'
108
+ | 'allow-storage-access-by-user-activation'
109
+ | 'allow-top-navigation'
110
+ | 'allow-top-navigation-by-user-activation'
111
+ >;
112
+ 'form-action'?: Array<Csp.Source | Csp.ActionSource>;
113
+ 'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
114
+ 'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
115
+ 'report-uri'?: Csp.UriPath[];
116
+ 'report-to'?: string[];
117
+
118
+ 'require-trusted-types-for'?: Array<'script'>;
119
+ 'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>;
120
+ 'upgrade-insecure-requests'?: boolean;
121
+
122
+ /** @deprecated */
123
+ 'require-sri-for'?: Array<'script' | 'style' | 'script style'>;
124
+
125
+ /** @deprecated */
126
+ 'block-all-mixed-content'?: boolean;
127
+
128
+ /** @deprecated */
129
+ 'plugin-types'?: Array<`${string}/${string}` | 'none'>;
130
+
131
+ /** @deprecated */
132
+ referrer?: Array<
133
+ | 'no-referrer'
134
+ | 'no-referrer-when-downgrade'
135
+ | 'origin'
136
+ | 'origin-when-cross-origin'
137
+ | 'same-origin'
138
+ | 'strict-origin'
139
+ | 'strict-origin-when-cross-origin'
140
+ | 'unsafe-url'
141
+ | 'none'
142
+ >;
143
+ }
144
+
145
+ export type HttpMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'patch';
146
+
147
+ export interface JSONObject {
148
+ [key: string]: JSONValue;
149
+ }
150
+
151
+ export type JSONValue =
152
+ | string
153
+ | number
154
+ | boolean
155
+ | null
156
+ | undefined
157
+ | ToJSON
158
+ | JSONValue[]
159
+ | JSONObject;
160
+
161
+ export interface Logger {
162
+ (msg: string): void;
163
+ success(msg: string): void;
164
+ error(msg: string): void;
165
+ warn(msg: string): void;
166
+ minor(msg: string): void;
167
+ info(msg: string): void;
168
+ }
169
+
170
+ export type MaybePromise<T> = T | Promise<T>;
171
+
172
+ export interface Prerendered {
173
+ pages: Map<
174
+ string,
175
+ {
176
+ /** The location of the .html file relative to the output directory */
177
+ file: string;
178
+ }
179
+ >;
180
+ assets: Map<
181
+ string,
182
+ {
183
+ /** The MIME type of the asset */
184
+ type: string;
185
+ }
186
+ >;
187
+ redirects: Map<
188
+ string,
189
+ {
190
+ status: number;
191
+ location: string;
192
+ }
193
+ >;
194
+ /** An array of prerendered paths (without trailing slashes, regardless of the trailingSlash config) */
195
+ paths: string[];
196
+ }
197
+
198
+ export interface PrerenderErrorHandler {
199
+ (details: {
200
+ status: number;
201
+ path: string;
202
+ referrer: string | null;
203
+ referenceType: 'linked' | 'fetched';
204
+ }): void;
205
+ }
206
+
207
+ export type PrerenderOnErrorValue = 'fail' | 'continue' | PrerenderErrorHandler;
208
+
209
+ export interface RequestOptions {
210
+ getClientAddress: () => string;
211
+ platform?: App.Platform;
212
+ }
213
+
214
+ /** `string[]` is only for set-cookie, everything else must be type of `string` */
215
+ export type ResponseHeaders = Record<string, string | number | string[]>;
216
+
217
+ export interface RouteDefinition {
218
+ id: string;
219
+ type: 'page' | 'endpoint';
220
+ pattern: RegExp;
221
+ segments: RouteSegment[];
222
+ methods: HttpMethod[];
223
+ }
224
+
225
+ export interface RouteSegment {
226
+ content: string;
227
+ dynamic: boolean;
228
+ rest: boolean;
229
+ }
230
+
231
+ export interface ToJSON {
232
+ toJSON(...args: any[]): Exclude<JSONValue, ToJSON>;
233
+ }
234
+
235
+ export type TrailingSlash = 'never' | 'always' | 'ignore';
package/CHANGELOG.md DELETED
@@ -1,377 +0,0 @@
1
- # @sveltejs/kit
2
-
3
- ## 1.0.0-next.36
4
-
5
- ### Patch Changes
6
-
7
- - 7b70a33: Force version bump so that Kit uses updated vite-plugin-svelte
8
-
9
- ## 1.0.0-next.35
10
-
11
- ### Patch Changes
12
-
13
- - Use Vite
14
- - Fix Windows issues
15
- - Preserve load context during navigation
16
- - Return error from load
17
-
18
- ## 1.0.0-next.34
19
-
20
- ### Patch Changes
21
-
22
- - Fix adapters and convert to ES modules
23
-
24
- ## 1.0.0-next.33
25
-
26
- ### Patch Changes
27
-
28
- - 474070e: Better errors when modules cannot be found
29
-
30
- ## 1.0.0-next.32
31
-
32
- ### Patch Changes
33
-
34
- - Convert everything to ESM
35
-
36
- ## 1.0.0-next.31
37
-
38
- ### Patch Changes
39
-
40
- - b6c2434: app.js -> app.cjs
41
-
42
- ## 1.0.0-next.30
43
-
44
- ### Patch Changes
45
-
46
- - 00cbaf6: Rename _.config.js to _.config.cjs
47
-
48
- ## 1.0.0-next.29
49
-
50
- ### Patch Changes
51
-
52
- - 4c0edce: Use addEventListener instead of onload
53
-
54
- ## 1.0.0-next.28
55
-
56
- ### Patch Changes
57
-
58
- - 4353025: Prevent infinite loop when fetching bad URLs inside error responses
59
- - 2860065: Handle assets path when prerendering
60
-
61
- ## 1.0.0-next.27
62
-
63
- ### Patch Changes
64
-
65
- - Fail build if prerender errors
66
- - Hide logging behind --verbose option
67
-
68
- ## 1.0.0-next.26
69
-
70
- ### Patch Changes
71
-
72
- - Fix svelte-announcer CSS
73
-
74
- ## 1.0.0-next.25
75
-
76
- ### Patch Changes
77
-
78
- - Surface stack traces for endpoint/page rendering errors
79
-
80
- ## 1.0.0-next.24
81
-
82
- ### Patch Changes
83
-
84
- - 26643df: Account for config.paths when prerendering
85
-
86
- ## 1.0.0-next.23
87
-
88
- ### Patch Changes
89
-
90
- - 9b758aa: Upgrade to Snowpack 3
91
-
92
- ## 1.0.0-next.22
93
-
94
- ### Patch Changes
95
-
96
- - bb68595: use readFileSync instead of createReadStream
97
-
98
- ## 1.0.0-next.21
99
-
100
- ### Patch Changes
101
-
102
- - 217e4cc: Set paths to empty string before prerender
103
-
104
- ## 1.0.0-next.20
105
-
106
- ### Patch Changes
107
-
108
- - ccf4aa7: Implement prerender config
109
-
110
- ## 1.0.0-next.19
111
-
112
- ### Patch Changes
113
-
114
- - deda984: Make navigating store contain from and to properties
115
-
116
- ## 1.0.0-next.18
117
-
118
- ### Patch Changes
119
-
120
- - c29b61e: Announce page changes
121
- - 72da270: Reset focus properly
122
-
123
- ## 1.0.0-next.17
124
-
125
- ### Patch Changes
126
-
127
- - f7dea55: Set process.env.NODE_ENV when invoking via the CLI
128
-
129
- ## 1.0.0-next.16
130
-
131
- ### Patch Changes
132
-
133
- - Remove temporary logging
134
- - Add sveltekit:prefetch and sveltekit:noscroll
135
-
136
- ## 1.0.0-next.15
137
-
138
- ### Patch Changes
139
-
140
- - 6d1bb11: Fix AMP CSS
141
- - d8b53af: Ignore $layout and $error files when finding static paths
142
- - Better scroll tracking
143
-
144
- ## 1.0.0-next.14
145
-
146
- ### Patch Changes
147
-
148
- - Fix dev loader
149
-
150
- ## 1.0.0-next.13
151
-
152
- ### Patch Changes
153
-
154
- - 1ea4d6b: More robust CSS extraction
155
-
156
- ## 1.0.0-next.12
157
-
158
- ### Patch Changes
159
-
160
- - e7c88dd: Tweak AMP validation screen
161
-
162
- ## 1.0.0-next.11
163
-
164
- ### Patch Changes
165
-
166
- - a31f218: Fix SSR loader invalidation
167
-
168
- ## 1.0.0-next.10
169
-
170
- ### Patch Changes
171
-
172
- - 8b14d29: Omit svelte-data scripts from AMP pages
173
-
174
- ## 1.0.0-next.9
175
-
176
- ### Patch Changes
177
-
178
- - f5fa223: AMP support
179
- - 47f2ee1: Always remove trailing slashes
180
- - 1becb94: Replace preload with load
181
-
182
- ## 1.0.0-next.8
183
-
184
- ### Patch Changes
185
-
186
- - 15dd751: Use meta http-equiv=refresh
187
- - be7e031: Fix handling of static files
188
- - ed6b8fd: Implement \$app/env
189
-
190
- ## 1.0.0-next.7
191
-
192
- ### Patch Changes
193
-
194
- - 76705b0: make HMR work outside localhost
195
-
196
- ## 1.0.0-next.6
197
-
198
- ### Patch Changes
199
-
200
- - 0e45255: Move options behind kit namespace, change paths -> kit.files
201
- - fa7f2b2: Implement live bindings for SSR code
202
-
203
- ## 1.0.0-next.5
204
-
205
- ### Patch Changes
206
-
207
- - Return dependencies from render
208
-
209
- ## 1.0.0-next.4
210
-
211
- ### Patch Changes
212
-
213
- - af01b0d: Move renderer out of app assets folder
214
-
215
- ## 1.0.0-next.3
216
-
217
- ### Patch Changes
218
-
219
- - Add paths to manifest, for static prerendering
220
-
221
- ## 1.0.0-next.2
222
-
223
- ### Patch Changes
224
-
225
- - Fix typo causing misnamed assets folder
226
-
227
- ## 1.0.0-next.1
228
-
229
- ### Patch Changes
230
-
231
- - a4bc090: Transform exported functions correctly
232
- - 00bbf98: Fix nested layouts
233
-
234
- ## 0.0.31-next.0
235
-
236
- ### Patch Changes
237
-
238
- - ffd7bba: Fix SSR cache invalidation
239
-
240
- ## 0.0.30
241
-
242
- ### Patch Changes
243
-
244
- - Add back stores(), but with deprecation warning
245
- - Rename stores.preloading to stores.navigating
246
- - Rewrite routing logic
247
-
248
- ## 0.0.29
249
-
250
- ### Patch Changes
251
-
252
- - 10872cc: Normalize request.query
253
-
254
- ## 0.0.28
255
-
256
- ### Patch Changes
257
-
258
- - Add svelte-kit start command
259
-
260
- ## 0.0.27
261
-
262
- ### Patch Changes
263
-
264
- - rename CLI to svelte-kit
265
- - 0904e22: rename svelte CLI to svelte-kit
266
- - Validate route responses
267
- - Make paths and target configurable
268
-
269
- ## 0.0.26
270
-
271
- ### Patch Changes
272
-
273
- - b475ed4: Overhaul adapter API - fixes #166
274
- - Updated dependencies [b475ed4]
275
- - @sveltejs/app-utils@0.0.18
276
-
277
- ## 0.0.25
278
-
279
- ### Patch Changes
280
-
281
- - Updated dependencies [3bdf33b]
282
- - @sveltejs/app-utils@0.0.17
283
-
284
- ## 0.0.24
285
-
286
- ### Patch Changes
287
-
288
- - 67eaeea: Move app-utils stuff into subpackages
289
- - 7f8df30: Move kit runtime code, expose via \$app aliases
290
- - Updated dependencies [67eaeea]
291
- - @sveltejs/app-utils@0.0.16
292
-
293
- ## 0.0.23
294
-
295
- ### Patch Changes
296
-
297
- - a163000: Parse body on incoming requests
298
- - a346eab: Copy over latest Sapper router code
299
- - Updated dependencies [a163000]
300
- - @sveltejs/app-utils@0.0.15
301
-
302
- ## 0.0.22
303
-
304
- ### Patch Changes
305
-
306
- - Force bump version
307
-
308
- ## 0.0.21
309
-
310
- ### Patch Changes
311
-
312
- - Build setup entry point
313
- - Work around pkg.exports constraint
314
- - Respond with 500s if render fails
315
- - Updated dependencies [undefined]
316
- - Updated dependencies [undefined]
317
- - Updated dependencies [undefined]
318
- - @sveltejs/app-utils@0.0.14
319
-
320
- ## 0.0.20
321
-
322
- ### Patch Changes
323
-
324
- - Pass setup module to renderer
325
- - Bump Snowpack version
326
- - Updated dependencies [undefined]
327
- - Updated dependencies [96c06d8]
328
- - @sveltejs/app-utils@0.0.13
329
-
330
- ## 0.0.19
331
-
332
- ### Patch Changes
333
-
334
- - fa9d7ce: Handle import.meta in SSR module loader
335
- - 0320208: Rename 'server route' to 'endpoint'
336
- - b9444d2: Update to Snowpack 2.15
337
- - 5ca907c: Use shared mkdirp helper
338
- - Updated dependencies [0320208]
339
- - Updated dependencies [5ca907c]
340
- - @sveltejs/app-utils@0.0.12
341
-
342
- ## 0.0.18
343
-
344
- ### Patch Changes
345
-
346
- - Updated dependencies [undefined]
347
- - @sveltejs/app-utils@0.0.11
348
-
349
- ## 0.0.17
350
-
351
- ### Patch Changes
352
-
353
- - 19323e9: Update Snowpack
354
- - Updated dependencies [19323e9]
355
- - @sveltejs/app-utils@0.0.10
356
-
357
- ## 0.0.16
358
-
359
- ### Patch Changes
360
-
361
- - Updated dependencies [90a98ae]
362
- - @sveltejs/app-utils@0.0.9
363
-
364
- ## 0.0.15
365
-
366
- ### Patch Changes
367
-
368
- - Updated dependencies [undefined]
369
- - @sveltejs/app-utils@0.0.8
370
-
371
- ## 0.0.14
372
-
373
- ### Patch Changes
374
-
375
- - various
376
- - Updated dependencies [undefined]
377
- - @sveltejs/app-utils@0.0.7
@@ -1,23 +0,0 @@
1
- import { router, renderer } from '../internal/singletons.js';
2
- import { g as get_base_uri } from '../utils-85ebcc60.js';
3
-
4
- async function goto(href, opts) {
5
- return router.goto(href, opts);
6
- }
7
-
8
- function prefetch(href) {
9
- return renderer.prefetch(new URL(href, get_base_uri(document)));
10
- }
11
-
12
- async function prefetchRoutes(pathnames) {
13
- const path_routes = pathnames
14
- ? router.pages.filter((page) => pathnames.some((pathname) => page.pattern.test(pathname)))
15
- : router.pages;
16
-
17
- const promises = path_routes.map((r) => Promise.all(r.parts.map((load) => load())));
18
-
19
- await Promise.all(promises);
20
- }
21
-
22
- export { goto, prefetch, prefetchRoutes };
23
- //# sourceMappingURL=navigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation.js","sources":["../../../src/runtime/app/navigation/index.js"],"sourcesContent":["import { router, renderer } from '../../internal/singletons';\nimport { get_base_uri } from '../../internal/utils';\n\nexport async function goto(href, opts) {\n\treturn router.goto(href, opts);\n}\n\nexport function prefetch(href) {\n\treturn renderer.prefetch(new URL(href, get_base_uri(document)));\n}\n\nexport async function prefetchRoutes(pathnames) {\n\tconst path_routes = pathnames\n\t\t? router.pages.filter((page) => pathnames.some((pathname) => page.pattern.test(pathname)))\n\t\t: router.pages;\n\n\tconst promises = path_routes.map((r) => Promise.all(r.parts.map((load) => load())));\n\n\tawait Promise.all(promises);\n}\n"],"names":[],"mappings":";;;AAGO,eAAe,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;AACvC,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AACD;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC/B,CAAC,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AACD;AACO,eAAe,cAAc,CAAC,SAAS,EAAE;AAChD,CAAC,MAAM,WAAW,GAAG,SAAS;AAC9B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5F,IAAI,MAAM,CAAC,KAAK,CAAC;AACjB;AACA,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF;AACA,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7B;;;;"}
@@ -1,2 +0,0 @@
1
- export { assets, base } from '../internal/singletons.js';
2
- //# sourceMappingURL=paths.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}