@real-router/svelte 0.17.29 → 0.17.30
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.
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { startsWithSegment } from "@real-router/route-utils";
|
|
2
|
+
/**
|
|
3
|
+
* Intrinsics captured at module load (#1971).
|
|
4
|
+
*
|
|
5
|
+
* ⚑ These DECIDE — each answers "what is on this object" for a value this module
|
|
6
|
+
* did not build, so read off the live global they are the weakest point of every
|
|
7
|
+
* check built on them. `guards.ts` states the doctrine and its measurement: one
|
|
8
|
+
* naive `Object.hasOwn` polyfill walked straight through five sibling readers
|
|
9
|
+
* while the single captured guard held.
|
|
10
|
+
*
|
|
11
|
+
* ⚠ Capture narrows the window from "any time after boot" to "before this module
|
|
12
|
+
* loads". It does not close it — a shim evaluated ahead of core still wins
|
|
13
|
+
* (#1798), which is the doctrine's own caveat and travels with it.
|
|
14
|
+
*/
|
|
15
|
+
const objectKeys = Object.keys;
|
|
2
16
|
// Snippet names reserved by RouteView for non-segment slots. Iteration in
|
|
3
17
|
// `getActiveSegment` skips these so they don't accidentally match a route.
|
|
4
18
|
const RESERVED_SLOT_NAMES = new Set(["self", "notFound"]);
|
|
@@ -7,7 +21,7 @@ export function getActiveSegment(routeName, node, snippets) {
|
|
|
7
21
|
// Own enumerable keys only: `for...in` also walks inherited members, so an
|
|
8
22
|
// enumerable extension some library left on Object.prototype would be
|
|
9
23
|
// treated as an active slot and matched against route names (#1853).
|
|
10
|
-
for (const segment of
|
|
24
|
+
for (const segment of objectKeys(snippets)) {
|
|
11
25
|
if (RESERVED_SLOT_NAMES.has(segment)) {
|
|
12
26
|
continue;
|
|
13
27
|
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intrinsics captured at module load (#1971).
|
|
3
|
+
*
|
|
4
|
+
* ⚑ These DECIDE — they answer "what is on this object" for a value this module
|
|
5
|
+
* did not build. Read off the live global they can be re-pointed after boot, and
|
|
6
|
+
* `shared/` is the half where that fails OPEN: measured in `browser-env`, a
|
|
7
|
+
* re-pointed `getPrototypeOf` admits a `Date` into `state.params` and a
|
|
8
|
+
* re-pointed `keys` skips option validation entirely.
|
|
9
|
+
*
|
|
10
|
+
* ⚠ Capture narrows the window from "any time after boot" to "before this module
|
|
11
|
+
* loads". It does not close it (#1798).
|
|
12
|
+
*/
|
|
13
|
+
const objectKeys = Object.keys;
|
|
1
14
|
/**
|
|
2
15
|
* Collapses a `<Link>`'s two prop forms (RFC-4 M2 B2, #1548) into one channel
|
|
3
16
|
* triple:
|
|
@@ -218,8 +231,8 @@ export function shallowEqual(prev, next) {
|
|
|
218
231
|
if (!prev || !next) {
|
|
219
232
|
return false;
|
|
220
233
|
}
|
|
221
|
-
const prevKeys =
|
|
222
|
-
if (prevKeys.length !==
|
|
234
|
+
const prevKeys = objectKeys(prev);
|
|
235
|
+
if (prevKeys.length !== objectKeys(next).length) {
|
|
223
236
|
return false;
|
|
224
237
|
}
|
|
225
238
|
const prevRecord = prev;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intrinsics captured at module load (#1971).
|
|
3
|
+
*
|
|
4
|
+
* ⚑ These DECIDE — they answer "what is on this object" for a value this module
|
|
5
|
+
* did not build. Read off the live global they can be re-pointed after boot, and
|
|
6
|
+
* `shared/` is the half where that fails OPEN: measured in `browser-env`, a
|
|
7
|
+
* re-pointed `getPrototypeOf` admits a `Date` into `state.params` and a
|
|
8
|
+
* re-pointed `keys` skips option validation entirely.
|
|
9
|
+
*
|
|
10
|
+
* ⚠ Capture narrows the window from "any time after boot" to "before this module
|
|
11
|
+
* loads". It does not close it (#1798).
|
|
12
|
+
*/
|
|
13
|
+
const objectKeys = Object.keys;
|
|
1
14
|
const DEFAULT_STORAGE_KEY = "real-router:scroll";
|
|
2
15
|
// Bounded retry budget for resolving a late-mounting scroll container on the
|
|
3
16
|
// restore path. A per-route container (e.g. an `overflow:auto` div rendered
|
|
@@ -430,7 +443,7 @@ function canonicalReplacer(_key, val) {
|
|
|
430
443
|
// on both. Lock-test: scrollRestoreKey.properties.ts Invariant 11.
|
|
431
444
|
const sorted = Object.create(null);
|
|
432
445
|
// eslint-disable-next-line unicorn/no-array-sort -- ng-packagr uses pre-ES2023 lib; toSorted unavailable
|
|
433
|
-
const keys =
|
|
446
|
+
const keys = objectKeys(val).sort((left, right) => left.localeCompare(right));
|
|
434
447
|
for (const key of keys) {
|
|
435
448
|
sorted[key] = val[key];
|
|
436
449
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/svelte",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Svelte 5 integration for Real-Router",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"sideEffects": false,
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@real-router/core": "^0.109.
|
|
51
|
+
"@real-router/core": "^0.109.2",
|
|
52
52
|
"@real-router/route-utils": "^0.3.0",
|
|
53
|
-
"@real-router/sources": "^0.14.
|
|
53
|
+
"@real-router/sources": "^0.14.12"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@sveltejs/package": "2.5.8",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"svelte": "~5.56.4",
|
|
64
64
|
"svelte-check": "4.6.0",
|
|
65
65
|
"svelte-eslint-parser": "1.8.0",
|
|
66
|
-
"@real-router/browser-plugin": "^0.21.
|
|
66
|
+
"@real-router/browser-plugin": "^0.21.12"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"svelte": ">=5.7.0"
|