@sveltejs/kit 2.65.0 → 2.65.2
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 +3 -3
- package/src/core/adapt/builder.js +20 -5
- package/src/core/env.js +7 -3
- package/src/core/postbuild/analyse.js +4 -1
- package/src/core/postbuild/prerender.js +13 -4
- package/src/core/sync/write_client_manifest.js +5 -0
- package/src/core/sync/write_server.js +1 -2
- package/src/exports/internal/env.js +1 -1
- package/src/exports/public.d.ts +13 -1
- package/src/exports/vite/build/build_server.js +6 -1
- package/src/exports/vite/build/build_service_worker.js +18 -2
- package/src/exports/vite/index.js +40 -13
- package/src/exports/vite/preview/index.js +13 -4
- package/src/runtime/client/client.js +9 -3
- package/src/runtime/client/fetcher.js +3 -2
- package/src/runtime/client/remote-functions/form.svelte.js +3 -2
- package/src/runtime/client/remote-functions/prerender.svelte.js +5 -0
- package/src/runtime/client/remote-functions/query/instance.svelte.js +25 -9
- package/src/runtime/client/remote-functions/query-live/instance.svelte.js +1 -0
- package/src/runtime/client/remote-functions/shared.svelte.js +7 -1
- package/src/runtime/server/page/render.js +7 -13
- package/src/runtime/server/remote.js +9 -3
- package/src/types/internal.d.ts +3 -1
- package/src/version.js +1 -1
- package/types/index.d.ts +24 -7
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "2.65.
|
|
3
|
+
"version": "2.65.2",
|
|
4
4
|
"description": "SvelteKit is the fastest way to build Svelte apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@types/connect": "^3.4.38",
|
|
39
39
|
"@types/node": "^18.19.130",
|
|
40
40
|
"@types/set-cookie-parser": "^2.4.7",
|
|
41
|
-
"dts-buddy": "^0.8.
|
|
41
|
+
"dts-buddy": "^0.8.1",
|
|
42
42
|
"jsdom": "^26.1.0",
|
|
43
43
|
"rollup": "^4.59.0",
|
|
44
44
|
"svelte": "^5.56.3",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
46
|
-
"vite": "^6.4.
|
|
46
|
+
"vite": "^6.4.3",
|
|
47
47
|
"vitest": "^4.1.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -193,12 +193,12 @@ export function create_builder({
|
|
|
193
193
|
},
|
|
194
194
|
|
|
195
195
|
generateEnvModule() {
|
|
196
|
-
if (!build_data.client?.uses_env_dynamic_public) return;
|
|
197
|
-
|
|
198
|
-
const dest = `${config.kit.outDir}/output/prerendered/dependencies/${config.kit.appDir}/env.js`;
|
|
199
196
|
const env = get_env(config.kit.env, vite_config.mode);
|
|
200
197
|
|
|
201
|
-
const
|
|
198
|
+
const dest = `${config.kit.outDir}/output/prerendered/dependencies/${config.kit.appDir}`;
|
|
199
|
+
|
|
200
|
+
/** @type {string} */
|
|
201
|
+
let payload;
|
|
202
202
|
|
|
203
203
|
if (config.kit.experimental.explicitEnvironmentVariables) {
|
|
204
204
|
const variables = explicit_env_config ?? {};
|
|
@@ -206,15 +206,30 @@ export function create_builder({
|
|
|
206
206
|
/** @type {Record<string, StandardSchemaV1.Issue[]>} */
|
|
207
207
|
const issues = {};
|
|
208
208
|
|
|
209
|
+
/** @type {Record<string, any>} */
|
|
210
|
+
const values = {};
|
|
211
|
+
|
|
209
212
|
for (const [name, config] of Object.entries(variables)) {
|
|
210
213
|
if (config.static || !config.public) continue;
|
|
211
214
|
values[name] = validate(variables, env.all[name], name, issues);
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
handle_issues(issues);
|
|
218
|
+
|
|
219
|
+
if (Object.keys(values).length === 0) return;
|
|
220
|
+
|
|
221
|
+
payload = devalue.uneval(values);
|
|
222
|
+
|
|
223
|
+
if (build_data.service_worker) {
|
|
224
|
+
write(`${dest}/env.script.js`, `globalThis.__sveltekit_sw={env:${payload}}`);
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
payload = devalue.uneval(env.public);
|
|
215
228
|
}
|
|
216
229
|
|
|
217
|
-
|
|
230
|
+
if (build_data.client?.uses_env_dynamic_public) {
|
|
231
|
+
write(`${dest}/env.js`, `export const env=${payload}`);
|
|
232
|
+
}
|
|
218
233
|
},
|
|
219
234
|
|
|
220
235
|
generateManifest({ relativePath, routes: subset }) {
|
package/src/core/env.js
CHANGED
|
@@ -72,6 +72,10 @@ export async function load_explicit_env(kit, file, mode) {
|
|
|
72
72
|
/** @type {Record<string, EnvVarConfig<any>>} */
|
|
73
73
|
let variables;
|
|
74
74
|
|
|
75
|
+
/** @type {import('../runtime/app/env/internal.js')} */ (
|
|
76
|
+
await server.ssrLoadModule(`${runtime_directory}/app/env/internal.js`)
|
|
77
|
+
).set_building();
|
|
78
|
+
|
|
75
79
|
try {
|
|
76
80
|
({ variables } = await server.ssrLoadModule(file));
|
|
77
81
|
|
|
@@ -157,7 +161,7 @@ export function create_dynamic_module(type, dev_values, disabled) {
|
|
|
157
161
|
|
|
158
162
|
/**
|
|
159
163
|
* Creates the `__sveltekit/env` module
|
|
160
|
-
* @param {Record<string, EnvVarConfig<any
|
|
164
|
+
* @param {Record<string, EnvVarConfig<any> | undefined> | null} variables
|
|
161
165
|
* @param {Record<string, string>} env
|
|
162
166
|
* @param {string | null} entry
|
|
163
167
|
*/
|
|
@@ -176,7 +180,7 @@ export function create_sveltekit_env(variables, env, entry) {
|
|
|
176
180
|
const issues = {};
|
|
177
181
|
|
|
178
182
|
for (const [name, config] of Object.entries(variables ?? {})) {
|
|
179
|
-
if (config
|
|
183
|
+
if (config?.static) {
|
|
180
184
|
if (config.public) {
|
|
181
185
|
const value = validate(variables ?? {}, env[name], name, issues);
|
|
182
186
|
declarations.push(`explicit_public_env.${name} = ${devalue.uneval(value)};`);
|
|
@@ -186,7 +190,7 @@ export function create_sveltekit_env(variables, env, entry) {
|
|
|
186
190
|
`const ${name} = validate(variables, env.${name}, ${JSON.stringify(name)}, issues);`
|
|
187
191
|
);
|
|
188
192
|
|
|
189
|
-
if (config
|
|
193
|
+
if (config?.public) {
|
|
190
194
|
setters.push(`explicit_public_env.${name} = ${name};`);
|
|
191
195
|
setters.push(`rendered_env.${name} = ${name};`);
|
|
192
196
|
} else {
|
|
@@ -58,10 +58,13 @@ async function analyse({
|
|
|
58
58
|
const public_env = filter_env(env, public_prefix, private_prefix);
|
|
59
59
|
internal.set_private_env(private_env);
|
|
60
60
|
internal.set_public_env(public_env);
|
|
61
|
-
internal.set_env(env);
|
|
62
61
|
internal.set_manifest(manifest);
|
|
63
62
|
internal.set_read_implementation((file) => createReadableStream(`${server_root}/server/${file}`));
|
|
64
63
|
|
|
64
|
+
/** @type {import('__sveltekit/env')} */
|
|
65
|
+
const { set_env } = await import(pathToFileURL(`${server_root}/server/env.js`).href);
|
|
66
|
+
set_env(env);
|
|
67
|
+
|
|
65
68
|
/** @type {import('types').ServerMetadata} */
|
|
66
69
|
const metadata = {
|
|
67
70
|
nodes: [],
|
|
@@ -43,14 +43,18 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
|
|
|
43
43
|
/** @type {import('types').ServerInternalModule} */
|
|
44
44
|
const internal = await import(pathToFileURL(`${out}/server/internal.js`).href);
|
|
45
45
|
|
|
46
|
-
/** @type {import('types').ServerModule} */
|
|
47
|
-
const { Server } = await import(pathToFileURL(`${out}/server/index.js`).href);
|
|
48
|
-
|
|
49
46
|
// configure `import { building } from '$app/environment'` and `$app/env` —
|
|
50
47
|
// essential we do this before analysing the code
|
|
51
48
|
internal.set_building();
|
|
52
49
|
internal.set_prerendering();
|
|
53
50
|
|
|
51
|
+
/** @type {import('__sveltekit/env')} */
|
|
52
|
+
const { set_env } = await import(pathToFileURL(`${out}/server/env.js`).href);
|
|
53
|
+
set_env(env);
|
|
54
|
+
|
|
55
|
+
/** @type {import('types').ServerModule} */
|
|
56
|
+
const { Server } = await import(pathToFileURL(`${out}/server/index.js`).href);
|
|
57
|
+
|
|
54
58
|
/**
|
|
55
59
|
* @template {{message: string}} T
|
|
56
60
|
* @template {Omit<T, 'message'>} K
|
|
@@ -382,6 +386,12 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
|
|
|
382
386
|
const type = headers['content-type'];
|
|
383
387
|
const is_html = response_type === REDIRECT || type === 'text/html';
|
|
384
388
|
|
|
389
|
+
if (!is_html && response.status === 200 && decoded.slice(config.paths.base.length + 1) === '') {
|
|
390
|
+
throw new Error(
|
|
391
|
+
`Cannot prerender a root +server.js that returns a non-HTML response - static hosts always serve an HTML file for \`${config.paths.base || '/'}\``
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
385
395
|
const file = output_filename(decoded, is_html);
|
|
386
396
|
const dest = `${config.outDir}/output/prerendered/${category}/${file}`;
|
|
387
397
|
|
|
@@ -499,7 +509,6 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
|
|
|
499
509
|
const public_env = filter_env(env, public_prefix, private_prefix);
|
|
500
510
|
internal.set_private_env(private_env);
|
|
501
511
|
internal.set_public_env(public_env);
|
|
502
|
-
internal.set_env(env);
|
|
503
512
|
internal.set_manifest(manifest);
|
|
504
513
|
internal.set_read_implementation((file) => createReadableStream(`${out}/server/${file}`));
|
|
505
514
|
|
|
@@ -140,6 +140,11 @@ export function write_client_manifest(kit, manifest_data, output, metadata) {
|
|
|
140
140
|
write_if_changed(
|
|
141
141
|
`${output}/app.js`,
|
|
142
142
|
dedent`
|
|
143
|
+
// in dev, this makes Vite inject its client as this module's first dependency,
|
|
144
|
+
// so that global constant replacements are installed before any other module
|
|
145
|
+
// (including user hooks) evaluates. In build it's inert.
|
|
146
|
+
import.meta.hot;
|
|
147
|
+
|
|
143
148
|
${
|
|
144
149
|
client_hooks_file
|
|
145
150
|
? `import * as client_hooks from '${relative_path(output, client_hooks_file)}';`
|
|
@@ -33,7 +33,6 @@ import root from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}';
|
|
|
33
33
|
import { set_building, set_prerendering } from '$app/env/internal';
|
|
34
34
|
import { set_assets } from '$app/paths/internal/server';
|
|
35
35
|
import { set_manifest, set_read_implementation } from '__sveltekit/server';
|
|
36
|
-
import { set_env } from '__sveltekit/env';
|
|
37
36
|
import { set_private_env, set_public_env } from '${runtime_directory}/shared-server.js';
|
|
38
37
|
|
|
39
38
|
export const options = {
|
|
@@ -93,7 +92,7 @@ export async function get_hooks() {
|
|
|
93
92
|
};
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
export { set_assets, set_building,
|
|
95
|
+
export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation };
|
|
97
96
|
`;
|
|
98
97
|
|
|
99
98
|
// TODO need to re-run this whenever src/app.html or src/error.html are
|
|
@@ -16,7 +16,7 @@ const ASYNC_VALIDATOR = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @param {Record<string, EnvVarConfig<any
|
|
19
|
+
* @param {Record<string, EnvVarConfig<any> | undefined>} variables
|
|
20
20
|
* @param {string | undefined} value
|
|
21
21
|
* @param {string} name
|
|
22
22
|
* @param {Record<string, StandardSchemaV1.Issue[]>} issues
|
package/src/exports/public.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface Builder {
|
|
|
141
141
|
generateFallback: (dest: string) => Promise<void>;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Generate a module exposing build-time environment variables as `$env/dynamic/public` if the app uses it.
|
|
144
|
+
* Generate a module exposing build-time environment variables as `$env/dynamic/public` or `$app/env/public` if the app uses it.
|
|
145
145
|
*/
|
|
146
146
|
generateEnvModule: () => void;
|
|
147
147
|
|
|
@@ -1550,6 +1550,10 @@ export interface RequestEvent<
|
|
|
1550
1550
|
locals: App.Locals;
|
|
1551
1551
|
/**
|
|
1552
1552
|
* The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
|
|
1553
|
+
*
|
|
1554
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1555
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1556
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1553
1557
|
*/
|
|
1554
1558
|
params: Params;
|
|
1555
1559
|
/**
|
|
@@ -1566,6 +1570,10 @@ export interface RequestEvent<
|
|
|
1566
1570
|
route: {
|
|
1567
1571
|
/**
|
|
1568
1572
|
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
|
|
1573
|
+
*
|
|
1574
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1575
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1576
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1569
1577
|
*/
|
|
1570
1578
|
id: RouteId;
|
|
1571
1579
|
};
|
|
@@ -1594,6 +1602,10 @@ export interface RequestEvent<
|
|
|
1594
1602
|
setHeaders: (headers: Record<string, string>) => void;
|
|
1595
1603
|
/**
|
|
1596
1604
|
* The requested URL.
|
|
1605
|
+
*
|
|
1606
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1607
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1608
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1597
1609
|
*/
|
|
1598
1610
|
url: URL;
|
|
1599
1611
|
/**
|
|
@@ -147,7 +147,12 @@ export function build_server_nodes(
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
if (node.universal) {
|
|
150
|
-
if (
|
|
150
|
+
if (
|
|
151
|
+
(kit.router.type === 'hash' &&
|
|
152
|
+
node.page_options !== null &&
|
|
153
|
+
node.page_options?.ssr === undefined) ||
|
|
154
|
+
(node.page_options && node.page_options.ssr === false)
|
|
155
|
+
) {
|
|
151
156
|
exports.push(`export const universal = ${s(node.page_options, null, 2)};`);
|
|
152
157
|
} else {
|
|
153
158
|
imports.push(
|
|
@@ -39,6 +39,16 @@ export async function build_service_worker(
|
|
|
39
39
|
assets.forEach((file) => build.add(file));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
if (kit.output.bundleStrategy === 'inline') {
|
|
43
|
+
// the bundle and stylesheet are inlined into the page and their files
|
|
44
|
+
// deleted, so they must not appear in the list of cacheable assets
|
|
45
|
+
for (const file of build) {
|
|
46
|
+
if (!fs.existsSync(`${out}/client/${file}`)) {
|
|
47
|
+
build.delete(file);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
// in a service worker, `location` is the location of the service worker itself,
|
|
43
53
|
// which is guaranteed to be `<base>/service-worker.js`
|
|
44
54
|
const base = "location.pathname.split('/').slice(0, -1).join('/')";
|
|
@@ -96,11 +106,17 @@ export async function build_service_worker(
|
|
|
96
106
|
}
|
|
97
107
|
|
|
98
108
|
if (id === '\0virtual:app/env/public') {
|
|
99
|
-
|
|
109
|
+
const has_dynamic_public_env = Object.values(env_config ?? {}).some(
|
|
110
|
+
(variable) => variable.public && !variable.static
|
|
111
|
+
);
|
|
112
|
+
|
|
100
113
|
return create_sveltekit_env_public(
|
|
101
114
|
env_config,
|
|
102
115
|
env.all,
|
|
103
|
-
|
|
116
|
+
has_dynamic_public_env
|
|
117
|
+
? // the service worker isn't registered as ESM yet, so we need to use `importScripts`
|
|
118
|
+
`importScripts('${kit.paths.base}/${kit.appDir}/env.script.js'); const env = globalThis.__sveltekit_sw.env;`
|
|
119
|
+
: ''
|
|
104
120
|
);
|
|
105
121
|
}
|
|
106
122
|
|
|
@@ -293,8 +293,11 @@ async function kit({ svelte_config }) {
|
|
|
293
293
|
const allow = new Set([
|
|
294
294
|
kit.files.lib,
|
|
295
295
|
kit.files.routes,
|
|
296
|
+
kit.files.src,
|
|
296
297
|
kit.outDir,
|
|
297
|
-
|
|
298
|
+
// ensures that the client entry is served even if it's located outside
|
|
299
|
+
// the local node_modules, such as the pnpm global virtual store
|
|
300
|
+
runtime_directory,
|
|
298
301
|
path.resolve('node_modules'),
|
|
299
302
|
path.resolve(vite.searchForWorkspaceRoot(cwd), 'node_modules')
|
|
300
303
|
]);
|
|
@@ -958,6 +961,7 @@ async function kit({ svelte_config }) {
|
|
|
958
961
|
if (ssr) {
|
|
959
962
|
input.index = `${runtime_directory}/server/index.js`;
|
|
960
963
|
input.internal = `${out_dir}/generated/server/internal.js`;
|
|
964
|
+
input.env = `__sveltekit/env`;
|
|
961
965
|
input['remote-entry'] = `${runtime_directory}/app/server/remote/index.js`;
|
|
962
966
|
|
|
963
967
|
// add entry points for every endpoint...
|
|
@@ -1046,8 +1050,15 @@ async function kit({ svelte_config }) {
|
|
|
1046
1050
|
.map(() => '..')
|
|
1047
1051
|
.join('/') + '/../';
|
|
1048
1052
|
|
|
1053
|
+
const relative = kit.paths.relative !== false || !!kit.paths.assets;
|
|
1054
|
+
|
|
1049
1055
|
new_config = {
|
|
1050
|
-
|
|
1056
|
+
// Affects how Vite loads JS assets on the client.
|
|
1057
|
+
// If the initial HTML we render uses an absolute path for assets,
|
|
1058
|
+
// the additional chunks Vite loads must also use an absolute path.
|
|
1059
|
+
// Otherwise, you end up with additional chunks being loaded relative
|
|
1060
|
+
// to the current chunk rather than the root.
|
|
1061
|
+
base: relative ? './' : base,
|
|
1051
1062
|
build: {
|
|
1052
1063
|
copyPublicDir: !ssr,
|
|
1053
1064
|
cssCodeSplit: svelte_config.kit.output.bundleStrategy !== 'inline',
|
|
@@ -1109,9 +1120,7 @@ async function kit({ svelte_config }) {
|
|
|
1109
1120
|
// E.g. Vite generates `new URL('/asset.png', import.meta).href` for a relative path vs just '/asset.png'.
|
|
1110
1121
|
// That's larger and takes longer to run and also causes an HTML diff between SSR and client
|
|
1111
1122
|
// causing us to do a more expensive hydration check.
|
|
1112
|
-
return {
|
|
1113
|
-
relative: kit.paths.relative !== false || !!kit.paths.assets
|
|
1114
|
-
};
|
|
1123
|
+
return { relative };
|
|
1115
1124
|
}
|
|
1116
1125
|
|
|
1117
1126
|
// _app/immutable/assets files
|
|
@@ -1370,6 +1379,17 @@ async function kit({ svelte_config }) {
|
|
|
1370
1379
|
const deps_of = (entry, add_dynamic_css = false) =>
|
|
1371
1380
|
find_deps(manifest, posixify(path.relative('.', entry)), add_dynamic_css);
|
|
1372
1381
|
|
|
1382
|
+
const has_explicit_dynamic_public_env = Object.values(explicit_env_config ?? {}).some(
|
|
1383
|
+
(variable) => variable.public && !variable.static
|
|
1384
|
+
);
|
|
1385
|
+
|
|
1386
|
+
const uses_env_dynamic_public = client_chunks.some(
|
|
1387
|
+
(chunk) =>
|
|
1388
|
+
chunk.type === 'chunk' &&
|
|
1389
|
+
(chunk.modules[env_dynamic_public] ||
|
|
1390
|
+
(has_explicit_dynamic_public_env && chunk.modules[sveltekit_env_public_client]))
|
|
1391
|
+
);
|
|
1392
|
+
|
|
1373
1393
|
if (svelte_config.kit.output.bundleStrategy === 'split') {
|
|
1374
1394
|
const start = deps_of(`${runtime_directory}/client/entry.js`);
|
|
1375
1395
|
const app = deps_of(`${out_dir}/generated/client-optimized/app.js`);
|
|
@@ -1380,9 +1400,7 @@ async function kit({ svelte_config }) {
|
|
|
1380
1400
|
imports: [...start.imports, ...app.imports],
|
|
1381
1401
|
stylesheets: [...start.stylesheets, ...app.stylesheets],
|
|
1382
1402
|
fonts: [...start.fonts, ...app.fonts],
|
|
1383
|
-
uses_env_dynamic_public
|
|
1384
|
-
(chunk) => chunk.type === 'chunk' && chunk.modules[env_dynamic_public]
|
|
1385
|
-
)
|
|
1403
|
+
uses_env_dynamic_public
|
|
1386
1404
|
};
|
|
1387
1405
|
|
|
1388
1406
|
// In case of server-side route resolution, we create a purpose-built route manifest that is
|
|
@@ -1429,9 +1447,7 @@ async function kit({ svelte_config }) {
|
|
|
1429
1447
|
imports: start.imports,
|
|
1430
1448
|
stylesheets: start.stylesheets,
|
|
1431
1449
|
fonts: start.fonts,
|
|
1432
|
-
uses_env_dynamic_public
|
|
1433
|
-
(chunk) => chunk.type === 'chunk' && chunk.modules[env_dynamic_public]
|
|
1434
|
-
)
|
|
1450
|
+
uses_env_dynamic_public
|
|
1435
1451
|
};
|
|
1436
1452
|
|
|
1437
1453
|
if (svelte_config.kit.output.bundleStrategy === 'inline') {
|
|
@@ -1448,6 +1464,12 @@ async function kit({ svelte_config }) {
|
|
|
1448
1464
|
script: read(`${out}/client/${start.file}`),
|
|
1449
1465
|
style: /** @type {string | undefined} */ (style?.source)
|
|
1450
1466
|
};
|
|
1467
|
+
|
|
1468
|
+
// the bundle and stylesheet are inlined into the page, so the
|
|
1469
|
+
// emitted files are never loaded
|
|
1470
|
+
fs.unlinkSync(`${out}/client/${start.file}`);
|
|
1471
|
+
fs.rmSync(`${out}/client/${start.file}.map`, { force: true });
|
|
1472
|
+
if (style) fs.unlinkSync(`${out}/client/${style.fileName}`);
|
|
1451
1473
|
}
|
|
1452
1474
|
}
|
|
1453
1475
|
|
|
@@ -1622,13 +1644,18 @@ function find_overridden_config(config, resolved_config, enforced_config, path,
|
|
|
1622
1644
|
for (const key in enforced_config) {
|
|
1623
1645
|
if (typeof config === 'object' && key in config && key in resolved_config) {
|
|
1624
1646
|
const enforced = enforced_config[key];
|
|
1647
|
+
const resolved = resolved_config[key];
|
|
1625
1648
|
|
|
1626
1649
|
if (enforced === true) {
|
|
1627
|
-
|
|
1650
|
+
// Normalize path separators before comparing to avoid false positives on Windows,
|
|
1651
|
+
// where config values like `root` may use backslashes while SvelteKit uses forward slashes.
|
|
1652
|
+
const a = typeof config[key] === 'string' ? posixify(config[key]) : config[key];
|
|
1653
|
+
const b = typeof resolved === 'string' ? posixify(resolved) : resolved;
|
|
1654
|
+
if (a !== b) {
|
|
1628
1655
|
out.push(path + key);
|
|
1629
1656
|
}
|
|
1630
1657
|
} else {
|
|
1631
|
-
find_overridden_config(config[key],
|
|
1658
|
+
find_overridden_config(config[key], resolved, enforced, path + key + '.', out);
|
|
1632
1659
|
}
|
|
1633
1660
|
}
|
|
1634
1661
|
}
|
|
@@ -51,10 +51,19 @@ export async function preview(vite, vite_config, svelte_config) {
|
|
|
51
51
|
set_assets(assets);
|
|
52
52
|
|
|
53
53
|
const server = new Server(manifest);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
await server.init({
|
|
57
|
+
env: loadEnv(vite_config.mode, svelte_config.kit.env.dir, ''),
|
|
58
|
+
read: (file) => createReadableStream(`${dir}/${file}`)
|
|
59
|
+
});
|
|
60
|
+
} catch (error) {
|
|
61
|
+
// Vite erases the error message when starting the preview server so we store
|
|
62
|
+
// it in the stack instead. This ensures errors thrown using `stackless`
|
|
63
|
+
// are still readable
|
|
64
|
+
if (error instanceof Error) error.stack = error.message;
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
58
67
|
|
|
59
68
|
const emulator = await svelte_config.kit.adapter?.emulate?.();
|
|
60
69
|
|
|
@@ -554,7 +554,11 @@ export async function _goto(url, options, redirect_count, nav_token) {
|
|
|
554
554
|
force_invalidation = true;
|
|
555
555
|
query_keys = new Set();
|
|
556
556
|
for (const [id, entries] of query_map) {
|
|
557
|
-
for (const payload of entries
|
|
557
|
+
for (const [payload, entry] of entries) {
|
|
558
|
+
// don't refresh yet, as some queries will be unrendered,
|
|
559
|
+
// but clear caches so that newly rendered queries
|
|
560
|
+
// don't use stale data. TODO same for `live_query_map`
|
|
561
|
+
entry.resource?.reset();
|
|
558
562
|
query_keys.add(create_remote_key(id, payload));
|
|
559
563
|
}
|
|
560
564
|
}
|
|
@@ -582,7 +586,7 @@ export async function _goto(url, options, redirect_count, nav_token) {
|
|
|
582
586
|
for (const [id, entries] of query_map) {
|
|
583
587
|
for (const [payload, { resource }] of entries) {
|
|
584
588
|
if (query_keys?.has(create_remote_key(id, payload))) {
|
|
585
|
-
void resource.
|
|
589
|
+
void resource.start();
|
|
586
590
|
}
|
|
587
591
|
}
|
|
588
592
|
}
|
|
@@ -2415,7 +2419,9 @@ export async function preloadCode(pathname) {
|
|
|
2415
2419
|
throw new Error('Cannot call preloadCode(...) on the server');
|
|
2416
2420
|
}
|
|
2417
2421
|
|
|
2418
|
-
|
|
2422
|
+
// `current.url` is null until the first navigation/hydration completes, so fall back
|
|
2423
|
+
// to `location` to support calling `preloadCode` during initial page load (#13297)
|
|
2424
|
+
const url = new URL(pathname, current.url ?? location.href);
|
|
2419
2425
|
|
|
2420
2426
|
if (DEV) {
|
|
2421
2427
|
if (!pathname.startsWith('/')) {
|
|
@@ -94,8 +94,6 @@ export function initial_fetch(resource, opts) {
|
|
|
94
94
|
script.remove(); // In case multiple script tags match the same selector
|
|
95
95
|
let { body, ...init } = JSON.parse(script.textContent);
|
|
96
96
|
|
|
97
|
-
const ttl = script.getAttribute('data-ttl');
|
|
98
|
-
if (ttl) cache.set(selector, { body, init, ttl: 1000 * Number(ttl) });
|
|
99
97
|
const b64 = script.getAttribute('data-b64');
|
|
100
98
|
if (b64 !== null) {
|
|
101
99
|
// Can't use native_fetch('data:...;base64,${body}')
|
|
@@ -103,6 +101,9 @@ export function initial_fetch(resource, opts) {
|
|
|
103
101
|
body = base64_decode(body);
|
|
104
102
|
}
|
|
105
103
|
|
|
104
|
+
const ttl = script.getAttribute('data-ttl');
|
|
105
|
+
if (ttl) cache.set(selector, { body, init, ttl: 1000 * Number(ttl) });
|
|
106
|
+
|
|
106
107
|
return Promise.resolve(new Response(body, init));
|
|
107
108
|
}
|
|
108
109
|
|
|
@@ -565,9 +565,10 @@ export function form(id) {
|
|
|
565
565
|
|
|
566
566
|
const submission = submit(form_data, true);
|
|
567
567
|
|
|
568
|
-
|
|
568
|
+
const decrement = () => {
|
|
569
569
|
pending_count--;
|
|
570
|
-
}
|
|
570
|
+
};
|
|
571
|
+
void submission.then(decrement, decrement);
|
|
571
572
|
|
|
572
573
|
return submission;
|
|
573
574
|
}
|
|
@@ -5,6 +5,7 @@ import * as devalue from 'devalue';
|
|
|
5
5
|
import { app, goto, prerender_responses } from '../client.js';
|
|
6
6
|
import { get_remote_request_headers, remote_request, unwrap_node } from './shared.svelte.js';
|
|
7
7
|
import { create_remote_key, stringify_remote_arg } from '../../shared.js';
|
|
8
|
+
import { noop } from '../../../utils/functions.js';
|
|
8
9
|
|
|
9
10
|
// Initialize Cache API for prerender functions
|
|
10
11
|
const CACHE_NAME = __SVELTEKIT_DEV__ ? `sveltekit:${Date.now()}` : `sveltekit:${version}`;
|
|
@@ -166,6 +167,10 @@ class Prerender {
|
|
|
166
167
|
throw error;
|
|
167
168
|
}
|
|
168
169
|
);
|
|
170
|
+
|
|
171
|
+
// rejections are surfaced via `.error` for reactive consumers — make sure the
|
|
172
|
+
// stored promise (consumed without `await`) never becomes an unhandled rejection
|
|
173
|
+
this.#promise.catch(noop);
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
/**
|
|
@@ -83,12 +83,14 @@ export class Query {
|
|
|
83
83
|
return /** @type {Promise<T>} */ (this.#promise);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
start() {
|
|
87
87
|
// there is a really weird bug with untrack and writes and initializations
|
|
88
88
|
// every time you see this comment, try removing the `tick.then` here and see
|
|
89
89
|
// if all the tests still pass with the latest svelte version
|
|
90
90
|
// if they do, congrats, you can remove tick.then
|
|
91
|
-
void tick()
|
|
91
|
+
void tick()
|
|
92
|
+
.then(() => this.#get_promise())
|
|
93
|
+
.catch(noop);
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
#clear_pending() {
|
|
@@ -101,6 +103,11 @@ export class Query {
|
|
|
101
103
|
|
|
102
104
|
const { promise, resolve, reject } = with_resolvers();
|
|
103
105
|
|
|
106
|
+
// the rejection is surfaced via `.error` / the `then` getter for awaiting
|
|
107
|
+
// consumers — a purely reactive consumer (`.current`) attaches no handler,
|
|
108
|
+
// so make sure the stored promise can never become an unhandled rejection
|
|
109
|
+
promise.catch(noop);
|
|
110
|
+
|
|
104
111
|
this.#latest.push(resolve);
|
|
105
112
|
|
|
106
113
|
Promise.resolve(this.#fn())
|
|
@@ -144,12 +151,12 @@ export class Query {
|
|
|
144
151
|
get then() {
|
|
145
152
|
// TODO this should be unnecessary but due to the bug described
|
|
146
153
|
// in #start, we need to do this in some circumstances
|
|
147
|
-
this
|
|
154
|
+
this.start();
|
|
148
155
|
return this.#then;
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
get catch() {
|
|
152
|
-
this
|
|
159
|
+
this.start();
|
|
153
160
|
this.#then;
|
|
154
161
|
return (/** @type {any} */ reject) => {
|
|
155
162
|
return this.#then(undefined, reject);
|
|
@@ -157,7 +164,7 @@ export class Query {
|
|
|
157
164
|
}
|
|
158
165
|
|
|
159
166
|
get finally() {
|
|
160
|
-
this
|
|
167
|
+
this.start();
|
|
161
168
|
this.#then;
|
|
162
169
|
return (/** @type {any} */ fn) => {
|
|
163
170
|
return this.#then(
|
|
@@ -174,12 +181,12 @@ export class Query {
|
|
|
174
181
|
}
|
|
175
182
|
|
|
176
183
|
get current() {
|
|
177
|
-
this
|
|
184
|
+
this.start();
|
|
178
185
|
return this.#current;
|
|
179
186
|
}
|
|
180
187
|
|
|
181
188
|
get error() {
|
|
182
|
-
this
|
|
189
|
+
this.start();
|
|
183
190
|
return this.#error;
|
|
184
191
|
}
|
|
185
192
|
|
|
@@ -187,7 +194,7 @@ export class Query {
|
|
|
187
194
|
* Returns true if the resource is loading or reloading.
|
|
188
195
|
*/
|
|
189
196
|
get loading() {
|
|
190
|
-
this
|
|
197
|
+
this.start();
|
|
191
198
|
return this.#loading;
|
|
192
199
|
}
|
|
193
200
|
|
|
@@ -195,7 +202,7 @@ export class Query {
|
|
|
195
202
|
* Returns true once the resource has been loaded for the first time.
|
|
196
203
|
*/
|
|
197
204
|
get ready() {
|
|
198
|
-
this
|
|
205
|
+
this.start();
|
|
199
206
|
return this.#ready;
|
|
200
207
|
}
|
|
201
208
|
|
|
@@ -263,6 +270,15 @@ export class Query {
|
|
|
263
270
|
return release;
|
|
264
271
|
}
|
|
265
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Reset ahead of a navigation that invalidates all, to force newly
|
|
275
|
+
* rendered queries to get fresh data
|
|
276
|
+
*/
|
|
277
|
+
reset() {
|
|
278
|
+
this.#promise = null;
|
|
279
|
+
delete query_responses[this.#key];
|
|
280
|
+
}
|
|
281
|
+
|
|
266
282
|
get [Symbol.toStringTag]() {
|
|
267
283
|
return 'Query';
|
|
268
284
|
}
|
|
@@ -114,7 +114,13 @@ export async function remote_request(url, init) {
|
|
|
114
114
|
const response = await fetch(url, init);
|
|
115
115
|
|
|
116
116
|
if (!response.ok) {
|
|
117
|
-
|
|
117
|
+
const result = await response.json().catch(() => ({
|
|
118
|
+
type: 'error',
|
|
119
|
+
status: response.status,
|
|
120
|
+
error: response.statusText
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
throw new HttpError(result.status ?? response.status ?? 500, result.error);
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
const result = /** @type {RemoteFunctionResponse} */ (await response.json());
|
|
@@ -368,7 +368,13 @@ export async function render_response({
|
|
|
368
368
|
if (page_config.csr && client) {
|
|
369
369
|
const route = client.routes?.find((r) => r.id === event.route.id) ?? null;
|
|
370
370
|
|
|
371
|
-
|
|
371
|
+
// when serving a prerendered page in an app that uses runtime public env vars, we must
|
|
372
|
+
// import the env.js module so that it evaluates before any user code can evaluate.
|
|
373
|
+
// TODO revert to using top-level await once https://bugs.webkit.org/show_bug.cgi?id=242740 is fixed
|
|
374
|
+
// https://github.com/sveltejs/kit/pull/11601
|
|
375
|
+
const load_env_eagerly = client.uses_env_dynamic_public && !!state.prerendering;
|
|
376
|
+
|
|
377
|
+
if (load_env_eagerly) {
|
|
372
378
|
modulepreloads.add(`${paths.app_dir}/env.js`);
|
|
373
379
|
}
|
|
374
380
|
|
|
@@ -401,15 +407,6 @@ export async function render_response({
|
|
|
401
407
|
|
|
402
408
|
const blocks = [];
|
|
403
409
|
|
|
404
|
-
// when serving a prerendered page in an app that uses $env/dynamic/public, we must
|
|
405
|
-
// import the env.js module so that it evaluates before any user code can evaluate.
|
|
406
|
-
// TODO revert to using top-level await once https://bugs.webkit.org/show_bug.cgi?id=242740 is fixed
|
|
407
|
-
// https://github.com/sveltejs/kit/pull/11601
|
|
408
|
-
const load_env_eagerly =
|
|
409
|
-
(__SVELTEKIT_EXPERIMENTAL_EXPLICIT_ENVIRONMENT_VARIABLES__ ||
|
|
410
|
-
client.uses_env_dynamic_public) &&
|
|
411
|
-
state.prerendering;
|
|
412
|
-
|
|
413
410
|
const properties = [`base: ${base_expression}`];
|
|
414
411
|
|
|
415
412
|
if (paths.assets) {
|
|
@@ -574,11 +571,8 @@ export async function render_response({
|
|
|
574
571
|
}`);
|
|
575
572
|
}
|
|
576
573
|
|
|
577
|
-
// we need to eagerly import the Vite client module in development to ensure
|
|
578
|
-
// that Vite global constant replacements are initialised before our code runs
|
|
579
574
|
const init_app = `
|
|
580
575
|
{
|
|
581
|
-
${DEV ? `import('${paths.base}/@vite/client')` : ''}
|
|
582
576
|
${blocks.join('\n\n\t\t\t\t\t')}
|
|
583
577
|
}
|
|
584
578
|
`;
|
|
@@ -57,6 +57,9 @@ async function handle_remote_call_internal(event, state, options, manifest, id)
|
|
|
57
57
|
'sveltekit.remote.call.name': internals.name
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
/** @type {HeadersInit | undefined} */
|
|
61
|
+
const headers = state.prerendering ? undefined : { 'cache-control': 'private, no-store' };
|
|
62
|
+
|
|
60
63
|
try {
|
|
61
64
|
/** @type {RemoteFunctionData} */
|
|
62
65
|
const data = {};
|
|
@@ -226,7 +229,8 @@ async function handle_remote_call_internal(event, state, options, manifest, id)
|
|
|
226
229
|
/** @type {RemoteFunctionResponse} */ ({
|
|
227
230
|
type: 'result',
|
|
228
231
|
data: stringify(data, transport)
|
|
229
|
-
})
|
|
232
|
+
}),
|
|
233
|
+
{ headers }
|
|
230
234
|
);
|
|
231
235
|
}
|
|
232
236
|
|
|
@@ -275,7 +279,8 @@ async function handle_remote_call_internal(event, state, options, manifest, id)
|
|
|
275
279
|
/** @type {RemoteFunctionResponse} */ ({
|
|
276
280
|
type: 'result',
|
|
277
281
|
data: stringify(data, transport)
|
|
278
|
-
})
|
|
282
|
+
}),
|
|
283
|
+
{ headers }
|
|
279
284
|
);
|
|
280
285
|
} catch (error) {
|
|
281
286
|
if (error instanceof Redirect) {
|
|
@@ -285,7 +290,8 @@ async function handle_remote_call_internal(event, state, options, manifest, id)
|
|
|
285
290
|
/** @type {RemoteFunctionResponse} */ ({
|
|
286
291
|
type: 'result',
|
|
287
292
|
data: stringify(data, transport)
|
|
288
|
-
})
|
|
293
|
+
}),
|
|
294
|
+
{ headers }
|
|
289
295
|
);
|
|
290
296
|
}
|
|
291
297
|
|
package/src/types/internal.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ export interface ServerModule {
|
|
|
44
44
|
export interface ServerInternalModule {
|
|
45
45
|
set_assets(path: string): void;
|
|
46
46
|
set_building(): void;
|
|
47
|
-
set_env(environment: Record<string, string>): void;
|
|
48
47
|
set_manifest(manifest: SSRManifest): void;
|
|
49
48
|
set_prerendering(): void;
|
|
50
49
|
set_private_env(environment: Record<string, string>): void;
|
|
@@ -103,6 +102,9 @@ export interface BuildData {
|
|
|
103
102
|
routes?: SSRClientRoute[];
|
|
104
103
|
stylesheets: string[];
|
|
105
104
|
fonts: string[];
|
|
105
|
+
/**
|
|
106
|
+
* Whether the client uses public dynamic env vars — `$env/dynamic/public` or `$app/env/public`.
|
|
107
|
+
*/
|
|
106
108
|
uses_env_dynamic_public: boolean;
|
|
107
109
|
/** Only set in case of `bundleStrategy === 'inline'`. */
|
|
108
110
|
inline?: {
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ declare module '@sveltejs/kit' {
|
|
|
116
116
|
generateFallback: (dest: string) => Promise<void>;
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* Generate a module exposing build-time environment variables as `$env/dynamic/public` if the app uses it.
|
|
119
|
+
* Generate a module exposing build-time environment variables as `$env/dynamic/public` or `$app/env/public` if the app uses it.
|
|
120
120
|
*/
|
|
121
121
|
generateEnvModule: () => void;
|
|
122
122
|
|
|
@@ -1524,6 +1524,10 @@ declare module '@sveltejs/kit' {
|
|
|
1524
1524
|
locals: App.Locals;
|
|
1525
1525
|
/**
|
|
1526
1526
|
* The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
|
|
1527
|
+
*
|
|
1528
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1529
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1530
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1527
1531
|
*/
|
|
1528
1532
|
params: Params;
|
|
1529
1533
|
/**
|
|
@@ -1540,6 +1544,10 @@ declare module '@sveltejs/kit' {
|
|
|
1540
1544
|
route: {
|
|
1541
1545
|
/**
|
|
1542
1546
|
* The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
|
|
1547
|
+
*
|
|
1548
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1549
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1550
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1543
1551
|
*/
|
|
1544
1552
|
id: RouteId;
|
|
1545
1553
|
};
|
|
@@ -1568,6 +1576,10 @@ declare module '@sveltejs/kit' {
|
|
|
1568
1576
|
setHeaders: (headers: Record<string, string>) => void;
|
|
1569
1577
|
/**
|
|
1570
1578
|
* The requested URL.
|
|
1579
|
+
*
|
|
1580
|
+
* In the context of a remote function request initiated by the client, this relates to the page the remote function
|
|
1581
|
+
* was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine
|
|
1582
|
+
* whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated.
|
|
1571
1583
|
*/
|
|
1572
1584
|
url: URL;
|
|
1573
1585
|
/**
|
|
@@ -2612,6 +2624,9 @@ declare module '@sveltejs/kit' {
|
|
|
2612
2624
|
routes?: SSRClientRoute[];
|
|
2613
2625
|
stylesheets: string[];
|
|
2614
2626
|
fonts: string[];
|
|
2627
|
+
/**
|
|
2628
|
+
* Whether the client uses public dynamic env vars — `$env/dynamic/public` or `$app/env/public`.
|
|
2629
|
+
*/
|
|
2615
2630
|
uses_env_dynamic_public: boolean;
|
|
2616
2631
|
/** Only set in case of `bundleStrategy === 'inline'`. */
|
|
2617
2632
|
inline?: {
|
|
@@ -2824,7 +2839,7 @@ declare module '@sveltejs/kit' {
|
|
|
2824
2839
|
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
|
2825
2840
|
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
|
2826
2841
|
*/
|
|
2827
|
-
function
|
|
2842
|
+
export function error(status: number, body: App.Error): never;
|
|
2828
2843
|
/**
|
|
2829
2844
|
* Throws an error with a HTTP status code and an optional message.
|
|
2830
2845
|
* When called during request handling, this will cause SvelteKit to
|
|
@@ -2835,7 +2850,7 @@ declare module '@sveltejs/kit' {
|
|
|
2835
2850
|
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
|
2836
2851
|
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
|
2837
2852
|
*/
|
|
2838
|
-
function
|
|
2853
|
+
export function error(status: number, body?: {
|
|
2839
2854
|
message: string;
|
|
2840
2855
|
} extends App.Error ? App.Error | string | undefined : never): never;
|
|
2841
2856
|
/**
|
|
@@ -2976,7 +2991,7 @@ declare module '@sveltejs/kit' {
|
|
|
2976
2991
|
}
|
|
2977
2992
|
const valid_page_options_array: readonly ["ssr", "prerender", "csr", "trailingSlash", "config", "entries", "load"];
|
|
2978
2993
|
|
|
2979
|
-
export {
|
|
2994
|
+
export {};
|
|
2980
2995
|
}
|
|
2981
2996
|
|
|
2982
2997
|
declare module '@sveltejs/kit/hooks' {
|
|
@@ -3331,7 +3346,7 @@ declare module '$app/navigation' {
|
|
|
3331
3346
|
}
|
|
3332
3347
|
|
|
3333
3348
|
declare module '$app/paths' {
|
|
3334
|
-
import type { RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname, RouteId, RouteParams, Asset, Pathname
|
|
3349
|
+
import type { RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname, RouteId, RouteParams, Asset, Pathname } from '$app/types';
|
|
3335
3350
|
/**
|
|
3336
3351
|
* A string that matches [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths).
|
|
3337
3352
|
*
|
|
@@ -3428,7 +3443,7 @@ declare module '$app/paths' {
|
|
|
3428
3443
|
* @since 2.52.0
|
|
3429
3444
|
*
|
|
3430
3445
|
* */
|
|
3431
|
-
export function match(url:
|
|
3446
|
+
export function match(url: Pathname | URL | (string & {})): Promise<{
|
|
3432
3447
|
id: RouteId;
|
|
3433
3448
|
params: Record<string, string>;
|
|
3434
3449
|
} | null>;
|
|
@@ -3778,7 +3793,9 @@ declare module '$app/stores' {
|
|
|
3778
3793
|
};
|
|
3779
3794
|
|
|
3780
3795
|
export {};
|
|
3781
|
-
}
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
/**
|
|
3782
3799
|
* It's possible to tell SvelteKit how to type objects inside your app by declaring the `App` namespace. By default, a new project will have a file called `src/app.d.ts` containing the following:
|
|
3783
3800
|
*
|
|
3784
3801
|
* ```ts
|
package/types/index.d.ts.map
CHANGED
|
@@ -246,6 +246,6 @@
|
|
|
246
246
|
null,
|
|
247
247
|
null
|
|
248
248
|
],
|
|
249
|
-
"mappings": ";;;;;;;;MAiCKA,IAAIA;;;;;kBAKQC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCZ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