@bleedingdev/modern-js-plugin-tanstack 3.2.0-ultramodern.98 → 3.4.0-ultramodern.0
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/cli/index.js +80 -34
- package/dist/cjs/cli/routeSplitting.js +13 -41
- package/dist/cjs/cli/tanstackTypes.js +114 -200
- package/dist/cjs/cli.js +12 -8
- package/dist/cjs/runtime/basepathRewrite.js +12 -8
- package/dist/cjs/runtime/dataMutation.js +9 -5
- package/dist/cjs/runtime/hooks.js +20 -19
- package/dist/cjs/runtime/hydrationBoundary.js +12 -7
- package/dist/cjs/runtime/index.js +66 -54
- package/dist/cjs/runtime/lifecycle.js +21 -91
- package/dist/cjs/runtime/loaderBridge.js +173 -0
- package/dist/cjs/runtime/outlet.js +58 -0
- package/dist/cjs/runtime/plugin.js +190 -110
- package/dist/cjs/runtime/plugin.node.js +25 -40
- package/dist/cjs/runtime/plugin.worker.js +9 -5
- package/dist/cjs/runtime/pluginCore.js +55 -0
- package/dist/cjs/runtime/prefetchLink.js +10 -6
- package/dist/cjs/runtime/register.js +56 -0
- package/dist/cjs/runtime/routeTree.js +30 -212
- package/dist/cjs/runtime/router.js +41 -0
- package/dist/cjs/runtime/rsc/ClientSlot.js +9 -5
- package/dist/cjs/runtime/rsc/CompositeComponent.js +9 -5
- package/dist/cjs/runtime/rsc/ReplayableStream.js +14 -9
- package/dist/cjs/runtime/rsc/RscNodeRenderer.js +9 -5
- package/dist/cjs/runtime/rsc/SlotContext.js +9 -5
- package/dist/cjs/runtime/rsc/client.js +9 -5
- package/dist/cjs/runtime/rsc/createRscProxy.js +9 -5
- package/dist/cjs/runtime/rsc/index.js +9 -5
- package/dist/cjs/runtime/rsc/payloadRouter.js +44 -6
- package/dist/cjs/runtime/rsc/server.js +9 -5
- package/dist/cjs/runtime/rsc/slotUsageSanitizer.js +9 -5
- package/dist/cjs/runtime/rsc/symbols.js +20 -15
- package/dist/cjs/runtime/state.js +45 -0
- package/dist/cjs/runtime/types.js +13 -9
- package/dist/cjs/runtime/utils.js +9 -11
- package/dist/cjs/runtime.js +9 -5
- package/dist/esm/cli/index.mjs +73 -28
- package/dist/esm/cli/routeSplitting.mjs +1 -30
- package/dist/esm/cli/tanstackTypes.mjs +100 -190
- package/dist/esm/runtime/hooks.mjs +1 -8
- package/dist/esm/runtime/hydrationBoundary.mjs +3 -2
- package/dist/esm/runtime/index.mjs +4 -2
- package/dist/esm/runtime/lifecycle.mjs +1 -82
- package/dist/esm/runtime/loaderBridge.mjs +114 -0
- package/dist/esm/runtime/outlet.mjs +17 -0
- package/dist/esm/runtime/plugin.mjs +183 -107
- package/dist/esm/runtime/plugin.node.mjs +19 -38
- package/dist/esm/runtime/pluginCore.mjs +14 -0
- package/dist/esm/runtime/prefetchLink.mjs +1 -1
- package/dist/esm/runtime/register.mjs +18 -0
- package/dist/esm/runtime/routeTree.mjs +15 -198
- package/dist/esm/runtime/router.mjs +2 -0
- package/dist/esm/runtime/rsc/payloadRouter.mjs +35 -1
- package/dist/esm/runtime/state.mjs +7 -0
- package/dist/esm/runtime/utils.mjs +0 -6
- package/dist/esm-node/cli/index.mjs +73 -28
- package/dist/esm-node/cli/routeSplitting.mjs +1 -30
- package/dist/esm-node/cli/tanstackTypes.mjs +100 -190
- package/dist/esm-node/runtime/hooks.mjs +1 -8
- package/dist/esm-node/runtime/hydrationBoundary.mjs +3 -2
- package/dist/esm-node/runtime/index.mjs +4 -2
- package/dist/esm-node/runtime/lifecycle.mjs +1 -82
- package/dist/esm-node/runtime/loaderBridge.mjs +115 -0
- package/dist/esm-node/runtime/outlet.mjs +18 -0
- package/dist/esm-node/runtime/plugin.mjs +183 -107
- package/dist/esm-node/runtime/plugin.node.mjs +19 -38
- package/dist/esm-node/runtime/pluginCore.mjs +15 -0
- package/dist/esm-node/runtime/prefetchLink.mjs +1 -1
- package/dist/esm-node/runtime/register.mjs +19 -0
- package/dist/esm-node/runtime/routeTree.mjs +15 -198
- package/dist/esm-node/runtime/router.mjs +3 -0
- package/dist/esm-node/runtime/rsc/payloadRouter.mjs +35 -1
- package/dist/esm-node/runtime/state.mjs +8 -0
- package/dist/esm-node/runtime/utils.mjs +0 -6
- package/dist/types/cli/index.d.ts +11 -2
- package/dist/types/cli/routeSplitting.d.ts +6 -15
- package/dist/types/cli/tanstackTypes.d.ts +21 -1
- package/dist/types/runtime/hooks.d.ts +8 -33
- package/dist/types/runtime/index.d.ts +6 -3
- package/dist/types/runtime/lifecycle.d.ts +7 -22
- package/dist/types/runtime/loaderBridge.d.ts +48 -0
- package/dist/types/runtime/outlet.d.ts +2 -0
- package/dist/types/runtime/plugin.d.ts +1 -14
- package/dist/types/runtime/plugin.node.d.ts +1 -14
- package/dist/types/runtime/pluginCore.d.ts +21 -0
- package/dist/types/runtime/register.d.ts +9 -0
- package/dist/types/runtime/routeTree.d.ts +0 -2
- package/dist/types/runtime/router.d.ts +14 -0
- package/dist/types/runtime/state.d.ts +16 -0
- package/dist/types/runtime/types.d.ts +7 -53
- package/package.json +40 -38
- package/rstest.config.mts +6 -0
- package/src/cli/index.ts +146 -24
- package/src/cli/routeSplitting.ts +6 -44
- package/src/cli/tanstackTypes.ts +203 -208
- package/src/runtime/hooks.ts +10 -27
- package/src/runtime/hydrationBoundary.tsx +5 -5
- package/src/runtime/index.tsx +12 -14
- package/src/runtime/lifecycle.ts +16 -151
- package/src/runtime/loaderBridge.ts +257 -0
- package/src/runtime/outlet.tsx +48 -0
- package/src/runtime/plugin.node.tsx +28 -83
- package/src/runtime/plugin.tsx +350 -202
- package/src/runtime/pluginCore.ts +48 -0
- package/src/runtime/prefetchLink.tsx +1 -1
- package/src/runtime/register.ts +58 -0
- package/src/runtime/routeTree.ts +41 -365
- package/src/runtime/router.ts +15 -0
- package/src/runtime/rsc/payloadRouter.ts +45 -2
- package/src/runtime/ssr-shim.d.ts +1 -3
- package/src/runtime/state.ts +29 -0
- package/src/runtime/types.ts +20 -67
- package/src/runtime/utils.tsx +3 -7
- package/tests/router/cli.test.ts +373 -31
- package/tests/router/hooks.test.ts +26 -0
- package/tests/router/loaderBridge.test.ts +211 -0
- package/tests/router/packageSurface.test.ts +24 -0
- package/tests/router/prefetchLink.test.tsx +43 -7
- package/tests/router/register.test.ts +46 -0
- package/tests/router/routeTree.test.ts +176 -139
- package/tests/router/rsc.test.tsx +70 -0
- package/tests/router/tanstackTypes.test.ts +395 -7
- package/dist/cjs/runtime/DefaultNotFound.js +0 -47
- package/dist/esm/runtime/DefaultNotFound.mjs +0 -13
- package/dist/esm-node/runtime/DefaultNotFound.mjs +0 -14
- package/dist/types/runtime/DefaultNotFound.d.ts +0 -2
- package/src/runtime/DefaultNotFound.tsx +0 -15
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -29,15 +33,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
33
|
});
|
|
30
34
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
35
|
const context_namespaceObject = require("@modern-js/runtime/context");
|
|
32
|
-
const merge_namespaceObject = require("@modern-js/runtime-utils/merge");
|
|
33
36
|
const url_namespaceObject = require("@modern-js/runtime-utils/url");
|
|
34
37
|
const react_router_namespaceObject = require("@tanstack/react-router");
|
|
35
|
-
const client_namespaceObject = require("@tanstack/react-router/ssr/client");
|
|
36
38
|
const external_react_namespaceObject = require("react");
|
|
37
39
|
const external_basepathRewrite_js_namespaceObject = require("./basepathRewrite.js");
|
|
38
40
|
const external_hooks_js_namespaceObject = require("./hooks.js");
|
|
39
41
|
const external_hydrationBoundary_js_namespaceObject = require("./hydrationBoundary.js");
|
|
40
42
|
const external_lifecycle_js_namespaceObject = require("./lifecycle.js");
|
|
43
|
+
const external_outlet_js_namespaceObject = require("./outlet.js");
|
|
44
|
+
const external_pluginCore_js_namespaceObject = require("./pluginCore.js");
|
|
41
45
|
const external_prefetchLink_js_namespaceObject = require("./prefetchLink.js");
|
|
42
46
|
const external_routeTree_js_namespaceObject = require("./routeTree.js");
|
|
43
47
|
const client_js_namespaceObject = require("./rsc/client.js");
|
|
@@ -70,35 +74,178 @@ function wrapRouterSubscribeWithBlockState(router, getBlockNavState) {
|
|
|
70
74
|
};
|
|
71
75
|
target[BLOCKING_SUBSCRIBE_SYMBOL] = true;
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
const routerHydrationRecords = new WeakMap();
|
|
78
|
+
const routeModulesKey = '_routeModules';
|
|
79
|
+
function pickRouteModuleComponent(routeModule, seen = new Set()) {
|
|
80
|
+
if ('function' == typeof routeModule || routeModule && 'object' == typeof routeModule && '$$typeof' in routeModule) return routeModule;
|
|
81
|
+
if (!routeModule || 'object' != typeof routeModule) return;
|
|
82
|
+
if (seen.has(routeModule)) return;
|
|
83
|
+
seen.add(routeModule);
|
|
84
|
+
const module = routeModule;
|
|
85
|
+
for (const candidate of [
|
|
86
|
+
module.default,
|
|
87
|
+
module.Component
|
|
88
|
+
]){
|
|
89
|
+
const component = pickRouteModuleComponent(candidate, seen);
|
|
90
|
+
if (component) return component;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function getCachedRouteModule(routeId) {
|
|
94
|
+
if ("u" < typeof window) return;
|
|
95
|
+
return window[routeModulesKey]?.[routeId];
|
|
96
|
+
}
|
|
97
|
+
function preloadHydratedRouteComponents(router) {
|
|
98
|
+
const preloadableRouter = router;
|
|
99
|
+
const routesById = preloadableRouter.routesById || {};
|
|
100
|
+
const matches = preloadableRouter.stores.matches.get();
|
|
101
|
+
return Promise.all(matches.map((match)=>{
|
|
102
|
+
if (void 0 === match.routeId || '' === match.routeId) return;
|
|
103
|
+
const route = routesById[match.routeId];
|
|
104
|
+
const component = route?.options?.component;
|
|
105
|
+
const preload = component?.load || component?.preload;
|
|
106
|
+
if ('function' != typeof preload) return;
|
|
107
|
+
return Promise.resolve(preload.call(component)).then((routeModule)=>{
|
|
108
|
+
const modernRouteId = route?.options?.staticData?.modernRouteId;
|
|
109
|
+
const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
|
|
110
|
+
const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
|
|
111
|
+
if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = (0, external_outlet_js_namespaceObject.withModernRouteMatchContext)(resolvedComponent, modernRouteId);
|
|
112
|
+
});
|
|
113
|
+
})).then(()=>void 0);
|
|
114
|
+
}
|
|
115
|
+
function hydrateTanstackRouter(router) {
|
|
116
|
+
return import("@tanstack/react-router/ssr/client").then(({ hydrate })=>hydrate(router));
|
|
117
|
+
}
|
|
118
|
+
function getTanstackSsrHydrationRecord(router) {
|
|
119
|
+
const existingHydrationRecord = routerHydrationRecords.get(router);
|
|
120
|
+
if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
|
|
121
|
+
const hydrationRecord = {
|
|
122
|
+
promise: Promise.resolve(),
|
|
123
|
+
status: 'pending'
|
|
124
|
+
};
|
|
125
|
+
routerHydrationRecords.set(router, hydrationRecord);
|
|
126
|
+
try {
|
|
127
|
+
hydrationRecord.promise = hydrateTanstackRouter(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
|
|
128
|
+
hydrationRecord.status = 'fulfilled';
|
|
129
|
+
return value;
|
|
130
|
+
}, (error)=>{
|
|
131
|
+
hydrationRecord.status = 'rejected';
|
|
132
|
+
hydrationRecord.error = error;
|
|
133
|
+
throw error;
|
|
134
|
+
});
|
|
135
|
+
} catch (error) {
|
|
136
|
+
hydrationRecord.status = 'rejected';
|
|
137
|
+
hydrationRecord.error = error;
|
|
138
|
+
hydrationRecord.promise = Promise.reject(error);
|
|
139
|
+
hydrationRecord.promise.catch(()=>{});
|
|
140
|
+
}
|
|
141
|
+
return hydrationRecord;
|
|
142
|
+
}
|
|
143
|
+
function getTanstackSsrHydrationPromise(router) {
|
|
144
|
+
return getTanstackSsrHydrationRecord(router).promise;
|
|
145
|
+
}
|
|
146
|
+
function hasTanstackSsrHydrationRecord(router) {
|
|
147
|
+
return routerHydrationRecords.has(router);
|
|
148
|
+
}
|
|
149
|
+
function ModernRouterClient({ router }) {
|
|
150
|
+
const hydrationRecord = getTanstackSsrHydrationRecord(router);
|
|
151
|
+
if ('rejected' === hydrationRecord.status) throw hydrationRecord.error;
|
|
152
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
153
|
+
router: router
|
|
80
154
|
});
|
|
81
155
|
}
|
|
82
156
|
const tanstackRouterPlugin = (userConfig = {})=>{
|
|
83
157
|
const plugin = {
|
|
84
158
|
name: '@modern-js/plugin-router-tanstack',
|
|
85
|
-
registryHooks:
|
|
86
|
-
modifyRoutes: external_hooks_js_namespaceObject.modifyRoutes,
|
|
87
|
-
onAfterCreateRouter: external_hooks_js_namespaceObject.onAfterCreateRouter,
|
|
88
|
-
onAfterHydrateRouter: external_hooks_js_namespaceObject.onAfterHydrateRouter,
|
|
89
|
-
onBeforeCreateRouter: external_hooks_js_namespaceObject.onBeforeCreateRouter,
|
|
90
|
-
onBeforeCreateRoutes: external_hooks_js_namespaceObject.onBeforeCreateRoutes,
|
|
91
|
-
onBeforeHydrateRouter: external_hooks_js_namespaceObject.onBeforeHydrateRouter
|
|
92
|
-
},
|
|
159
|
+
registryHooks: external_hooks_js_namespaceObject.routerProviderRegistryHooks,
|
|
93
160
|
setup: (api)=>{
|
|
161
|
+
const hooks = api.getHooks();
|
|
162
|
+
let cachedRouteObjects;
|
|
163
|
+
let cachedRouteTree = null;
|
|
164
|
+
let cachedRouter = null;
|
|
165
|
+
let cachedRouterBasepath = null;
|
|
166
|
+
const getMergedConfig = ()=>(0, external_pluginCore_js_namespaceObject.getMergedRouterConfig)(api, userConfig);
|
|
167
|
+
const getRouteObjects = ()=>{
|
|
168
|
+
if (void 0 !== cachedRouteObjects) return cachedRouteObjects;
|
|
169
|
+
const mergedConfig = getMergedConfig();
|
|
170
|
+
const { createRoutes } = mergedConfig;
|
|
171
|
+
const finalRouteConfig = (0, external_pluginCore_js_namespaceObject.getFinalRouteConfig)(mergedConfig);
|
|
172
|
+
const routeObjects = createRoutes ? createRoutes() : (0, external_utils_js_namespaceObject.createRouteObjectsFromConfig)({
|
|
173
|
+
routesConfig: finalRouteConfig
|
|
174
|
+
}) || [];
|
|
175
|
+
cachedRouteObjects = hooks.modifyRoutes.call(routeObjects);
|
|
176
|
+
return cachedRouteObjects;
|
|
177
|
+
};
|
|
178
|
+
const getRouteTree = ()=>{
|
|
179
|
+
if (cachedRouteTree) return cachedRouteTree;
|
|
180
|
+
const routeObjects = getRouteObjects();
|
|
181
|
+
if (!routeObjects.length) return null;
|
|
182
|
+
cachedRouteTree = (0, external_routeTree_js_namespaceObject.createRouteTreeFromRouteObjects)(routeObjects, {
|
|
183
|
+
rscPayloadRouter: (0, context_namespaceObject.getGlobalEnableRsc)()
|
|
184
|
+
});
|
|
185
|
+
return cachedRouteTree;
|
|
186
|
+
};
|
|
187
|
+
const selectBasePath = (pathname)=>{
|
|
188
|
+
const { serverBase = [] } = getMergedConfig();
|
|
189
|
+
const match = serverBase.find((baseUrl)=>isSegmentPrefix(pathname, baseUrl));
|
|
190
|
+
return match || '/';
|
|
191
|
+
};
|
|
192
|
+
const getClientBasename = (runtimeContext)=>{
|
|
193
|
+
const { basename = '' } = getMergedConfig();
|
|
194
|
+
const baseUrl = selectBasePath(location.pathname).replace(/^\/*/, '/');
|
|
195
|
+
return '/' === baseUrl ? (0, external_utils_js_namespaceObject.urlJoin)(baseUrl, runtimeContext._internalRouterBaseName || basename || '') : baseUrl;
|
|
196
|
+
};
|
|
197
|
+
const getRouter = (runtimeContext, _basename)=>{
|
|
198
|
+
const routeTree = getRouteTree();
|
|
199
|
+
if (!routeTree) return null;
|
|
200
|
+
const lifecycleContext = {
|
|
201
|
+
framework: 'tanstack',
|
|
202
|
+
phase: 'client-create',
|
|
203
|
+
routes: getRouteObjects(),
|
|
204
|
+
runtimeContext,
|
|
205
|
+
basename: _basename
|
|
206
|
+
};
|
|
207
|
+
hooks.onBeforeCreateRouter.call(lifecycleContext);
|
|
208
|
+
if (cachedRouter && cachedRouterBasepath === _basename) {
|
|
209
|
+
wrapRouterSubscribeWithBlockState(cachedRouter, runtimeContext.unstable_getBlockNavState);
|
|
210
|
+
hooks.onAfterCreateRouter.call({
|
|
211
|
+
...lifecycleContext,
|
|
212
|
+
router: cachedRouter,
|
|
213
|
+
runtimeContext
|
|
214
|
+
});
|
|
215
|
+
return cachedRouter;
|
|
216
|
+
}
|
|
217
|
+
const mergedConfig = getMergedConfig();
|
|
218
|
+
const { supportHtml5History = true } = mergedConfig;
|
|
219
|
+
const history = supportHtml5History ? (0, react_router_namespaceObject.createBrowserHistory)() : (0, react_router_namespaceObject.createHashHistory)();
|
|
220
|
+
const rewrite = (0, external_basepathRewrite_js_namespaceObject.createModernBasepathRewrite)(_basename);
|
|
221
|
+
const serializationAdapters = (0, context_namespaceObject.getGlobalEnableRsc)() ? (0, client_js_namespaceObject.getTanstackRscSerializationAdapters)() : void 0;
|
|
222
|
+
cachedRouter = (0, react_router_namespaceObject.createRouter)({
|
|
223
|
+
...(0, external_types_js_namespaceObject.getModernTanstackRouterFastDefaults)(mergedConfig),
|
|
224
|
+
routeTree,
|
|
225
|
+
basepath: '/',
|
|
226
|
+
rewrite,
|
|
227
|
+
history,
|
|
228
|
+
context: {},
|
|
229
|
+
...serializationAdapters ? {
|
|
230
|
+
serializationAdapters
|
|
231
|
+
} : {}
|
|
232
|
+
});
|
|
233
|
+
cachedRouterBasepath = _basename;
|
|
234
|
+
wrapRouterSubscribeWithBlockState(cachedRouter, runtimeContext.unstable_getBlockNavState);
|
|
235
|
+
hooks.onAfterCreateRouter.call({
|
|
236
|
+
...lifecycleContext,
|
|
237
|
+
router: cachedRouter,
|
|
238
|
+
runtimeContext
|
|
239
|
+
});
|
|
240
|
+
return cachedRouter;
|
|
241
|
+
};
|
|
94
242
|
api.onBeforeRender((context)=>{
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
243
|
+
const mergedConfig = getMergedConfig();
|
|
244
|
+
if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
98
245
|
const { ssrContext } = context;
|
|
99
246
|
const currentPathname = (0, url_namespaceObject.normalizePathname)(window.location.pathname);
|
|
100
|
-
const initialPathname = ssrContext?.request?.pathname
|
|
101
|
-
if (initialPathname && initialPathname !== currentPathname) {
|
|
247
|
+
const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? (0, url_namespaceObject.normalizePathname)(ssrContext.request.pathname) : void 0;
|
|
248
|
+
if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
|
|
102
249
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
103
250
|
console.error(errorMsg);
|
|
104
251
|
window.location.reload();
|
|
@@ -111,94 +258,26 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
111
258
|
useNavigate: react_router_namespaceObject.useNavigate,
|
|
112
259
|
useRouter: react_router_namespaceObject.useRouter
|
|
113
260
|
};
|
|
261
|
+
const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
|
|
262
|
+
if (hasSSRBootstrap && getRouteObjects().length > 0) {
|
|
263
|
+
const runtimeContext = context;
|
|
264
|
+
const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
|
|
265
|
+
if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
|
|
266
|
+
}
|
|
114
267
|
});
|
|
115
268
|
api.wrapRoot((App)=>{
|
|
116
|
-
|
|
117
|
-
const { serverBase = [], supportHtml5History = true, basename = '', routesConfig, createRoutes } = mergedConfig;
|
|
118
|
-
const finalRouteConfig = {
|
|
119
|
-
routes: (0, context_namespaceObject.getGlobalRoutes)(),
|
|
120
|
-
globalApp: (0, context_namespaceObject.getGlobalLayoutApp)(),
|
|
121
|
-
...routesConfig
|
|
122
|
-
};
|
|
123
|
-
if (!finalRouteConfig.routes && !createRoutes) return App;
|
|
124
|
-
const hooks = api.getHooks();
|
|
125
|
-
let cachedRouteObjects;
|
|
126
|
-
const getRouteObjects = ()=>{
|
|
127
|
-
if (void 0 !== cachedRouteObjects) return cachedRouteObjects;
|
|
128
|
-
const routeObjects = createRoutes ? createRoutes() : (0, external_utils_js_namespaceObject.createRouteObjectsFromConfig)({
|
|
129
|
-
routesConfig: finalRouteConfig
|
|
130
|
-
}) || [];
|
|
131
|
-
const normalizedRouteObjects = createRoutes ? routeObjects : stripSyntheticNotFoundRoute(routeObjects);
|
|
132
|
-
cachedRouteObjects = hooks.modifyRoutes.call(normalizedRouteObjects);
|
|
133
|
-
return cachedRouteObjects;
|
|
134
|
-
};
|
|
135
|
-
const selectBasePath = (pathname)=>{
|
|
136
|
-
const match = serverBase.find((baseUrl)=>isSegmentPrefix(pathname, baseUrl));
|
|
137
|
-
return match || '/';
|
|
138
|
-
};
|
|
139
|
-
let cachedRouteTree = null;
|
|
140
|
-
let cachedRouter = null;
|
|
141
|
-
let cachedRouterBasepath = null;
|
|
269
|
+
if (0 === getRouteObjects().length) return App;
|
|
142
270
|
const RouterWrapper = ()=>{
|
|
143
271
|
const runtimeContext = (0, external_react_namespaceObject.useContext)(context_namespaceObject.InternalRuntimeContext);
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const routeTree = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
147
|
-
if (cachedRouteTree) return cachedRouteTree;
|
|
148
|
-
const routeObjects = getRouteObjects();
|
|
149
|
-
if (!routeObjects.length) return null;
|
|
150
|
-
cachedRouteTree = (0, external_routeTree_js_namespaceObject.createRouteTreeFromRouteObjects)(routeObjects, {
|
|
151
|
-
rscPayloadRouter: (0, context_namespaceObject.getGlobalEnableRsc)()
|
|
152
|
-
});
|
|
153
|
-
return cachedRouteTree;
|
|
154
|
-
}, []);
|
|
272
|
+
const _basename = getClientBasename(runtimeContext);
|
|
273
|
+
const routeTree = (0, external_react_namespaceObject.useMemo)(()=>getRouteTree(), []);
|
|
155
274
|
if (!routeTree) return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {}) : null;
|
|
156
|
-
const router = (0, external_react_namespaceObject.useMemo)(()=>
|
|
157
|
-
const lifecycleContext = {
|
|
158
|
-
framework: 'tanstack',
|
|
159
|
-
phase: 'client-create',
|
|
160
|
-
routes: getRouteObjects(),
|
|
161
|
-
runtimeContext,
|
|
162
|
-
basename: _basename
|
|
163
|
-
};
|
|
164
|
-
hooks.onBeforeCreateRouter.call(lifecycleContext);
|
|
165
|
-
if (cachedRouter && cachedRouterBasepath === _basename) {
|
|
166
|
-
wrapRouterSubscribeWithBlockState(cachedRouter, runtimeContext.unstable_getBlockNavState);
|
|
167
|
-
hooks.onAfterCreateRouter.call({
|
|
168
|
-
...lifecycleContext,
|
|
169
|
-
router: cachedRouter,
|
|
170
|
-
runtimeContext
|
|
171
|
-
});
|
|
172
|
-
return cachedRouter;
|
|
173
|
-
}
|
|
174
|
-
const history = supportHtml5History ? (0, react_router_namespaceObject.createBrowserHistory)() : (0, react_router_namespaceObject.createHashHistory)();
|
|
175
|
-
const rewrite = (0, external_basepathRewrite_js_namespaceObject.createModernBasepathRewrite)(_basename);
|
|
176
|
-
const serializationAdapters = (0, context_namespaceObject.getGlobalEnableRsc)() ? (0, client_js_namespaceObject.getTanstackRscSerializationAdapters)() : void 0;
|
|
177
|
-
cachedRouter = (0, react_router_namespaceObject.createRouter)({
|
|
178
|
-
...(0, external_types_js_namespaceObject.getModernTanstackRouterFastDefaults)(mergedConfig),
|
|
179
|
-
routeTree,
|
|
180
|
-
basepath: '/',
|
|
181
|
-
rewrite,
|
|
182
|
-
history,
|
|
183
|
-
context: {},
|
|
184
|
-
...serializationAdapters ? {
|
|
185
|
-
serializationAdapters
|
|
186
|
-
} : {}
|
|
187
|
-
});
|
|
188
|
-
cachedRouterBasepath = _basename;
|
|
189
|
-
wrapRouterSubscribeWithBlockState(cachedRouter, runtimeContext.unstable_getBlockNavState);
|
|
190
|
-
hooks.onAfterCreateRouter.call({
|
|
191
|
-
...lifecycleContext,
|
|
192
|
-
router: cachedRouter,
|
|
193
|
-
runtimeContext
|
|
194
|
-
});
|
|
195
|
-
return cachedRouter;
|
|
196
|
-
}, [
|
|
275
|
+
const router = (0, external_react_namespaceObject.useMemo)(()=>getRouter(runtimeContext, _basename), [
|
|
197
276
|
_basename,
|
|
198
277
|
routeTree,
|
|
199
|
-
supportHtml5History,
|
|
200
278
|
runtimeContext
|
|
201
279
|
]);
|
|
280
|
+
if (!router) return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {}) : null;
|
|
202
281
|
const runtimeState = (0, external_lifecycle_js_namespaceObject.applyRouterRuntimeState)(runtimeContext, {
|
|
203
282
|
framework: 'tanstack',
|
|
204
283
|
basename: _basename,
|
|
@@ -212,20 +291,21 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
212
291
|
basename: _basename,
|
|
213
292
|
router
|
|
214
293
|
};
|
|
215
|
-
const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
|
|
216
|
-
|
|
294
|
+
const hasSSRBootstrap = "u" > typeof window && (Boolean(window.$_TSR) || hasTanstackSsrHydrationRecord(router));
|
|
295
|
+
const needsRouterClient = hasSSRBootstrap;
|
|
296
|
+
if (needsRouterClient) hooks.onBeforeHydrateRouter.call({
|
|
217
297
|
...lifecycleContext,
|
|
218
298
|
phase: 'hydrate',
|
|
219
299
|
router,
|
|
220
300
|
runtimeContext: runtimeState
|
|
221
301
|
});
|
|
222
|
-
const RouterContent =
|
|
302
|
+
const RouterContent = needsRouterClient ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ModernRouterClient, {
|
|
223
303
|
router: router
|
|
224
304
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
225
305
|
router: router
|
|
226
306
|
});
|
|
227
307
|
const HydratableRouterContent = (0, external_hydrationBoundary_js_namespaceObject.wrapTanstackSsrHydrationBoundary)(RouterContent, hasSSRBootstrap);
|
|
228
|
-
if (
|
|
308
|
+
if (needsRouterClient) hooks.onAfterHydrateRouter.call({
|
|
229
309
|
...lifecycleContext,
|
|
230
310
|
phase: 'hydrate',
|
|
231
311
|
router,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -29,17 +33,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
33
|
});
|
|
30
34
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
35
|
const context_namespaceObject = require("@modern-js/runtime/context");
|
|
32
|
-
const merge_namespaceObject = require("@modern-js/runtime-utils/merge");
|
|
33
36
|
const node_namespaceObject = require("@modern-js/runtime-utils/node");
|
|
34
37
|
const time_namespaceObject = require("@modern-js/runtime-utils/time");
|
|
35
38
|
const constants_namespaceObject = require("@modern-js/utils/universal/constants");
|
|
36
39
|
const react_router_namespaceObject = require("@tanstack/react-router");
|
|
37
|
-
const server_namespaceObject = require("@tanstack/router-core/ssr/server");
|
|
38
40
|
const external_react_namespaceObject = require("react");
|
|
39
41
|
const external_basepathRewrite_js_namespaceObject = require("./basepathRewrite.js");
|
|
40
42
|
const external_hooks_js_namespaceObject = require("./hooks.js");
|
|
41
43
|
const external_hydrationBoundary_js_namespaceObject = require("./hydrationBoundary.js");
|
|
42
44
|
const external_lifecycle_js_namespaceObject = require("./lifecycle.js");
|
|
45
|
+
const external_pluginCore_js_namespaceObject = require("./pluginCore.js");
|
|
43
46
|
const external_routeTree_js_namespaceObject = require("./routeTree.js");
|
|
44
47
|
const payloadRouter_js_namespaceObject = require("./rsc/payloadRouter.js");
|
|
45
48
|
const external_types_js_namespaceObject = require("./types.js");
|
|
@@ -57,7 +60,7 @@ function isPreloadableRouteComponent(component) {
|
|
|
57
60
|
return 'function' == typeof preloadable.load || 'function' == typeof preloadable.preload;
|
|
58
61
|
}
|
|
59
62
|
function isReactLazyRouteComponent(component) {
|
|
60
|
-
return
|
|
63
|
+
return null != component && 'object' == typeof component && 'function' == typeof component._init && '_payload' in component;
|
|
61
64
|
}
|
|
62
65
|
async function preloadReactLazyRouteComponent(component) {
|
|
63
66
|
try {
|
|
@@ -124,15 +127,6 @@ function createGetSsrHref(request) {
|
|
|
124
127
|
const url = new URL(request.url);
|
|
125
128
|
return `${url.pathname}${url.search}${url.hash}`;
|
|
126
129
|
}
|
|
127
|
-
function stripSyntheticNotFoundRoute(routes) {
|
|
128
|
-
return routes.filter((route)=>!('*' === route.path && !route.id && !route.loader)).map((route)=>{
|
|
129
|
-
if (!route.children?.length) return route;
|
|
130
|
-
return {
|
|
131
|
-
...route,
|
|
132
|
-
children: stripSyntheticNotFoundRoute(route.children)
|
|
133
|
-
};
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
130
|
function collectRouterErrors(tanstackRouter) {
|
|
137
131
|
const state = tanstackRouter.state;
|
|
138
132
|
const matches = Array.isArray(state.matches) ? state.matches : [];
|
|
@@ -144,29 +138,24 @@ function collectRouterErrors(tanstackRouter) {
|
|
|
144
138
|
}, {});
|
|
145
139
|
return Object.keys(errors).length > 0 ? errors : void 0;
|
|
146
140
|
}
|
|
141
|
+
async function attachServerSsrUtils(router) {
|
|
142
|
+
const { attachRouterServerSsrUtils } = await import("@tanstack/router-core/ssr/server");
|
|
143
|
+
attachRouterServerSsrUtils({
|
|
144
|
+
router,
|
|
145
|
+
manifest: void 0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
147
148
|
const tanstackRouterPlugin = (userConfig = {})=>{
|
|
148
149
|
const plugin = {
|
|
149
150
|
name: '@modern-js/plugin-router-tanstack',
|
|
150
|
-
registryHooks:
|
|
151
|
-
modifyRoutes: external_hooks_js_namespaceObject.modifyRoutes,
|
|
152
|
-
onAfterCreateRouter: external_hooks_js_namespaceObject.onAfterCreateRouter,
|
|
153
|
-
onAfterHydrateRouter: external_hooks_js_namespaceObject.onAfterHydrateRouter,
|
|
154
|
-
onBeforeCreateRouter: external_hooks_js_namespaceObject.onBeforeCreateRouter,
|
|
155
|
-
onBeforeCreateRoutes: external_hooks_js_namespaceObject.onBeforeCreateRoutes,
|
|
156
|
-
onBeforeHydrateRouter: external_hooks_js_namespaceObject.onBeforeHydrateRouter
|
|
157
|
-
},
|
|
151
|
+
registryHooks: external_hooks_js_namespaceObject.routerProviderRegistryHooks,
|
|
158
152
|
setup: (api)=>{
|
|
159
153
|
api.onBeforeRender(async (context, interrupt)=>{
|
|
160
|
-
const
|
|
161
|
-
const mergedConfig = (0, merge_namespaceObject.merge)(pluginConfig.router || {}, userConfig);
|
|
154
|
+
const mergedConfig = (0, external_pluginCore_js_namespaceObject.getMergedRouterConfig)(api, userConfig);
|
|
162
155
|
const serializationAdapters = (0, context_namespaceObject.getGlobalEnableRsc)() ? (await import("./rsc/server.js")).getTanstackRscSerializationAdapters() : void 0;
|
|
163
156
|
const enableRsc = (0, context_namespaceObject.getGlobalEnableRsc)();
|
|
164
|
-
const { basename = '',
|
|
165
|
-
const finalRouteConfig =
|
|
166
|
-
routes: (0, context_namespaceObject.getGlobalRoutes)(),
|
|
167
|
-
globalApp: (0, context_namespaceObject.getGlobalLayoutApp)(),
|
|
168
|
-
...routesConfig
|
|
169
|
-
};
|
|
157
|
+
const { basename = '', createRoutes } = mergedConfig;
|
|
158
|
+
const finalRouteConfig = (0, external_pluginCore_js_namespaceObject.getFinalRouteConfig)(mergedConfig);
|
|
170
159
|
if (!finalRouteConfig.routes && !createRoutes) return;
|
|
171
160
|
const hooks = api.getHooks();
|
|
172
161
|
await hooks.onBeforeCreateRoutes.call(context);
|
|
@@ -174,8 +163,7 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
174
163
|
routesConfig: finalRouteConfig,
|
|
175
164
|
ssrMode: context.ssrContext?.mode
|
|
176
165
|
}) || [];
|
|
177
|
-
const
|
|
178
|
-
const modifiedRouteObjects = hooks.modifyRoutes.call(normalizedRouteObjects);
|
|
166
|
+
const modifiedRouteObjects = hooks.modifyRoutes.call(routeObjects);
|
|
179
167
|
if (!modifiedRouteObjects.length) return;
|
|
180
168
|
const { request, nonce, baseUrl, loaderFailureMode = 'errorBoundary' } = context.ssrContext;
|
|
181
169
|
const _basename = '/' === baseUrl ? (0, external_utils_js_namespaceObject.urlJoin)(baseUrl, basename || '') : baseUrl;
|
|
@@ -223,10 +211,7 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
223
211
|
} : {}
|
|
224
212
|
});
|
|
225
213
|
const serverRouter = tanstackRouter;
|
|
226
|
-
(
|
|
227
|
-
router: serverRouter,
|
|
228
|
-
manifest: void 0
|
|
229
|
-
});
|
|
214
|
+
await attachServerSsrUtils(serverRouter);
|
|
230
215
|
const end = (0, time_namespaceObject.time)();
|
|
231
216
|
try {
|
|
232
217
|
await tanstackRouter.load({
|
|
@@ -293,7 +278,7 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
293
278
|
api.wrapRoot((App)=>{
|
|
294
279
|
const getRouteApp = ()=>(props)=>{
|
|
295
280
|
const context = (0, external_react_namespaceObject.useContext)(context_namespaceObject.InternalRuntimeContext);
|
|
296
|
-
const router =
|
|
281
|
+
const router = (0, external_lifecycle_js_namespaceObject.getRouterRuntimeState)(context)?.instance;
|
|
297
282
|
if (!router) return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
298
283
|
...props
|
|
299
284
|
}) : null;
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
getFinalRouteConfig: ()=>getFinalRouteConfig,
|
|
32
|
+
getMergedRouterConfig: ()=>getMergedRouterConfig
|
|
33
|
+
});
|
|
34
|
+
const context_namespaceObject = require("@modern-js/runtime/context");
|
|
35
|
+
const merge_namespaceObject = require("@modern-js/runtime-utils/merge");
|
|
36
|
+
function getMergedRouterConfig(api, userConfig) {
|
|
37
|
+
const pluginConfig = api.getRuntimeConfig();
|
|
38
|
+
return (0, merge_namespaceObject.merge)(pluginConfig.router || {}, userConfig);
|
|
39
|
+
}
|
|
40
|
+
function getFinalRouteConfig(mergedConfig) {
|
|
41
|
+
return {
|
|
42
|
+
routes: (0, context_namespaceObject.getGlobalRoutes)(),
|
|
43
|
+
globalApp: (0, context_namespaceObject.getGlobalLayoutApp)(),
|
|
44
|
+
...mergedConfig.routesConfig
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.getFinalRouteConfig = __webpack_exports__.getFinalRouteConfig;
|
|
48
|
+
exports.getMergedRouterConfig = __webpack_exports__.getMergedRouterConfig;
|
|
49
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
50
|
+
"getFinalRouteConfig",
|
|
51
|
+
"getMergedRouterConfig"
|
|
52
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
53
|
+
Object.defineProperty(exports, '__esModule', {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -33,7 +37,7 @@ function resolvePreloadFromPrefetch(prefetch, preload) {
|
|
|
33
37
|
if (void 0 !== preload) return preload;
|
|
34
38
|
if ('none' === prefetch) return false;
|
|
35
39
|
if ('intent' === prefetch || 'render' === prefetch || 'viewport' === prefetch) return prefetch;
|
|
36
|
-
return
|
|
40
|
+
return 'viewport';
|
|
37
41
|
}
|
|
38
42
|
const LinkComponentImpl = (props)=>{
|
|
39
43
|
const { prefetch, preload, ...rest } = props;
|