@tanstack/react-router 1.33.6 → 1.33.8
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/index.d.cts +1 -0
- package/dist/cjs/manifest.d.cts +23 -0
- package/dist/cjs/router.cjs +7 -5
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +3 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/manifest.d.ts +23 -0
- package/dist/esm/router.d.ts +3 -0
- package/dist/esm/router.js +7 -5
- package/dist/esm/router.js.map +1 -1
- package/package.json +2 -1
- package/src/index.tsx +1 -0
- package/src/manifest.ts +31 -0
- package/src/router.ts +10 -4
package/dist/cjs/index.d.cts
CHANGED
|
@@ -36,3 +36,4 @@ export { escapeJSON, // SSR
|
|
|
36
36
|
useLayoutEffect, // SSR
|
|
37
37
|
pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, useStableCallback, shallow, } from './utils';
|
|
38
38
|
export { notFound, isNotFound, CatchNotFound, DefaultGlobalNotFound, type NotFoundError, } from './not-found.cjs';
|
|
39
|
+
export { type Manifest, type RouterManagedTag } from './manifest.cjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Manifest = {
|
|
2
|
+
routes: Record<string, {
|
|
3
|
+
preloads?: Array<string>;
|
|
4
|
+
assets?: Array<RouterManagedTag>;
|
|
5
|
+
}>;
|
|
6
|
+
};
|
|
7
|
+
export type RouterManagedTag = {
|
|
8
|
+
tag: 'title';
|
|
9
|
+
attrs?: Record<string, any>;
|
|
10
|
+
children: string;
|
|
11
|
+
} | {
|
|
12
|
+
tag: 'meta' | 'link';
|
|
13
|
+
attrs?: Record<string, any>;
|
|
14
|
+
children?: never;
|
|
15
|
+
} | {
|
|
16
|
+
tag: 'script';
|
|
17
|
+
attrs?: Record<string, any>;
|
|
18
|
+
children?: string;
|
|
19
|
+
} | {
|
|
20
|
+
tag: 'style';
|
|
21
|
+
attrs?: Record<string, any>;
|
|
22
|
+
children?: string;
|
|
23
|
+
};
|
package/dist/cjs/router.cjs
CHANGED
|
@@ -805,13 +805,13 @@ class Router {
|
|
|
805
805
|
err = errorHandlerErr;
|
|
806
806
|
handleRedirectAndNotFound(match, err);
|
|
807
807
|
}
|
|
808
|
-
matches[index] = match = {
|
|
808
|
+
matches[index] = match = updateMatch(match.id, () => ({
|
|
809
809
|
...match,
|
|
810
810
|
error: err,
|
|
811
811
|
status: "error",
|
|
812
812
|
updatedAt: Date.now(),
|
|
813
813
|
abortController: new AbortController()
|
|
814
|
-
};
|
|
814
|
+
}));
|
|
815
815
|
};
|
|
816
816
|
if (match.paramsError) {
|
|
817
817
|
handleSerialError(match.paramsError, "PARSE_PARAMS");
|
|
@@ -821,8 +821,8 @@ class Router {
|
|
|
821
821
|
}
|
|
822
822
|
try {
|
|
823
823
|
const parentContext = (parentMatch == null ? void 0 : parentMatch.context) ?? this.options.context ?? {};
|
|
824
|
-
matches[index] = match = updateMatch(match.id, (
|
|
825
|
-
...
|
|
824
|
+
matches[index] = match = updateMatch(match.id, () => ({
|
|
825
|
+
...match,
|
|
826
826
|
routeContext: utils.replaceEqualDeep(
|
|
827
827
|
match.routeContext,
|
|
828
828
|
parentContext
|
|
@@ -1207,7 +1207,8 @@ class Router {
|
|
|
1207
1207
|
__isServerError: true
|
|
1208
1208
|
} : void 0
|
|
1209
1209
|
}))
|
|
1210
|
-
}
|
|
1210
|
+
},
|
|
1211
|
+
manifest: this.manifest
|
|
1211
1212
|
};
|
|
1212
1213
|
};
|
|
1213
1214
|
this.hydrate = async (__do_not_use_server_ctx) => {
|
|
@@ -1258,6 +1259,7 @@ class Router {
|
|
|
1258
1259
|
matches
|
|
1259
1260
|
};
|
|
1260
1261
|
});
|
|
1262
|
+
this.manifest = ctx.router.manifest;
|
|
1261
1263
|
};
|
|
1262
1264
|
this.handleNotFound = (matches, err) => {
|
|
1263
1265
|
const matchesByRouteId = Object.fromEntries(
|