@sveltejs/kit 3.0.0-next.17 → 3.0.0-next.19
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 +12 -5
- package/src/cli.js +1 -1
- package/src/constants.js +3 -0
- package/src/core/config/index.js +1 -1
- package/src/core/env.js +1 -1
- package/src/core/postbuild/analyse.js +1 -1
- package/src/core/postbuild/prerender.js +1 -1
- package/src/core/sync/create_manifest_data/index.js +9 -0
- package/src/core/sync/sync.js +22 -9
- package/src/core/sync/ts.js +1 -1
- package/src/core/sync/write_app_types.js +1 -1
- package/src/core/sync/write_client_manifest.js +1 -1
- package/src/core/sync/write_server.js +1 -3
- package/src/core/sync/write_tsconfig/index.js +1 -1
- package/src/core/sync/write_types/index.js +6 -3
- package/src/exports/index.js +9 -9
- package/src/exports/internal/server/event.js +1 -1
- package/src/exports/internal/server/telemetry.js +1 -1
- package/src/exports/internal/shared.js +9 -0
- package/src/exports/{params.js → params/index.js} +6 -4
- package/src/exports/params/public.d.ts +63 -0
- package/src/exports/public.d.ts +93 -453
- package/src/exports/vite/build/build_server.js +2 -2
- package/src/exports/vite/dev/index.js +2 -3
- package/src/exports/vite/index.js +17 -5
- package/src/pathname.js +55 -0
- package/src/runtime/app/{forms.js → forms/index.js} +9 -8
- package/src/runtime/app/forms/public.d.ts +2 -0
- package/src/runtime/app/forms/types.d.ts +56 -0
- package/src/runtime/app/{navigation.js → navigation/index.js} +2 -2
- package/src/runtime/app/navigation/public.d.ts +237 -0
- package/src/runtime/app/paths/client.js +14 -8
- package/src/runtime/app/paths/index.js +1 -1
- package/src/runtime/app/paths/internal/client.js +4 -0
- package/src/runtime/app/paths/internal/server.js +4 -0
- package/src/runtime/app/paths/internal.d.ts +3 -0
- package/src/runtime/app/paths/public.d.ts +1 -1
- package/src/runtime/app/paths/server.js +6 -4
- package/src/runtime/app/server/index.js +1 -1
- package/src/runtime/app/server/remote/form.js +3 -4
- package/src/runtime/app/server/remote/prerender.js +3 -3
- package/src/runtime/app/server/remote/shared.js +3 -10
- package/src/runtime/app/state/index.js +4 -2
- package/src/runtime/app/state/public.d.ts +72 -0
- package/src/runtime/app/stores.js +2 -2
- package/src/runtime/client/client.js +65 -54
- package/src/runtime/client/entry.js +2 -2
- package/src/runtime/client/remote-functions/command.svelte.js +36 -34
- package/src/runtime/client/remote-functions/form.svelte.js +76 -78
- package/src/runtime/client/remote-functions/prerender.svelte.js +3 -3
- package/src/runtime/client/remote-functions/query/index.js +1 -1
- package/src/runtime/client/remote-functions/query/instance.svelte.js +4 -3
- package/src/runtime/client/remote-functions/query-batch.svelte.js +3 -3
- package/src/runtime/client/remote-functions/query-live/instance.svelte.js +5 -5
- package/src/runtime/client/remote-functions/query-live/iterator.js +5 -7
- package/src/runtime/client/remote-functions/shared.svelte.js +9 -14
- package/src/runtime/client/state.svelte.js +5 -3
- package/src/runtime/client/types.d.ts +2 -1
- package/src/runtime/pathname.js +6 -61
- package/src/runtime/props.svelte.js +1 -1
- package/src/runtime/server/constants.js +0 -3
- package/src/runtime/server/csrf.js +1 -1
- package/src/runtime/server/errors.js +53 -28
- package/src/runtime/server/fetch.js +1 -1
- package/src/runtime/server/index.js +9 -14
- package/src/runtime/server/page/actions.js +2 -1
- package/src/runtime/server/page/index.js +7 -3
- package/src/runtime/server/page/load_data.js +1 -1
- package/src/runtime/server/page/render.js +17 -11
- package/src/runtime/server/page/server_routing.js +3 -2
- package/src/runtime/server/remote-functions.js +3 -2
- package/src/runtime/server/respond.js +4 -8
- package/src/runtime/server/state.js +3 -6
- package/src/types/ambient.d.ts +1 -1
- package/src/types/internal.d.ts +8 -10
- package/src/types/private.d.ts +12 -3
- package/src/utils/error.js +30 -14
- package/src/utils/page_nodes.js +3 -2
- package/src/utils/params.js +3 -2
- package/src/utils/routing.js +5 -4
- package/src/version.js +1 -1
- package/types/index.d.ts +1005 -935
- package/types/index.d.ts.map +43 -31
- /package/src/{runtime/telemetry/noop.js → telemetry.js} +0 -0
package/src/utils/routing.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @import { ParamMatcher, ParamValue } from '@sveltejs/kit/params' */
|
|
1
2
|
import { BROWSER } from 'esm-env';
|
|
2
3
|
import { escape_for_regexp } from './regex.js';
|
|
3
4
|
|
|
@@ -146,7 +147,7 @@ export function get_route_segments(route) {
|
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
/**
|
|
149
|
-
* @param {
|
|
150
|
+
* @param {ParamMatcher} matcher
|
|
150
151
|
* @param {string} value
|
|
151
152
|
* @returns {{ success: true, value: any } | { success: false }}
|
|
152
153
|
*/
|
|
@@ -178,7 +179,7 @@ function run_matcher(matcher, value) {
|
|
|
178
179
|
/**
|
|
179
180
|
* @param {RegExpMatchArray} match
|
|
180
181
|
* @param {import('types').RouteParam[]} params
|
|
181
|
-
* @param {Record<string,
|
|
182
|
+
* @param {Record<string, ParamMatcher>} matchers
|
|
182
183
|
*/
|
|
183
184
|
export function exec(match, params, matchers) {
|
|
184
185
|
/** @type {Record<string, any>} */
|
|
@@ -298,7 +299,7 @@ export const segment_pattern = new RegExp(
|
|
|
298
299
|
* ); // `/blog/hello-world/something/else`
|
|
299
300
|
* ```
|
|
300
301
|
* @param {string} id
|
|
301
|
-
* @param {Record<string,
|
|
302
|
+
* @param {Record<string, ParamValue | undefined>} params
|
|
302
303
|
* @returns {string}
|
|
303
304
|
*/
|
|
304
305
|
export function resolve_route(id, params) {
|
|
@@ -360,7 +361,7 @@ export function has_server_load(node) {
|
|
|
360
361
|
* @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route
|
|
361
362
|
* @param {string} path - The decoded pathname to match
|
|
362
363
|
* @param {Route[]} routes
|
|
363
|
-
* @param {Record<string,
|
|
364
|
+
* @param {Record<string, ParamMatcher>} matchers
|
|
364
365
|
* @returns {{ route: Route, params: Record<string, any> } | null}
|
|
365
366
|
*/
|
|
366
367
|
export function find_route(path, routes, matchers) {
|
package/src/version.js
CHANGED