@real-router/svelte 0.20.0 → 0.20.1

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.
@@ -160,12 +160,13 @@ export function buildHref(router, routeName, routeParams, routeSearch, hash) {
160
160
  return url;
161
161
  }
162
162
  }
163
- // ⚑ The RESOLVING door, not `router.buildPath` (#2250). An href is a promise
164
- // about where the click lands, and the click resolves `forwardTo`.
165
- // `buildPath` is class LITERAL by record and answers about the route it was
166
- // NAMED — INVARIANTS #8 keeps that so a plugin can build a state for an alias
167
- // without being teleported off it, so the door choice belongs here rather
168
- // than one layer down.
163
+ // ⚑ RESOLVE, then print (#2250). An href is a promise about where the click
164
+ // lands, and the click resolves `forwardTo`. `router.buildPath` alone is
165
+ // class LITERAL by record and answers about the route it was NAMED —
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
+ // `buildPath` prints the target. The door choice belongs here rather than
169
+ // one layer down.
169
170
  //
170
171
  // ⚠ The `??` preserves the FAILURE shape, it is not a convenience: a name the
171
172
  // table does not hold makes the class-① door answer `undefined` where
@@ -187,7 +188,13 @@ export function buildHref(router, routeName, routeParams, routeSearch, hash) {
187
188
  // owns that.
188
189
  let resolved;
189
190
  try {
190
- resolved = getPluginApi(router).buildNavigationState(routeName, routeParams, routeSearch)?.path;
191
+ // ⚠ **`forwardState`, not `buildNavigationState`.** Both resolve the whole
192
+ // chain, and the href is identical — but the committing door opts into
193
+ // `reportUndeclaredParamKey`, and an href COMMITS NOTHING. That diagnostic
194
+ // is for a state you are about to persist, which is why `canNavigateTo`
195
+ // is silent despite sharing `navigate`'s form (#2248 / #1581).
196
+ const forwarded = getPluginApi(router).forwardState(routeName, routeParams, routeSearch);
197
+ resolved = router.buildPath(forwarded.name, forwarded.params, forwarded.search);
191
198
  }
192
199
  catch {
193
200
  resolved = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/svelte",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
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.132.0",
51
+ "@real-router/core": "^0.132.1",
52
52
  "@real-router/route-utils": "^0.4.0",
53
53
  "@real-router/sources": "^0.14.39"
54
54
  },
55
55
  "devDependencies": {
56
- "@real-router/browser-plugin": "^0.23.0",
56
+ "@real-router/browser-plugin": "^0.23.1",
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",