@real-router/svelte 0.17.0 → 0.17.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.
@@ -114,13 +114,26 @@ export function navigateWithHash(router, routeName, routeParams, routeSearch, ha
114
114
  opts.hash = hash;
115
115
  }
116
116
  const current = router.getState();
117
- if (current?.name === routeName &&
118
- shallowEqual(current.params, routeParams) &&
119
- // Same-route hash bypass must also match the query channel (RFC-4 M2 /
120
- // #1548): a `routeSearch`-less link ignores it (compare current.search to
121
- // itself), so hash-only navigation on an unchanged query still bypasses
122
- // SAME_STATES.
123
- shallowEqual(current.search, routeSearch ?? current.search)) {
117
+ // "Does this link point at where we already are?" is a question the router
118
+ // owns, and asking it here by hand got two things wrong at once (#1555).
119
+ //
120
+ // The hand-rolled version compared with `Object.is` per key, so a link writing
121
+ // `routeSearch={{ page: "2" }}` never matched a state parsed from `?page=2`,
122
+ // where the value is the NUMBER 2 — the bypass silently did not fire, core
123
+ // rejected the navigation as SAME_STATES, and `<Link hash>` looked dead. The
124
+ // predicate carries the provenance-tolerant comparison (#1554) that makes the
125
+ // two forms equal because they print the same URL.
126
+ //
127
+ // It also compared the caller's whole `routeParams` bag against `state.params`,
128
+ // which stopped meaning anything once the channels split (#1548) — the
129
+ // predicate applies the channel rule instead of re-deriving it.
130
+ //
131
+ // `strictEquality: true` — a link to a PARENT route is a different location, so
132
+ // the hierarchical arm must not match. `ignoreQueryParams: false` — the query is
133
+ // part of the location here; ignoring it would fire the bypass across a real
134
+ // query change and let `force: true` smuggle it through as a hash change.
135
+ if (current !== undefined &&
136
+ router.isActiveRoute(routeName, routeParams, routeSearch ?? current.search, true, false)) {
124
137
  const currentHash = current.context?.url?.hash ??
125
138
  "";
126
139
  const newHash = hash ?? currentHash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/svelte",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
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.82.0",
51
+ "@real-router/core": "^0.83.0",
52
52
  "@real-router/route-utils": "^0.3.0",
53
- "@real-router/sources": "^0.13.0"
53
+ "@real-router/sources": "^0.13.1"
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.19.0"
66
+ "@real-router/browser-plugin": "^0.19.1"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "svelte": ">=5.7.0"