@tanstack/router-core 0.0.1-beta.34 → 0.0.1-beta.35
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/build/cjs/path.js +2 -2
- package/build/cjs/path.js.map +1 -1
- package/build/cjs/router.js +3 -4
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +5 -6
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +132 -132
- package/build/umd/index.development.js +5 -6
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/path.ts +2 -2
- package/src/router.ts +13 -4
package/package.json
CHANGED
package/src/path.ts
CHANGED
|
@@ -165,10 +165,10 @@ export function matchByPath(
|
|
|
165
165
|
from: string,
|
|
166
166
|
matchLocation: Pick<MatchLocation, 'to' | 'caseSensitive' | 'fuzzy'>,
|
|
167
167
|
): Record<string, string> | undefined {
|
|
168
|
-
if (
|
|
168
|
+
if (!from.startsWith(basepath)) {
|
|
169
169
|
return undefined
|
|
170
170
|
}
|
|
171
|
-
from =
|
|
171
|
+
from = basepath != '/' ? from.substring(basepath.length) : from
|
|
172
172
|
const baseSegments = parsePathname(from)
|
|
173
173
|
const to = `${matchLocation.to ?? '*'}`
|
|
174
174
|
const routeSegments = parsePathname(to)
|
package/src/router.ts
CHANGED
|
@@ -666,10 +666,8 @@ export function createRouter<
|
|
|
666
666
|
),
|
|
667
667
|
)
|
|
668
668
|
} catch (err: any) {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
throw err
|
|
669
|
+
console.info(err)
|
|
670
|
+
invariant(false, `A route's beforeLoad middleware failed! 👆`)
|
|
673
671
|
}
|
|
674
672
|
|
|
675
673
|
router.notify()
|
|
@@ -712,10 +710,12 @@ export function createRouter<
|
|
|
712
710
|
d.status = 'idle'
|
|
713
711
|
d.error = undefined
|
|
714
712
|
}
|
|
713
|
+
|
|
715
714
|
const gc = Math.max(
|
|
716
715
|
d.options.loaderGcMaxAge ?? router.options.defaultLoaderGcMaxAge ?? 0,
|
|
717
716
|
d.options.loaderMaxAge ?? router.options.defaultLoaderMaxAge ?? 0,
|
|
718
717
|
)
|
|
718
|
+
|
|
719
719
|
if (gc > 0) {
|
|
720
720
|
router.matchCache[d.matchId] = {
|
|
721
721
|
gc: gc == Infinity ? Number.MAX_SAFE_INTEGER : now + gc,
|
|
@@ -857,6 +857,14 @@ export function createRouter<
|
|
|
857
857
|
route.options.caseSensitive ?? router.options.caseSensitive,
|
|
858
858
|
})
|
|
859
859
|
|
|
860
|
+
console.log(
|
|
861
|
+
router.basepath,
|
|
862
|
+
route.fullPath,
|
|
863
|
+
fuzzy,
|
|
864
|
+
pathname,
|
|
865
|
+
matchParams,
|
|
866
|
+
)
|
|
867
|
+
|
|
860
868
|
if (matchParams) {
|
|
861
869
|
let parsedParams
|
|
862
870
|
|
|
@@ -1032,6 +1040,7 @@ export function createRouter<
|
|
|
1032
1040
|
if (!router.state.pending?.location) {
|
|
1033
1041
|
return false
|
|
1034
1042
|
}
|
|
1043
|
+
|
|
1035
1044
|
return !!matchPathname(
|
|
1036
1045
|
router.basepath,
|
|
1037
1046
|
router.state.pending.location.pathname,
|