@tanstack/router-core 0.0.1-alpha.5 → 0.0.1-alpha.6
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/packages/router-core/src/index.js +9 -4
- package/build/cjs/packages/router-core/src/index.js.map +1 -1
- package/build/esm/index.js +9 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +42 -42
- package/build/types/index.d.ts +4 -1
- package/build/umd/index.development.js +9 -4
- 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/index.ts +11 -5
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1410,8 +1410,6 @@ export function createRouter<
|
|
|
1410
1410
|
router.startedLoadingAt = id
|
|
1411
1411
|
|
|
1412
1412
|
if (next) {
|
|
1413
|
-
// If the location.href has changed
|
|
1414
|
-
|
|
1415
1413
|
// Ingest the new location
|
|
1416
1414
|
router.location = next
|
|
1417
1415
|
}
|
|
@@ -1708,7 +1706,7 @@ export function createRouter<
|
|
|
1708
1706
|
...(router.state.pending?.matches ?? []),
|
|
1709
1707
|
].forEach((match) => {
|
|
1710
1708
|
if (unloadedMatchIds.includes(match.matchId)) {
|
|
1711
|
-
match.
|
|
1709
|
+
match.invalidate()
|
|
1712
1710
|
}
|
|
1713
1711
|
})
|
|
1714
1712
|
},
|
|
@@ -1757,7 +1755,7 @@ export function createRouter<
|
|
|
1757
1755
|
return router.commitLocation(next, location.replace)
|
|
1758
1756
|
},
|
|
1759
1757
|
|
|
1760
|
-
navigate: async ({ from, to = '.', search, hash, replace }) => {
|
|
1758
|
+
navigate: async ({ from, to = '.', search, hash, replace, params }) => {
|
|
1761
1759
|
// If this link simply reloads the current route,
|
|
1762
1760
|
// make sure it has a new key so it will trigger a data refresh
|
|
1763
1761
|
|
|
@@ -1783,6 +1781,8 @@ export function createRouter<
|
|
|
1783
1781
|
to: toString,
|
|
1784
1782
|
search,
|
|
1785
1783
|
hash,
|
|
1784
|
+
replace,
|
|
1785
|
+
params,
|
|
1786
1786
|
})
|
|
1787
1787
|
},
|
|
1788
1788
|
|
|
@@ -2319,7 +2319,9 @@ type SearchParamOptions<
|
|
|
2319
2319
|
search: SearchReducer<TFromSchema, TToSchema>
|
|
2320
2320
|
}
|
|
2321
2321
|
|
|
2322
|
-
type SearchReducer<TFrom, TTo> =
|
|
2322
|
+
type SearchReducer<TFrom, TTo> =
|
|
2323
|
+
| { [TKey in keyof TTo]: TTo[TKey] }
|
|
2324
|
+
| ((current: TFrom) => TTo)
|
|
2323
2325
|
|
|
2324
2326
|
type PathParamOptions<
|
|
2325
2327
|
TAllRouteInfo extends AnyAllRouteInfo,
|
|
@@ -2395,6 +2397,7 @@ export interface RouteMatch<
|
|
|
2395
2397
|
}
|
|
2396
2398
|
cancel: () => void
|
|
2397
2399
|
load: () => Promise<void>
|
|
2400
|
+
invalidate: () => void
|
|
2398
2401
|
}
|
|
2399
2402
|
|
|
2400
2403
|
export function createRouteMatch<
|
|
@@ -2514,6 +2517,9 @@ export function createRouteMatch<
|
|
|
2514
2517
|
routeMatch.__.abortController?.abort()
|
|
2515
2518
|
routeMatch.__.cancelPending()
|
|
2516
2519
|
},
|
|
2520
|
+
invalidate: () => {
|
|
2521
|
+
routeMatch.isInvalid = true
|
|
2522
|
+
},
|
|
2517
2523
|
load: async () => {
|
|
2518
2524
|
const id = '' + Date.now() + Math.random()
|
|
2519
2525
|
routeMatch.__.latestId = id
|