@tanstack/react-router 0.0.1-beta.10 → 0.0.1-beta.12
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/react-router/src/index.js +2 -3
- package/build/cjs/react-router/src/index.js.map +1 -1
- package/build/cjs/router-core/build/esm/index.js +5 -10
- package/build/cjs/router-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +6 -14
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +29 -29
- package/build/types/index.d.ts +3 -1
- package/build/umd/index.development.js +7 -13
- 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 +3 -2
- package/src/index.tsx +2 -2
package/build/stats-html.html
CHANGED
|
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
4014
4014
|
</script>
|
|
4015
4015
|
<script>
|
|
4016
4016
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"2ef3-59","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"packages","children":[{"name":"router-core/build/esm/index.js","uid":"2ef3-61"},{"name":"react-router/src/index.tsx","uid":"2ef3-63"}]}]}],"isRoot":true},"nodeParts":{"2ef3-59":{"renderedLength":798,"gzipLength":366,"brotliLength":0,"mainUid":"2ef3-58"},"2ef3-61":{"renderedLength":75522,"gzipLength":15692,"brotliLength":0,"mainUid":"2ef3-60"},"2ef3-63":{"renderedLength":11941,"gzipLength":3092,"brotliLength":0,"mainUid":"2ef3-62"}},"nodeMetas":{"2ef3-58":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"2ef3-59"},"imported":[],"importedBy":[{"uid":"2ef3-62"}]},"2ef3-60":{"id":"/packages/router-core/build/esm/index.js","moduleParts":{"index.production.js":"2ef3-61"},"imported":[],"importedBy":[{"uid":"2ef3-62"}]},"2ef3-62":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"2ef3-63"},"imported":[{"uid":"2ef3-58"},{"uid":"2ef3-64"},{"uid":"2ef3-65"},{"uid":"2ef3-60"}],"importedBy":[],"isEntry":true},"2ef3-64":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"2ef3-62"}],"isExternal":true},"2ef3-65":{"id":"use-sync-external-store/shim","moduleParts":{},"imported":[],"importedBy":[{"uid":"2ef3-62"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4018
4018
|
|
|
4019
4019
|
const run = () => {
|
|
4020
4020
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"name": "index.production.js",
|
|
8
8
|
"children": [
|
|
9
9
|
{
|
|
10
|
-
"uid": "
|
|
10
|
+
"uid": "2ef3-67",
|
|
11
11
|
"name": "\u0000rollupPluginBabelHelpers.js"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"children": [
|
|
16
16
|
{
|
|
17
17
|
"name": "router-core/build/esm/index.js",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "2ef3-69"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "react-router/src/index.tsx",
|
|
22
|
-
"uid": "
|
|
22
|
+
"uid": "2ef3-71"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -29,90 +29,90 @@
|
|
|
29
29
|
"isRoot": true
|
|
30
30
|
},
|
|
31
31
|
"nodeParts": {
|
|
32
|
-
"
|
|
32
|
+
"2ef3-67": {
|
|
33
33
|
"renderedLength": 798,
|
|
34
34
|
"gzipLength": 366,
|
|
35
35
|
"brotliLength": 0,
|
|
36
|
-
"mainUid": "
|
|
36
|
+
"mainUid": "2ef3-66"
|
|
37
37
|
},
|
|
38
|
-
"
|
|
39
|
-
"renderedLength":
|
|
40
|
-
"gzipLength":
|
|
38
|
+
"2ef3-69": {
|
|
39
|
+
"renderedLength": 75522,
|
|
40
|
+
"gzipLength": 15692,
|
|
41
41
|
"brotliLength": 0,
|
|
42
|
-
"mainUid": "
|
|
42
|
+
"mainUid": "2ef3-68"
|
|
43
43
|
},
|
|
44
|
-
"
|
|
45
|
-
"renderedLength":
|
|
46
|
-
"gzipLength":
|
|
44
|
+
"2ef3-71": {
|
|
45
|
+
"renderedLength": 11941,
|
|
46
|
+
"gzipLength": 3092,
|
|
47
47
|
"brotliLength": 0,
|
|
48
|
-
"mainUid": "
|
|
48
|
+
"mainUid": "2ef3-70"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"nodeMetas": {
|
|
52
|
-
"
|
|
52
|
+
"2ef3-66": {
|
|
53
53
|
"id": "\u0000rollupPluginBabelHelpers.js",
|
|
54
54
|
"moduleParts": {
|
|
55
|
-
"index.production.js": "
|
|
55
|
+
"index.production.js": "2ef3-67"
|
|
56
56
|
},
|
|
57
57
|
"imported": [],
|
|
58
58
|
"importedBy": [
|
|
59
59
|
{
|
|
60
|
-
"uid": "
|
|
60
|
+
"uid": "2ef3-70"
|
|
61
61
|
}
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"
|
|
64
|
+
"2ef3-68": {
|
|
65
65
|
"id": "/packages/router-core/build/esm/index.js",
|
|
66
66
|
"moduleParts": {
|
|
67
|
-
"index.production.js": "
|
|
67
|
+
"index.production.js": "2ef3-69"
|
|
68
68
|
},
|
|
69
69
|
"imported": [],
|
|
70
70
|
"importedBy": [
|
|
71
71
|
{
|
|
72
|
-
"uid": "
|
|
72
|
+
"uid": "2ef3-70"
|
|
73
73
|
}
|
|
74
74
|
]
|
|
75
75
|
},
|
|
76
|
-
"
|
|
76
|
+
"2ef3-70": {
|
|
77
77
|
"id": "/packages/react-router/src/index.tsx",
|
|
78
78
|
"moduleParts": {
|
|
79
|
-
"index.production.js": "
|
|
79
|
+
"index.production.js": "2ef3-71"
|
|
80
80
|
},
|
|
81
81
|
"imported": [
|
|
82
82
|
{
|
|
83
|
-
"uid": "
|
|
83
|
+
"uid": "2ef3-66"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "2ef3-72"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
"uid": "
|
|
89
|
+
"uid": "2ef3-73"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
|
-
"uid": "
|
|
92
|
+
"uid": "2ef3-68"
|
|
93
93
|
}
|
|
94
94
|
],
|
|
95
95
|
"importedBy": [],
|
|
96
96
|
"isEntry": true
|
|
97
97
|
},
|
|
98
|
-
"
|
|
98
|
+
"2ef3-72": {
|
|
99
99
|
"id": "react",
|
|
100
100
|
"moduleParts": {},
|
|
101
101
|
"imported": [],
|
|
102
102
|
"importedBy": [
|
|
103
103
|
{
|
|
104
|
-
"uid": "
|
|
104
|
+
"uid": "2ef3-70"
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
107
|
"isExternal": true
|
|
108
108
|
},
|
|
109
|
-
"
|
|
109
|
+
"2ef3-73": {
|
|
110
110
|
"id": "use-sync-external-store/shim",
|
|
111
111
|
"moduleParts": {},
|
|
112
112
|
"imported": [],
|
|
113
113
|
"importedBy": [
|
|
114
114
|
{
|
|
115
|
-
"uid": "
|
|
115
|
+
"uid": "2ef3-70"
|
|
116
116
|
}
|
|
117
117
|
],
|
|
118
118
|
"isExternal": true
|
package/build/types/index.d.ts
CHANGED
|
@@ -68,6 +68,8 @@ declare type RouterProps<TRouteConfig extends AnyRouteConfig = RouteConfig, TAll
|
|
|
68
68
|
children?: React.ReactNode;
|
|
69
69
|
};
|
|
70
70
|
declare function RouterProvider<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo>({ children, router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo>): JSX.Element;
|
|
71
|
+
declare function useRouter(): Router;
|
|
72
|
+
declare function useMatches(): RouteMatch[];
|
|
71
73
|
declare function Outlet(): JSX.Element | null;
|
|
72
74
|
declare function DefaultErrorBoundary({ error }: {
|
|
73
75
|
error: any;
|
|
@@ -75,4 +77,4 @@ declare function DefaultErrorBoundary({ error }: {
|
|
|
75
77
|
declare function usePrompt(message: string, when: boolean | any): void;
|
|
76
78
|
declare function Prompt({ message, when, children }: PromptProps): React.ReactNode;
|
|
77
79
|
|
|
78
|
-
export { DefaultErrorBoundary, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, RouterProps, RouterProvider, createReactRouter, usePrompt };
|
|
80
|
+
export { DefaultErrorBoundary, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, RouterProps, RouterProvider, createReactRouter, useMatches, usePrompt, useRouter };
|
|
@@ -1939,6 +1939,9 @@
|
|
|
1939
1939
|
exiting.push(d);
|
|
1940
1940
|
}
|
|
1941
1941
|
});
|
|
1942
|
+
const entering = matches.filter(d => {
|
|
1943
|
+
return !previousMatches.find(dd => dd.matchId === d.matchId);
|
|
1944
|
+
});
|
|
1942
1945
|
const now = Date.now();
|
|
1943
1946
|
exiting.forEach(d => {
|
|
1944
1947
|
var _ref, _d$options$loaderGcMa, _ref2, _d$options$loaderMaxA;
|
|
@@ -1946,12 +1949,7 @@
|
|
|
1946
1949
|
d.__.onExit == null ? void 0 : d.__.onExit({
|
|
1947
1950
|
params: d.params,
|
|
1948
1951
|
search: d.routeSearch
|
|
1949
|
-
}); //
|
|
1950
|
-
// if (d.action) {
|
|
1951
|
-
// d.action.current = undefined
|
|
1952
|
-
// d.action.submissions = []
|
|
1953
|
-
// }
|
|
1954
|
-
// Clear idle error states when match leaves
|
|
1952
|
+
}); // Clear idle error states when match leaves
|
|
1955
1953
|
|
|
1956
1954
|
if (d.status === 'error' && !d.isFetching) {
|
|
1957
1955
|
d.status = 'idle';
|
|
@@ -1973,16 +1971,13 @@
|
|
|
1973
1971
|
search: d.routeSearch
|
|
1974
1972
|
});
|
|
1975
1973
|
});
|
|
1976
|
-
const entering = matches.filter(d => {
|
|
1977
|
-
return !previousMatches.find(dd => dd.matchId === d.matchId);
|
|
1978
|
-
});
|
|
1979
1974
|
entering.forEach(d => {
|
|
1980
1975
|
d.__.onExit = d.options.onMatch == null ? void 0 : d.options.onMatch({
|
|
1981
1976
|
params: d.params,
|
|
1982
1977
|
search: d.search
|
|
1983
1978
|
});
|
|
1984
1979
|
delete router.matchCache[d.matchId];
|
|
1985
|
-
});
|
|
1980
|
+
});
|
|
1986
1981
|
|
|
1987
1982
|
if (router.startedLoadingAt !== id) {
|
|
1988
1983
|
// Ignore side-effects of match loading
|
|
@@ -2739,18 +2734,15 @@
|
|
|
2739
2734
|
value: router.state.matches
|
|
2740
2735
|
}, children != null ? children : /*#__PURE__*/React__namespace.createElement(Outlet, null)));
|
|
2741
2736
|
}
|
|
2742
|
-
|
|
2743
2737
|
function useRouter() {
|
|
2744
2738
|
const value = React__namespace.useContext(routerContext);
|
|
2745
2739
|
warning(!value, 'useRouter must be used inside a <Router> component!');
|
|
2746
2740
|
useRouterSubscription(value.router);
|
|
2747
2741
|
return value.router;
|
|
2748
2742
|
}
|
|
2749
|
-
|
|
2750
2743
|
function useMatches() {
|
|
2751
2744
|
return React__namespace.useContext(matchesContext);
|
|
2752
2745
|
}
|
|
2753
|
-
|
|
2754
2746
|
function Outlet() {
|
|
2755
2747
|
var _match$options$catchE;
|
|
2756
2748
|
|
|
@@ -2929,7 +2921,9 @@
|
|
|
2929
2921
|
exports.trimPath = trimPath;
|
|
2930
2922
|
exports.trimPathLeft = trimPathLeft;
|
|
2931
2923
|
exports.trimPathRight = trimPathRight;
|
|
2924
|
+
exports.useMatches = useMatches;
|
|
2932
2925
|
exports.usePrompt = usePrompt;
|
|
2926
|
+
exports.useRouter = useRouter;
|
|
2933
2927
|
exports.warning = warning;
|
|
2934
2928
|
|
|
2935
2929
|
Object.defineProperty(exports, '__esModule', { value: true });
|