@sveltejs/kit 1.0.0-next.423 → 1.0.0-next.424
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
CHANGED
|
@@ -162,10 +162,11 @@ function get_groups(manifest_data, routes_dir) {
|
|
|
162
162
|
/** @type {Node} */
|
|
163
163
|
const node = { ...nodes[i] }; // shallow copy so we don't mutate the original when setting parent
|
|
164
164
|
|
|
165
|
+
const file_path = /** @type {string} */ (node.component ?? node.shared ?? node.server);
|
|
165
166
|
// skip default layout/error
|
|
166
|
-
if (!
|
|
167
|
+
if (!file_path.startsWith(routes_dir)) continue;
|
|
167
168
|
|
|
168
|
-
const parts =
|
|
169
|
+
const parts = file_path.split('/');
|
|
169
170
|
|
|
170
171
|
const file = /** @type {string} */ (parts.pop());
|
|
171
172
|
const dir = parts.join('/').slice(routes_dir.length + 1);
|
|
@@ -284,7 +285,7 @@ function write_types_for_dir(config, manifest_data, routes_dir, dir, groups, ts)
|
|
|
284
285
|
manifest_data.routes.forEach((route) => {
|
|
285
286
|
if (route.type === 'page' && route.id.startsWith(dir + '/')) {
|
|
286
287
|
// TODO this is O(n^2), see if we need to speed it up
|
|
287
|
-
for (const name of parse_route_id(route.id).names) {
|
|
288
|
+
for (const name of parse_route_id(route.id.slice(dir.length + 1)).names) {
|
|
288
289
|
layout_params.add(name);
|
|
289
290
|
}
|
|
290
291
|
}
|
|
@@ -268,7 +268,22 @@ export function create_client({ target, base, trailing_slash }) {
|
|
|
268
268
|
navigation_result.props.page.url = url;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
if (import.meta.env.DEV) {
|
|
272
|
+
// Nasty hack to silence harmless warnings the user can do nothing about
|
|
273
|
+
const warn = console.warn;
|
|
274
|
+
console.warn = (...args) => {
|
|
275
|
+
if (
|
|
276
|
+
args.length !== 1 ||
|
|
277
|
+
!/<(Layout|Page)> was created with unknown prop '(data|errors)'/.test(args[0])
|
|
278
|
+
) {
|
|
279
|
+
warn(...args);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
root.$set(navigation_result.props);
|
|
283
|
+
tick().then(() => (console.warn = warn));
|
|
284
|
+
} else {
|
|
285
|
+
root.$set(navigation_result.props);
|
|
286
|
+
}
|
|
272
287
|
} else {
|
|
273
288
|
initialize(navigation_result);
|
|
274
289
|
}
|
|
@@ -347,11 +362,30 @@ export function create_client({ target, base, trailing_slash }) {
|
|
|
347
362
|
|
|
348
363
|
page = result.props.page;
|
|
349
364
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
365
|
+
if (import.meta.env.DEV) {
|
|
366
|
+
// Nasty hack to silence harmless warnings the user can do nothing about
|
|
367
|
+
const warn = console.warn;
|
|
368
|
+
console.warn = (...args) => {
|
|
369
|
+
if (
|
|
370
|
+
args.length !== 1 ||
|
|
371
|
+
!/<(Layout|Page)> was created with unknown prop '(data|errors)'/.test(args[0])
|
|
372
|
+
) {
|
|
373
|
+
warn(...args);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
root = new Root({
|
|
377
|
+
target,
|
|
378
|
+
props: { ...result.props, stores },
|
|
379
|
+
hydrate: true
|
|
380
|
+
});
|
|
381
|
+
console.warn = warn;
|
|
382
|
+
} else {
|
|
383
|
+
root = new Root({
|
|
384
|
+
target,
|
|
385
|
+
props: { ...result.props, stores },
|
|
386
|
+
hydrate: true
|
|
387
|
+
});
|
|
388
|
+
}
|
|
355
389
|
|
|
356
390
|
if (router_enabled) {
|
|
357
391
|
const navigation = { from: null, to: new URL(location.href) };
|
package/src/vite/build/utils.js
CHANGED
package/src/vite/index.js
CHANGED