@bleedingdev/modern-js-runtime 3.2.0-ultramodern.95 → 3.2.0-ultramodern.97
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/runtime/tanstack/hydrationBoundary.js +43 -0
- package/dist/cjs/router/runtime/tanstack/plugin.js +4 -2
- package/dist/cjs/router/runtime/tanstack/plugin.node.js +3 -2
- package/dist/cjs/router/runtime/tanstack/routeTree.js +4 -2
- package/dist/esm/router/runtime/tanstack/hydrationBoundary.mjs +9 -0
- package/dist/esm/router/runtime/tanstack/plugin.mjs +4 -2
- package/dist/esm/router/runtime/tanstack/plugin.node.mjs +3 -2
- package/dist/esm/router/runtime/tanstack/routeTree.mjs +4 -2
- package/dist/esm-node/router/runtime/tanstack/hydrationBoundary.mjs +10 -0
- package/dist/esm-node/router/runtime/tanstack/plugin.mjs +4 -2
- package/dist/esm-node/router/runtime/tanstack/plugin.node.mjs +3 -2
- package/dist/esm-node/router/runtime/tanstack/routeTree.mjs +4 -2
- package/dist/types/router/runtime/tanstack/hydrationBoundary.d.ts +2 -0
- package/package.json +9 -9
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
wrapTanstackSsrHydrationBoundary: ()=>wrapTanstackSsrHydrationBoundary
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
function wrapTanstackSsrHydrationBoundary(routerContent, shouldWrap) {
|
|
32
|
+
return shouldWrap ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Suspense, {
|
|
33
|
+
fallback: null,
|
|
34
|
+
children: routerContent
|
|
35
|
+
}) : routerContent;
|
|
36
|
+
}
|
|
37
|
+
exports.wrapTanstackSsrHydrationBoundary = __webpack_exports__.wrapTanstackSsrHydrationBoundary;
|
|
38
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
39
|
+
"wrapTanstackSsrHydrationBoundary"
|
|
40
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
41
|
+
Object.defineProperty(exports, '__esModule', {
|
|
42
|
+
value: true
|
|
43
|
+
});
|
|
@@ -37,6 +37,7 @@ const external_hooks_js_namespaceObject = require("../hooks.js");
|
|
|
37
37
|
const external_lifecycle_js_namespaceObject = require("../lifecycle.js");
|
|
38
38
|
const external_utils_js_namespaceObject = require("../utils.js");
|
|
39
39
|
const external_basepathRewrite_js_namespaceObject = require("./basepathRewrite.js");
|
|
40
|
+
const external_hydrationBoundary_js_namespaceObject = require("./hydrationBoundary.js");
|
|
40
41
|
const external_prefetchLink_js_namespaceObject = require("./prefetchLink.js");
|
|
41
42
|
const external_routeTree_js_namespaceObject = require("./routeTree.js");
|
|
42
43
|
const client_js_namespaceObject = require("./rsc/client.js");
|
|
@@ -215,6 +216,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
215
216
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
216
217
|
router: router
|
|
217
218
|
});
|
|
219
|
+
const HydratableRouterContent = (0, external_hydrationBoundary_js_namespaceObject.wrapTanstackSsrHydrationBoundary)(RouterContent, hasSSRBootstrap);
|
|
218
220
|
if (hasSSRBootstrap) hooks.onAfterHydrateRouter.call({
|
|
219
221
|
...lifecycleContext,
|
|
220
222
|
phase: 'hydrate',
|
|
@@ -222,8 +224,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
222
224
|
runtimeContext: runtimeState
|
|
223
225
|
});
|
|
224
226
|
return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
225
|
-
children:
|
|
226
|
-
}) :
|
|
227
|
+
children: HydratableRouterContent
|
|
228
|
+
}) : HydratableRouterContent;
|
|
227
229
|
};
|
|
228
230
|
return RouterWrapper;
|
|
229
231
|
});
|
|
@@ -38,6 +38,7 @@ const index_js_namespaceObject = require("../../../core/context/index.js");
|
|
|
38
38
|
const external_lifecycle_js_namespaceObject = require("../lifecycle.js");
|
|
39
39
|
const external_utils_js_namespaceObject = require("../utils.js");
|
|
40
40
|
const external_basepathRewrite_js_namespaceObject = require("./basepathRewrite.js");
|
|
41
|
+
const external_hydrationBoundary_js_namespaceObject = require("./hydrationBoundary.js");
|
|
41
42
|
const external_routeTree_js_namespaceObject = require("./routeTree.js");
|
|
42
43
|
function isPreloadableRouteComponent(component) {
|
|
43
44
|
if (!component || 'function' != typeof component) return false;
|
|
@@ -247,9 +248,9 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
247
248
|
if (!router) return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
248
249
|
...props
|
|
249
250
|
}) : null;
|
|
250
|
-
const routerWrapper = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
251
|
+
const routerWrapper = (0, external_hydrationBoundary_js_namespaceObject.wrapTanstackSsrHydrationBoundary)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
251
252
|
router: router
|
|
252
|
-
});
|
|
253
|
+
}), true);
|
|
253
254
|
return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
254
255
|
children: routerWrapper
|
|
255
256
|
}) : routerWrapper;
|
|
@@ -489,9 +489,11 @@ function createRouteTreeFromRouteObjects(routes) {
|
|
|
489
489
|
}
|
|
490
490
|
function getModernRouteIdsFromMatches(router) {
|
|
491
491
|
const matches = router.state.matches || [];
|
|
492
|
+
const routesById = router.routesById;
|
|
492
493
|
const ids = matches.map((match)=>{
|
|
493
|
-
const
|
|
494
|
-
|
|
494
|
+
const normalizedMatch = match;
|
|
495
|
+
const routeId = 'string' == typeof normalizedMatch.routeId ? normalizedMatch.routeId : void 0;
|
|
496
|
+
return normalizedMatch.route?.options?.staticData?.modernRouteId ?? (routeId ? routesById?.[routeId]?.options?.staticData?.modernRouteId : void 0);
|
|
495
497
|
}).filter((id)=>'string' == typeof id);
|
|
496
498
|
return Array.from(new Set(ids));
|
|
497
499
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from "react";
|
|
3
|
+
function wrapTanstackSsrHydrationBoundary(routerContent, shouldWrap) {
|
|
4
|
+
return shouldWrap ? /*#__PURE__*/ jsx(Suspense, {
|
|
5
|
+
fallback: null,
|
|
6
|
+
children: routerContent
|
|
7
|
+
}) : routerContent;
|
|
8
|
+
}
|
|
9
|
+
export { wrapTanstackSsrHydrationBoundary };
|
|
@@ -9,6 +9,7 @@ import { onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBefo
|
|
|
9
9
|
import { applyRouterRuntimeState } from "../lifecycle.mjs";
|
|
10
10
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
11
11
|
import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
12
|
+
import { wrapTanstackSsrHydrationBoundary } from "./hydrationBoundary.mjs";
|
|
12
13
|
import { Link } from "./prefetchLink.mjs";
|
|
13
14
|
import { createRouteTreeFromRouteObjects } from "./routeTree.mjs";
|
|
14
15
|
import { getTanstackRscSerializationAdapters } from "./rsc/client.mjs";
|
|
@@ -187,6 +188,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
187
188
|
}) : /*#__PURE__*/ jsx(RouterProvider, {
|
|
188
189
|
router: router
|
|
189
190
|
});
|
|
191
|
+
const HydratableRouterContent = wrapTanstackSsrHydrationBoundary(RouterContent, hasSSRBootstrap);
|
|
190
192
|
if (hasSSRBootstrap) hooks.onAfterHydrateRouter.call({
|
|
191
193
|
...lifecycleContext,
|
|
192
194
|
phase: 'hydrate',
|
|
@@ -194,8 +196,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
194
196
|
runtimeContext: runtimeState
|
|
195
197
|
});
|
|
196
198
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
197
|
-
children:
|
|
198
|
-
}) :
|
|
199
|
+
children: HydratableRouterContent
|
|
200
|
+
}) : HydratableRouterContent;
|
|
199
201
|
};
|
|
200
202
|
return RouterWrapper;
|
|
201
203
|
});
|
|
@@ -10,6 +10,7 @@ import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlob
|
|
|
10
10
|
import { applyRouterServerPrepareResult, createRouterServerSnapshot } from "../lifecycle.mjs";
|
|
11
11
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
12
12
|
import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
13
|
+
import { wrapTanstackSsrHydrationBoundary } from "./hydrationBoundary.mjs";
|
|
13
14
|
import { createRouteTreeFromRouteObjects, getModernRouteIdsFromMatches } from "./routeTree.mjs";
|
|
14
15
|
function isPreloadableRouteComponent(component) {
|
|
15
16
|
if (!component || 'function' != typeof component) return false;
|
|
@@ -219,9 +220,9 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
219
220
|
if (!router) return App ? /*#__PURE__*/ jsx(App, {
|
|
220
221
|
...props
|
|
221
222
|
}) : null;
|
|
222
|
-
const routerWrapper = /*#__PURE__*/ jsx(RouterProvider, {
|
|
223
|
+
const routerWrapper = wrapTanstackSsrHydrationBoundary(/*#__PURE__*/ jsx(RouterProvider, {
|
|
223
224
|
router: router
|
|
224
|
-
});
|
|
225
|
+
}), true);
|
|
225
226
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
226
227
|
children: routerWrapper
|
|
227
228
|
}) : routerWrapper;
|
|
@@ -459,9 +459,11 @@ function createRouteTreeFromRouteObjects(routes) {
|
|
|
459
459
|
}
|
|
460
460
|
function getModernRouteIdsFromMatches(router) {
|
|
461
461
|
const matches = router.state.matches || [];
|
|
462
|
+
const routesById = router.routesById;
|
|
462
463
|
const ids = matches.map((match)=>{
|
|
463
|
-
const
|
|
464
|
-
|
|
464
|
+
const normalizedMatch = match;
|
|
465
|
+
const routeId = 'string' == typeof normalizedMatch.routeId ? normalizedMatch.routeId : void 0;
|
|
466
|
+
return normalizedMatch.route?.options?.staticData?.modernRouteId ?? (routeId ? routesById?.[routeId]?.options?.staticData?.modernRouteId : void 0);
|
|
465
467
|
}).filter((id)=>'string' == typeof id);
|
|
466
468
|
return Array.from(new Set(ids));
|
|
467
469
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
function wrapTanstackSsrHydrationBoundary(routerContent, shouldWrap) {
|
|
5
|
+
return shouldWrap ? /*#__PURE__*/ jsx(Suspense, {
|
|
6
|
+
fallback: null,
|
|
7
|
+
children: routerContent
|
|
8
|
+
}) : routerContent;
|
|
9
|
+
}
|
|
10
|
+
export { wrapTanstackSsrHydrationBoundary };
|
|
@@ -10,6 +10,7 @@ import { onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBefo
|
|
|
10
10
|
import { applyRouterRuntimeState } from "../lifecycle.mjs";
|
|
11
11
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
12
12
|
import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
13
|
+
import { wrapTanstackSsrHydrationBoundary } from "./hydrationBoundary.mjs";
|
|
13
14
|
import { Link } from "./prefetchLink.mjs";
|
|
14
15
|
import { createRouteTreeFromRouteObjects } from "./routeTree.mjs";
|
|
15
16
|
import { getTanstackRscSerializationAdapters } from "./rsc/client.mjs";
|
|
@@ -188,6 +189,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
188
189
|
}) : /*#__PURE__*/ jsx(RouterProvider, {
|
|
189
190
|
router: router
|
|
190
191
|
});
|
|
192
|
+
const HydratableRouterContent = wrapTanstackSsrHydrationBoundary(RouterContent, hasSSRBootstrap);
|
|
191
193
|
if (hasSSRBootstrap) hooks.onAfterHydrateRouter.call({
|
|
192
194
|
...lifecycleContext,
|
|
193
195
|
phase: 'hydrate',
|
|
@@ -195,8 +197,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
195
197
|
runtimeContext: runtimeState
|
|
196
198
|
});
|
|
197
199
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
198
|
-
children:
|
|
199
|
-
}) :
|
|
200
|
+
children: HydratableRouterContent
|
|
201
|
+
}) : HydratableRouterContent;
|
|
200
202
|
};
|
|
201
203
|
return RouterWrapper;
|
|
202
204
|
});
|
|
@@ -11,6 +11,7 @@ import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlob
|
|
|
11
11
|
import { applyRouterServerPrepareResult, createRouterServerSnapshot } from "../lifecycle.mjs";
|
|
12
12
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
13
13
|
import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
14
|
+
import { wrapTanstackSsrHydrationBoundary } from "./hydrationBoundary.mjs";
|
|
14
15
|
import { createRouteTreeFromRouteObjects, getModernRouteIdsFromMatches } from "./routeTree.mjs";
|
|
15
16
|
function isPreloadableRouteComponent(component) {
|
|
16
17
|
if (!component || 'function' != typeof component) return false;
|
|
@@ -220,9 +221,9 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
220
221
|
if (!router) return App ? /*#__PURE__*/ jsx(App, {
|
|
221
222
|
...props
|
|
222
223
|
}) : null;
|
|
223
|
-
const routerWrapper = /*#__PURE__*/ jsx(RouterProvider, {
|
|
224
|
+
const routerWrapper = wrapTanstackSsrHydrationBoundary(/*#__PURE__*/ jsx(RouterProvider, {
|
|
224
225
|
router: router
|
|
225
|
-
});
|
|
226
|
+
}), true);
|
|
226
227
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
227
228
|
children: routerWrapper
|
|
228
229
|
}) : routerWrapper;
|
|
@@ -460,9 +460,11 @@ function createRouteTreeFromRouteObjects(routes) {
|
|
|
460
460
|
}
|
|
461
461
|
function getModernRouteIdsFromMatches(router) {
|
|
462
462
|
const matches = router.state.matches || [];
|
|
463
|
+
const routesById = router.routesById;
|
|
463
464
|
const ids = matches.map((match)=>{
|
|
464
|
-
const
|
|
465
|
-
|
|
465
|
+
const normalizedMatch = match;
|
|
466
|
+
const routeId = 'string' == typeof normalizedMatch.routeId ? normalizedMatch.routeId : void 0;
|
|
467
|
+
return normalizedMatch.route?.options?.staticData?.modernRouteId ?? (routeId ? routesById?.[routeId]?.options?.staticData?.modernRouteId : void 0);
|
|
466
468
|
}).filter((id)=>'string' == typeof id);
|
|
467
469
|
return Array.from(new Set(ids));
|
|
468
470
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.97",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -233,12 +233,12 @@
|
|
|
233
233
|
"isbot": "5.1.40",
|
|
234
234
|
"react-helmet-async": "3.0.0",
|
|
235
235
|
"react-is": "^19.2.6",
|
|
236
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.
|
|
237
|
-
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.
|
|
238
|
-
"@modern-js/
|
|
239
|
-
"@modern-js/
|
|
240
|
-
"@modern-js/
|
|
241
|
-
"@modern-js/
|
|
236
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.97",
|
|
237
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.97",
|
|
238
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.97",
|
|
239
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.97",
|
|
240
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.97",
|
|
241
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.97"
|
|
242
242
|
},
|
|
243
243
|
"peerDependencies": {
|
|
244
244
|
"react": "^19.2.6",
|
|
@@ -257,8 +257,8 @@
|
|
|
257
257
|
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
258
258
|
"react": "^19.2.6",
|
|
259
259
|
"react-dom": "^19.2.6",
|
|
260
|
-
"@
|
|
261
|
-
"@
|
|
260
|
+
"@scripts/rstest-config": "2.66.0",
|
|
261
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.97"
|
|
262
262
|
},
|
|
263
263
|
"sideEffects": false,
|
|
264
264
|
"publishConfig": {
|