@sveltejs/kit 3.0.0-next.13 → 3.0.0-next.14
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.
- package/package.json +2 -2
- package/src/cli.js +2 -2
- package/src/core/adapt/builder.js +8 -5
- package/src/core/generate_manifest/index.js +6 -0
- package/src/core/postbuild/entities.js +8 -2
- package/src/core/postbuild/fallback.js +2 -1
- package/src/core/postbuild/prerender.js +12 -3
- package/src/core/sync/create_manifest_data/conflict.js +1 -1
- package/src/core/sync/create_manifest_data/index.js +33 -2
- package/src/core/sync/write_app_types.js +72 -27
- package/src/core/sync/write_tsconfig/index.js +2 -1
- package/src/core/sync/write_types/index.js +5 -2
- package/src/exports/node/index.js +2 -7
- package/src/exports/public.d.ts +3 -2
- package/src/exports/vite/index.js +45 -11
- package/src/exports/vite/utils.js +1 -7
- package/src/runtime/app/server/remote/query.js +0 -6
- package/src/runtime/client/client.js +148 -38
- package/src/runtime/client/fetcher.js +2 -13
- package/src/runtime/client/remote-functions/form.svelte.js +3 -7
- package/src/runtime/client/remote-functions/prerender.svelte.js +1 -1
- package/src/runtime/client/remote-functions/query/index.js +1 -1
- package/src/runtime/client/remote-functions/query-batch.svelte.js +1 -1
- package/src/runtime/client/remote-functions/query-live/proxy.js +0 -10
- package/src/runtime/client/remote-functions/shared.svelte.js +1 -1
- package/src/runtime/client/utils.js +1 -0
- package/src/runtime/form-utils.js +4 -6
- package/src/runtime/pathname.js +37 -0
- package/src/runtime/server/fetch.js +5 -8
- package/src/runtime/server/index.js +10 -24
- package/src/runtime/server/page/crypto.js +2 -2
- package/src/runtime/server/page/csp.js +2 -1
- package/src/runtime/server/page/load_data.js +2 -29
- package/src/runtime/server/page/render.js +19 -1
- package/src/runtime/server/page/serialize_data.js +2 -13
- package/src/runtime/server/page/server_routing.js +58 -9
- package/src/runtime/server/respond.js +20 -27
- package/src/runtime/server/state.js +43 -0
- package/src/runtime/shared.js +4 -2
- package/src/runtime/utils.js +3 -0
- package/src/types/ambient-private.d.ts +1 -1
- package/src/types/ambient.d.ts +58 -7
- package/src/types/global-private.d.ts +1 -1
- package/src/types/internal.d.ts +2 -1
- package/src/utils/hash.js +21 -0
- package/src/utils/http.js +8 -7
- package/src/utils/import.js +2 -1
- package/src/utils/params.js +1 -1
- package/src/utils/regex.js +9 -0
- package/src/utils/routing.js +52 -27
- package/src/utils/url.js +1 -0
- package/src/version.js +1 -1
- package/types/index.d.ts +74 -10
- package/types/index.d.ts.map +1 -1
- package/src/exports/node/polyfills.js +0 -30
package/src/utils/routing.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import { BROWSER } from 'esm-env';
|
|
2
|
+
import { escape_for_regexp } from './regex.js';
|
|
2
3
|
|
|
3
4
|
const param_pattern = /^(\[)?(\.\.\.)?([\w-]+)(?:=([\w-]+))?(\])?$/;
|
|
4
5
|
|
|
5
6
|
const root_group_pattern = /^\/\((?:[^)]+)\)$/;
|
|
6
7
|
|
|
8
|
+
const escape_sequence_pattern = /\[([ux])\+([^\]]+)\]/;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Decodes the codepoints of an `[x+nn]` or `[u+nnnn]` escape sequence
|
|
12
|
+
* @param {string} code the sequence without its `[x+`/`[u+` prefix or `]` suffix
|
|
13
|
+
*/
|
|
14
|
+
export function decode_escape_sequence(code) {
|
|
15
|
+
return String.fromCodePoint(...code.split('-').map((codepoint) => parseInt(codepoint, 16)));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Encodes the characters that `decode_pathname` leaves untouched, so that a decoded
|
|
20
|
+
* escape sequence still matches the pattern `parse_route_id` builds for it
|
|
21
|
+
* @param {string} str
|
|
22
|
+
*/
|
|
23
|
+
export function encode_pathname_chars(str) {
|
|
24
|
+
return str.replace(
|
|
25
|
+
/[%/?#]/g,
|
|
26
|
+
(char) => '%' + char.charCodeAt(0).toString(16).toUpperCase().padStart(2, '0')
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
7
30
|
/**
|
|
8
31
|
* Creates the regex pattern, extracts parameter names, and generates types for a route
|
|
9
32
|
* @param {string} id
|
|
@@ -51,19 +74,8 @@ export function parse_route_id(id) {
|
|
|
51
74
|
const result = parts
|
|
52
75
|
.map((content, i) => {
|
|
53
76
|
if (i % 2) {
|
|
54
|
-
if (content.startsWith('x+')) {
|
|
55
|
-
return escape(
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (content.startsWith('u+')) {
|
|
59
|
-
return escape(
|
|
60
|
-
String.fromCharCode(
|
|
61
|
-
...content
|
|
62
|
-
.slice(2)
|
|
63
|
-
.split('-')
|
|
64
|
-
.map((code) => parseInt(code, 16))
|
|
65
|
-
)
|
|
66
|
-
);
|
|
77
|
+
if (content.startsWith('x+') || content.startsWith('u+')) {
|
|
78
|
+
return escape(decode_escape_sequence(content.slice(2)));
|
|
67
79
|
}
|
|
68
80
|
|
|
69
81
|
// We know the match cannot be null in the browser because manifest generation
|
|
@@ -243,25 +255,36 @@ export function exec(match, params, matchers) {
|
|
|
243
255
|
return result;
|
|
244
256
|
}
|
|
245
257
|
|
|
258
|
+
/**
|
|
259
|
+
* `decode_pathname` leaves these characters untouched, so routes have to match their encoded forms
|
|
260
|
+
* @type {Record<string, string>}
|
|
261
|
+
*/
|
|
262
|
+
const encoded = {
|
|
263
|
+
'%': '%25',
|
|
264
|
+
'/': '%2[Ff]',
|
|
265
|
+
'?': '%3[Ff]',
|
|
266
|
+
'#': '%23'
|
|
267
|
+
};
|
|
268
|
+
|
|
246
269
|
/** @param {string} str */
|
|
247
270
|
function escape(str) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.replace(/%/g, '%25')
|
|
255
|
-
.replace(/\//g, '%2[Ff]')
|
|
256
|
-
.replace(/\?/g, '%3[Ff]')
|
|
257
|
-
.replace(/#/g, '%23')
|
|
258
|
-
// escape characters that have special meaning in regex
|
|
259
|
-
.replace(/[.*+?^${}()|\\]/g, '\\$&')
|
|
260
|
-
);
|
|
271
|
+
// the replacements in `encoded` are regex source themselves, so they must not be escaped again
|
|
272
|
+
return str
|
|
273
|
+
.normalize()
|
|
274
|
+
.split(/([%/?#])/)
|
|
275
|
+
.map((part, i) => (i % 2 ? encoded[part] : escape_for_regexp(part)))
|
|
276
|
+
.join('');
|
|
261
277
|
}
|
|
262
278
|
|
|
263
279
|
const basic_param_pattern = /\[(\[)?(\.\.\.)?([\w-]+?)(?:=([\w-]+))?\]\]?/g;
|
|
264
280
|
|
|
281
|
+
// escape sequences are expanded in the same pass as the params, so that a param
|
|
282
|
+
// value containing `[x+2f]` is not itself expanded
|
|
283
|
+
export const segment_pattern = new RegExp(
|
|
284
|
+
`${escape_sequence_pattern.source}|${basic_param_pattern.source}`,
|
|
285
|
+
'g'
|
|
286
|
+
);
|
|
287
|
+
|
|
265
288
|
/**
|
|
266
289
|
* Populate a route ID with params to resolve a pathname.
|
|
267
290
|
* @example
|
|
@@ -286,7 +309,9 @@ export function resolve_route(id, params) {
|
|
|
286
309
|
'/' +
|
|
287
310
|
segments
|
|
288
311
|
.map((segment) =>
|
|
289
|
-
segment.replace(
|
|
312
|
+
segment.replace(segment_pattern, (_, escape_type, escape_code, optional, rest, name) => {
|
|
313
|
+
if (escape_type) return encode_pathname_chars(decode_escape_sequence(escape_code));
|
|
314
|
+
|
|
290
315
|
const value = params[name];
|
|
291
316
|
|
|
292
317
|
if (value === undefined || value === '') {
|
package/src/utils/url.js
CHANGED
|
@@ -46,6 +46,7 @@ export function relative_pathname(from, to) {
|
|
|
46
46
|
export function matches_external_allowlist_entry(location, allowed) {
|
|
47
47
|
if (location === allowed) return true;
|
|
48
48
|
|
|
49
|
+
// TODO replace the try/catch with `URL.parse` when browser support allows (Chrome 126, Firefox 126, Safari 18)
|
|
49
50
|
try {
|
|
50
51
|
const allow = new URL(allowed);
|
|
51
52
|
const loc = new URL(location, allow);
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -225,8 +225,9 @@ declare module '@sveltejs/kit' {
|
|
|
225
225
|
/**
|
|
226
226
|
* Compress files in `directory` with gzip and brotli, where appropriate. Generates `.gz` and `.br` files alongside the originals.
|
|
227
227
|
* @param directory The directory containing the files to be compressed
|
|
228
|
+
* @returns an array of the files in `directory` that were compressed
|
|
228
229
|
*/
|
|
229
|
-
compress: (directory: string) => Promise<
|
|
230
|
+
compress: (directory: string) => Promise<string[]>;
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
/**
|
|
@@ -834,7 +835,7 @@ declare module '@sveltejs/kit' {
|
|
|
834
835
|
* A function that allows you to edit the generated `tsconfig.json`. You can mutate the config (recommended) or return a new one.
|
|
835
836
|
* This is useful for extending a shared `tsconfig.json` in a monorepo root, for example.
|
|
836
837
|
*
|
|
837
|
-
* Note that any paths configured here should be relative to the generated config file, which is written to `node_modules/$app/tsconfig
|
|
838
|
+
* Note that any paths configured here should be relative to the generated config file, which is written to `node_modules/$app/tsconfig.json`.
|
|
838
839
|
*
|
|
839
840
|
* @default (config) => config
|
|
840
841
|
* @since 1.3.0
|
|
@@ -3132,6 +3133,7 @@ declare module '$app/forms' {
|
|
|
3132
3133
|
}
|
|
3133
3134
|
|
|
3134
3135
|
declare module '$app/navigation' {
|
|
3136
|
+
import type { RouteId } from '$app/types';
|
|
3135
3137
|
/**
|
|
3136
3138
|
* A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL.
|
|
3137
3139
|
*
|
|
@@ -3237,13 +3239,24 @@ declare module '$app/navigation' {
|
|
|
3237
3239
|
* Programmatically imports the code for routes that haven't yet been fetched.
|
|
3238
3240
|
* Typically, you might call this to speed up subsequent navigation.
|
|
3239
3241
|
*
|
|
3240
|
-
*
|
|
3242
|
+
* Takes a route ID such as `/about` or `/blog/[slug]`. Unlike pathnames, route IDs
|
|
3243
|
+
* are never prefixed with the app's [base path](https://svelte.dev/docs/kit/configuration#paths).
|
|
3244
|
+
* If you have a pathname rather than a route ID, you can convert it with
|
|
3245
|
+
* [`match`](https://svelte.dev/docs/kit/$app-paths#match) from `$app/paths`:
|
|
3246
|
+
*
|
|
3247
|
+
* ```js
|
|
3248
|
+
* import { match } from '$app/paths';
|
|
3249
|
+
* import { preloadCode } from '$app/navigation';
|
|
3250
|
+
*
|
|
3251
|
+
* const matched = await match('/blog/hello-world');
|
|
3252
|
+
* if (matched) await preloadCode(matched.id);
|
|
3253
|
+
* ```
|
|
3241
3254
|
*
|
|
3242
3255
|
* Unlike `preloadData`, this won't call `load` functions.
|
|
3243
3256
|
* Returns a Promise that resolves when the modules have been imported.
|
|
3244
3257
|
*
|
|
3245
3258
|
* */
|
|
3246
|
-
export function preloadCode(
|
|
3259
|
+
export function preloadCode(id: RouteId): Promise<void>;
|
|
3247
3260
|
/**
|
|
3248
3261
|
* Programmatically create a new history entry with the given `page.state`. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).
|
|
3249
3262
|
*
|
|
@@ -3753,9 +3766,41 @@ declare module '$app/manifest' {
|
|
|
3753
3766
|
*/
|
|
3754
3767
|
export const prerendered: Array<{ path: import('$app/types').Path }>;
|
|
3755
3768
|
/**
|
|
3756
|
-
*
|
|
3769
|
+
* A route in your app, along with its capabilities. `page` indicates the presence of a `+page`,
|
|
3770
|
+
* while `endpoint` indicates the presence of a `+server`. Both are `true` when both files exist.
|
|
3771
|
+
*/
|
|
3772
|
+
export type ManifestRoute =
|
|
3773
|
+
| {
|
|
3774
|
+
id: Exclude<import('$app/types').PageRouteId, import('$app/types').EndpointRouteId>;
|
|
3775
|
+
page: true;
|
|
3776
|
+
endpoint: false;
|
|
3777
|
+
}
|
|
3778
|
+
| {
|
|
3779
|
+
id: Exclude<import('$app/types').EndpointRouteId, import('$app/types').PageRouteId>;
|
|
3780
|
+
page: false;
|
|
3781
|
+
endpoint: true;
|
|
3782
|
+
}
|
|
3783
|
+
| {
|
|
3784
|
+
id: Extract<import('$app/types').PageRouteId, import('$app/types').EndpointRouteId>;
|
|
3785
|
+
page: true;
|
|
3786
|
+
endpoint: true;
|
|
3787
|
+
};
|
|
3788
|
+
/**
|
|
3789
|
+
* An array of objects representing the routes in your app. Only routes that the router can match
|
|
3790
|
+
* are included — directories that merely hold a `+layout` are not routes of their own.
|
|
3791
|
+
*
|
|
3792
|
+
* Each object has an `id`, plus `page` and `endpoint` booleans describing whether the route has a
|
|
3793
|
+
* `+page` and/or a `+server`. Both are `true` for a route that has both, so the capabilities can
|
|
3794
|
+
* be filtered independently:
|
|
3795
|
+
*
|
|
3796
|
+
* ```js
|
|
3797
|
+
* import { routes } from '$app/manifest';
|
|
3798
|
+
*
|
|
3799
|
+
* const pages = routes.filter((route) => route.page);
|
|
3800
|
+
* const endpoints = routes.filter((route) => route.endpoint);
|
|
3801
|
+
* ```
|
|
3757
3802
|
*/
|
|
3758
|
-
export const routes:
|
|
3803
|
+
export const routes: ManifestRoute[];
|
|
3759
3804
|
}
|
|
3760
3805
|
|
|
3761
3806
|
/**
|
|
@@ -3769,6 +3814,8 @@ declare module '$app/types' {
|
|
|
3769
3814
|
// These are all functions so that we can leverage function overloads to get the correct type.
|
|
3770
3815
|
// Using the return types directly would error with a "not the same type" error.
|
|
3771
3816
|
// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces
|
|
3817
|
+
PageRouteId(): string;
|
|
3818
|
+
EndpointRouteId(): string;
|
|
3772
3819
|
RouteId(): string;
|
|
3773
3820
|
RouteParams(): Record<string, Record<string, string>>;
|
|
3774
3821
|
LayoutParams(): Record<string, Record<string, string>>;
|
|
@@ -3778,7 +3825,21 @@ declare module '$app/types' {
|
|
|
3778
3825
|
}
|
|
3779
3826
|
|
|
3780
3827
|
/**
|
|
3781
|
-
* A union of
|
|
3828
|
+
* A union of the route IDs in your app that have a `+page`.
|
|
3829
|
+
*
|
|
3830
|
+
* A route ID can be in both `PageRouteId` and `EndpointRouteId`, if its directory contains both a `+page` and a `+server`.
|
|
3831
|
+
*/
|
|
3832
|
+
export type PageRouteId = ReturnType<AppTypes['PageRouteId']>;
|
|
3833
|
+
|
|
3834
|
+
/**
|
|
3835
|
+
* A union of the route IDs in your app that have a `+server`.
|
|
3836
|
+
*
|
|
3837
|
+
* A route ID can be in both `PageRouteId` and `EndpointRouteId`, if its directory contains both a `+page` and a `+server`.
|
|
3838
|
+
*/
|
|
3839
|
+
export type EndpointRouteId = ReturnType<AppTypes['EndpointRouteId']>;
|
|
3840
|
+
|
|
3841
|
+
/**
|
|
3842
|
+
* 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`.
|
|
3782
3843
|
*/
|
|
3783
3844
|
export type RouteId = ReturnType<AppTypes['RouteId']>;
|
|
3784
3845
|
|
|
@@ -3794,12 +3855,15 @@ declare module '$app/types' {
|
|
|
3794
3855
|
? ReturnType<AppTypes['RouteParams']>[T]
|
|
3795
3856
|
: Record<string, never>;
|
|
3796
3857
|
|
|
3858
|
+
/**
|
|
3859
|
+
* 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.
|
|
3860
|
+
*/
|
|
3861
|
+
type LayoutParamsId = keyof ReturnType<AppTypes['LayoutParams']>;
|
|
3862
|
+
|
|
3797
3863
|
/**
|
|
3798
3864
|
* 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.
|
|
3799
3865
|
*/
|
|
3800
|
-
export type LayoutParams<T extends
|
|
3801
|
-
? ReturnType<AppTypes['LayoutParams']>[T]
|
|
3802
|
-
: Record<string, never>;
|
|
3866
|
+
export type LayoutParams<T extends LayoutParamsId> = ReturnType<AppTypes['LayoutParams']>[T];
|
|
3803
3867
|
|
|
3804
3868
|
/**
|
|
3805
3869
|
* A union of all valid paths in your app, relative to the `base` path.
|
package/types/index.d.ts.map
CHANGED
|
@@ -226,6 +226,6 @@
|
|
|
226
226
|
null,
|
|
227
227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AELgD,qBAAqBA;;;;;;;;;;;;;;;;;;;;;cevQpBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCqCJC,IAAIA;;;;;cAQJC,UAAUA;;;;;;;;;;;cAMVC,OAAOA",
|
|
230
230
|
"ignoreList": []
|
|
231
231
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import buffer from 'node:buffer';
|
|
2
|
-
import { webcrypto as crypto } from 'node:crypto';
|
|
3
|
-
|
|
4
|
-
// `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0
|
|
5
|
-
const File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File;
|
|
6
|
-
|
|
7
|
-
/** @type {Record<string, any>} */
|
|
8
|
-
const globals = {
|
|
9
|
-
crypto,
|
|
10
|
-
File
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// exported for dev/preview and node environments
|
|
14
|
-
/**
|
|
15
|
-
* Make various web APIs available as globals:
|
|
16
|
-
* - `crypto`
|
|
17
|
-
* - `File`
|
|
18
|
-
*/
|
|
19
|
-
export function installPolyfills() {
|
|
20
|
-
for (const name in globals) {
|
|
21
|
-
if (name in globalThis) continue;
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(globalThis, name, {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: globals[name]
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|