@tanstack/react-router 1.77.0 → 1.77.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.
- package/dist/cjs/router.cjs +3 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +5 -5
- package/dist/esm/router.d.ts +5 -5
- package/dist/esm/router.js +3 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +9 -6
package/dist/cjs/router.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { Manifest } from './manifest.cjs';
|
|
|
4
4
|
import { AnyContext, AnyRoute, AnyRouteWithContext, AnySearchSchema, ErrorRouteComponent, NotFoundRouteComponent, RootRoute, RouteComponent, RouteMask } from './route.cjs';
|
|
5
5
|
import { FullSearchSchema, RouteById, RoutePaths, RoutesById, RoutesByPath } from './routeInfo.cjs';
|
|
6
6
|
import { ControlledPromise, NonNullableUpdater, PickAsRequired, Updater } from './utils.cjs';
|
|
7
|
-
import { AnyRouteMatch, MakeRouteMatch, MatchRouteOptions } from './Matches.cjs';
|
|
7
|
+
import { AnyRouteMatch, MakeRouteMatch, MakeRouteMatchUnion, MatchRouteOptions } from './Matches.cjs';
|
|
8
8
|
import { ParsedLocation } from './location.cjs';
|
|
9
9
|
import { SearchParser, SearchSerializer } from './searchParams.cjs';
|
|
10
10
|
import { BuildLocationFn, CommitLocationOptions, NavigateFn } from './RouterProvider.cjs';
|
|
@@ -519,12 +519,12 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
519
519
|
updateMatch?: (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => void;
|
|
520
520
|
getMatch?: (matchId: string) => AnyRouteMatch | undefined;
|
|
521
521
|
}) => Promise<Array<MakeRouteMatch>>;
|
|
522
|
-
invalidate: (opts?: {
|
|
523
|
-
filter?: (d:
|
|
522
|
+
invalidate: <TRouter extends AnyRouter = AnyRouter>(opts?: {
|
|
523
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
524
524
|
}) => Promise<void>;
|
|
525
525
|
resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
|
|
526
|
-
clearCache: (opts?: {
|
|
527
|
-
filter?: (d:
|
|
526
|
+
clearCache: <TRouter extends AnyRouter = AnyRouter>(opts?: {
|
|
527
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
528
528
|
}) => void;
|
|
529
529
|
clearExpiredCache: () => void;
|
|
530
530
|
preloadRoute: <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string | undefined = undefined, TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = "">(opts: NavigateOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
|
package/dist/esm/router.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Manifest } from './manifest.js';
|
|
|
4
4
|
import { AnyContext, AnyRoute, AnyRouteWithContext, AnySearchSchema, ErrorRouteComponent, NotFoundRouteComponent, RootRoute, RouteComponent, RouteMask } from './route.js';
|
|
5
5
|
import { FullSearchSchema, RouteById, RoutePaths, RoutesById, RoutesByPath } from './routeInfo.js';
|
|
6
6
|
import { ControlledPromise, NonNullableUpdater, PickAsRequired, Updater } from './utils.js';
|
|
7
|
-
import { AnyRouteMatch, MakeRouteMatch, MatchRouteOptions } from './Matches.js';
|
|
7
|
+
import { AnyRouteMatch, MakeRouteMatch, MakeRouteMatchUnion, MatchRouteOptions } from './Matches.js';
|
|
8
8
|
import { ParsedLocation } from './location.js';
|
|
9
9
|
import { SearchParser, SearchSerializer } from './searchParams.js';
|
|
10
10
|
import { BuildLocationFn, CommitLocationOptions, NavigateFn } from './RouterProvider.js';
|
|
@@ -519,12 +519,12 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
519
519
|
updateMatch?: (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => void;
|
|
520
520
|
getMatch?: (matchId: string) => AnyRouteMatch | undefined;
|
|
521
521
|
}) => Promise<Array<MakeRouteMatch>>;
|
|
522
|
-
invalidate: (opts?: {
|
|
523
|
-
filter?: (d:
|
|
522
|
+
invalidate: <TRouter extends AnyRouter = AnyRouter>(opts?: {
|
|
523
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
524
524
|
}) => Promise<void>;
|
|
525
525
|
resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
|
|
526
|
-
clearCache: (opts?: {
|
|
527
|
-
filter?: (d:
|
|
526
|
+
clearCache: <TRouter extends AnyRouter = AnyRouter>(opts?: {
|
|
527
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
528
528
|
}) => void;
|
|
529
529
|
clearExpiredCache: () => void;
|
|
530
530
|
preloadRoute: <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string | undefined = undefined, TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = "">(opts: NavigateOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
|
package/dist/esm/router.js
CHANGED
|
@@ -1153,7 +1153,9 @@ class Router {
|
|
|
1153
1153
|
this.__store.setState((s) => {
|
|
1154
1154
|
return {
|
|
1155
1155
|
...s,
|
|
1156
|
-
cachedMatches: s.cachedMatches.filter(
|
|
1156
|
+
cachedMatches: s.cachedMatches.filter(
|
|
1157
|
+
(m) => !filter(m)
|
|
1158
|
+
)
|
|
1157
1159
|
};
|
|
1158
1160
|
});
|
|
1159
1161
|
} else {
|