@real-router/svelte 0.20.1 → 0.21.0
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/dist/dom-utils/link-utils.js +26 -9
- package/package.json +5 -5
|
@@ -164,14 +164,19 @@ export function buildHref(router, routeName, routeParams, routeSearch, hash) {
|
|
|
164
164
|
// lands, and the click resolves `forwardTo`. `router.buildPath` alone is
|
|
165
165
|
// class LITERAL by record and answers about the route it was NAMED —
|
|
166
166
|
// INVARIANTS #8 keeps that so a plugin can build a state for an alias
|
|
167
|
-
// without being teleported off it — so the chain is resolved FIRST and
|
|
168
|
-
//
|
|
169
|
-
//
|
|
167
|
+
// without being teleported off it — so the chain is resolved FIRST and the
|
|
168
|
+
// printer prints the target. The door choice belongs here rather than one
|
|
169
|
+
// layer down.
|
|
170
170
|
//
|
|
171
|
-
// ⚠ The `??`
|
|
172
|
-
//
|
|
173
|
-
// `
|
|
174
|
-
//
|
|
171
|
+
// ⚠ **The `??` is not reached by a name the table does not hold, and the
|
|
172
|
+
// claim that it was described a door this arm stopped calling.** That read
|
|
173
|
+
// `buildNavigationState`, which answers `undefined` for an unknown route;
|
|
174
|
+
// since #2265 the resolving door is `forwardState`, which ANSWERS for one
|
|
175
|
+
// (measured — it does not validate the name), leaving the printer to throw.
|
|
176
|
+
// `packages/react/INVARIANTS.md` row 3 still holds — `Both throw →
|
|
177
|
+
// undefined + console.error` — but it is reached by both printers throwing,
|
|
178
|
+
// not by a `undefined` the `??` absorbs. What the `??` IS load-bearing for
|
|
179
|
+
// is the two cases below.
|
|
175
180
|
//
|
|
176
181
|
// ⚠ **The fallback is also where the channel guard lands (#1572).** A route's
|
|
177
182
|
// declared query name handed in the PATH bag makes the class-① door throw
|
|
@@ -193,8 +198,20 @@ export function buildHref(router, routeName, routeParams, routeSearch, hash) {
|
|
|
193
198
|
// `reportUndeclaredParamKey`, and an href COMMITS NOTHING. That diagnostic
|
|
194
199
|
// is for a state you are about to persist, which is why `canNavigateTo`
|
|
195
200
|
// is silent despite sharing `navigate`'s form (#2248 / #1581).
|
|
196
|
-
|
|
197
|
-
|
|
201
|
+
// ⚑ **`buildPathResolved`, not `router.buildPath` — ONE href is ONE pass
|
|
202
|
+
// of the chain (#2260).** The facade's printer runs the `forwardState`
|
|
203
|
+
// seam a door lower (#2087), which is right for a caller holding a raw
|
|
204
|
+
// intent and a SECOND pass for this one, which just resolved. Counted,
|
|
205
|
+
// because nothing in either door's source says "twice": the second pass
|
|
206
|
+
// is what two individually-correct doors compose to.
|
|
207
|
+
//
|
|
208
|
+
// ⚠ A plugin author registers one interceptor and has no reason to expect
|
|
209
|
+
// two invocations per href — a stateful one double-counts. Cost is the
|
|
210
|
+
// lesser half: +1333 ns per href with `search-schema` +
|
|
211
|
+
// `persistent-params` installed, per `<Link>` per render.
|
|
212
|
+
const api = getPluginApi(router);
|
|
213
|
+
const forwarded = api.forwardState(routeName, routeParams, routeSearch);
|
|
214
|
+
resolved = api.buildPathResolved(forwarded.name, forwarded.params, forwarded.search);
|
|
198
215
|
}
|
|
199
216
|
catch {
|
|
200
217
|
resolved = undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Svelte 5 integration for Real-Router",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"sideEffects": false,
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@real-router/core": "^0.
|
|
51
|
+
"@real-router/core": "^0.134.0",
|
|
52
52
|
"@real-router/route-utils": "^0.4.0",
|
|
53
|
-
"@real-router/sources": "^0.14.
|
|
53
|
+
"@real-router/sources": "^0.14.41"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@real-router/browser-plugin": "^0.
|
|
56
|
+
"@real-router/browser-plugin": "^0.24.0",
|
|
57
57
|
"@sveltejs/package": "2.5.8",
|
|
58
58
|
"@sveltejs/vite-plugin-svelte": "7.3.0",
|
|
59
59
|
"@testing-library/jest-dom": "~6.9.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"eslint-plugin-svelte": "3.19.0",
|
|
63
63
|
"rimraf": "6.1.3",
|
|
64
64
|
"svelte": "~5.57.0",
|
|
65
|
-
"svelte-check": "4.6
|
|
65
|
+
"svelte-check": "4.7.6",
|
|
66
66
|
"svelte-eslint-parser": "1.8.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|