@tanstack/router-core 1.157.13 → 1.157.15
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/cjs/load-matches.cjs +0 -3
- package/dist/cjs/load-matches.cjs.map +1 -1
- package/dist/cjs/router.cjs +21 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/load-matches.js +0 -3
- package/dist/esm/load-matches.js.map +1 -1
- package/dist/esm/router.js +21 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/load-matches.ts +0 -7
- package/src/router.ts +26 -1
package/package.json
CHANGED
package/src/load-matches.ts
CHANGED
|
@@ -389,13 +389,6 @@ const executeBeforeLoad = (
|
|
|
389
389
|
|
|
390
390
|
const abortController = new AbortController()
|
|
391
391
|
|
|
392
|
-
const parentMatchId = inner.matches[index - 1]?.id
|
|
393
|
-
const parentMatch = parentMatchId
|
|
394
|
-
? inner.router.getMatch(parentMatchId)!
|
|
395
|
-
: undefined
|
|
396
|
-
const parentMatchContext =
|
|
397
|
-
parentMatch?.context ?? inner.router.options.context ?? undefined
|
|
398
|
-
|
|
399
392
|
let isPending = false
|
|
400
393
|
const pending = () => {
|
|
401
394
|
if (isPending) return
|
package/src/router.ts
CHANGED
|
@@ -1252,9 +1252,34 @@ export class RouterCore<
|
|
|
1252
1252
|
previousLocation,
|
|
1253
1253
|
) => {
|
|
1254
1254
|
const parse = ({
|
|
1255
|
+
pathname,
|
|
1256
|
+
search,
|
|
1257
|
+
hash,
|
|
1255
1258
|
href,
|
|
1256
1259
|
state,
|
|
1257
1260
|
}: HistoryLocation): ParsedLocation<FullSearchSchema<TRouteTree>> => {
|
|
1261
|
+
// Fast path: no rewrite configured and pathname doesn't need encoding
|
|
1262
|
+
// Characters that need encoding: space, high unicode, control chars
|
|
1263
|
+
// eslint-disable-next-line no-control-regex
|
|
1264
|
+
if (!this.rewrite && !/[ \x00-\x1f\x7f\u0080-\uffff]/.test(pathname)) {
|
|
1265
|
+
const parsedSearch = this.options.parseSearch(search)
|
|
1266
|
+
const searchStr = this.options.stringifySearch(parsedSearch)
|
|
1267
|
+
|
|
1268
|
+
return {
|
|
1269
|
+
href: pathname + searchStr + hash,
|
|
1270
|
+
publicHref: href,
|
|
1271
|
+
pathname: decodePath(pathname),
|
|
1272
|
+
external: false,
|
|
1273
|
+
searchStr,
|
|
1274
|
+
search: replaceEqualDeep(
|
|
1275
|
+
previousLocation?.search,
|
|
1276
|
+
parsedSearch,
|
|
1277
|
+
) as any,
|
|
1278
|
+
hash: decodePath(hash.slice(1)),
|
|
1279
|
+
state: replaceEqualDeep(previousLocation?.state, state),
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1258
1283
|
// Before we do any processing, we need to allow rewrites to modify the URL
|
|
1259
1284
|
// build up the full URL by combining the href from history with the router's origin
|
|
1260
1285
|
const fullUrl = new URL(href, this.origin)
|
|
@@ -1276,7 +1301,7 @@ export class RouterCore<
|
|
|
1276
1301
|
external: !!this.rewrite && url.origin !== this.origin,
|
|
1277
1302
|
searchStr,
|
|
1278
1303
|
search: replaceEqualDeep(previousLocation?.search, parsedSearch) as any,
|
|
1279
|
-
hash: decodePath(url.hash.
|
|
1304
|
+
hash: decodePath(url.hash.slice(1)),
|
|
1280
1305
|
state: replaceEqualDeep(previousLocation?.state, state),
|
|
1281
1306
|
}
|
|
1282
1307
|
}
|