@bleedingdev/modern-js-runtime 3.2.0-ultramodern.63 → 3.2.0-ultramodern.65
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/plugin.js +2 -5
- package/dist/cjs/router/runtime/tanstack/plugin.node.js +2 -5
- package/dist/esm/router/runtime/tanstack/plugin.mjs +6 -9
- package/dist/esm/router/runtime/tanstack/plugin.node.mjs +3 -6
- package/dist/esm-node/router/runtime/tanstack/plugin.mjs +6 -9
- package/dist/esm-node/router/runtime/tanstack/plugin.node.mjs +3 -6
- package/package.json +9 -9
|
@@ -210,11 +210,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
210
210
|
router,
|
|
211
211
|
runtimeContext: runtimeState
|
|
212
212
|
});
|
|
213
|
-
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
214
|
-
|
|
215
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.RouterClient, {
|
|
216
|
-
router: router
|
|
217
|
-
})
|
|
213
|
+
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.RouterClient, {
|
|
214
|
+
router: router
|
|
218
215
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
219
216
|
router: router
|
|
220
217
|
});
|
|
@@ -255,11 +255,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
255
255
|
if (!router) return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
256
256
|
...props
|
|
257
257
|
}) : null;
|
|
258
|
-
const routerWrapper = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
259
|
-
|
|
260
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
261
|
-
router: router
|
|
262
|
-
})
|
|
258
|
+
const routerWrapper = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_router_namespaceObject.RouterProvider, {
|
|
259
|
+
router: router
|
|
263
260
|
});
|
|
264
261
|
return App ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(App, {
|
|
265
262
|
children: routerWrapper
|
|
@@ -3,6 +3,7 @@ import { merge } from "@modern-js/runtime-utils/merge";
|
|
|
3
3
|
import { normalizePathname } from "@modern-js/runtime-utils/url";
|
|
4
4
|
import { RouterProvider, createBrowserHistory, createHashHistory, createRouter, useLocation, useMatches, useNavigate, useRouter } from "@tanstack/react-router";
|
|
5
5
|
import { RouterClient } from "@tanstack/react-router/ssr/client";
|
|
6
|
+
import { useContext, useMemo } from "react";
|
|
6
7
|
import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlobalRoutes } from "../../../core/context/index.mjs";
|
|
7
8
|
import { onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeHydrateRouter } from "../hooks.mjs";
|
|
8
9
|
import { applyRouterRuntimeState } from "../lifecycle.mjs";
|
|
@@ -11,7 +12,6 @@ import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
|
11
12
|
import { Link } from "./prefetchLink.mjs";
|
|
12
13
|
import { createRouteTreeFromRouteObjects } from "./routeTree.mjs";
|
|
13
14
|
import { getTanstackRscSerializationAdapters } from "./rsc/client.mjs";
|
|
14
|
-
import * as __rspack_external_react from "react";
|
|
15
15
|
const BLOCKING_SUBSCRIBE_SYMBOL = Symbol.for('@modern-js/plugin-runtime:tanstack-blocking-subscribe');
|
|
16
16
|
const BLOCKING_STATE_SYMBOL = Symbol.for('@modern-js/plugin-runtime:tanstack-blocking-state');
|
|
17
17
|
function normalizeBase(b) {
|
|
@@ -106,10 +106,10 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
106
106
|
let cachedRouter = null;
|
|
107
107
|
let cachedRouterBasepath = null;
|
|
108
108
|
const RouterWrapper = ()=>{
|
|
109
|
-
const runtimeContext =
|
|
109
|
+
const runtimeContext = useContext(InternalRuntimeContext);
|
|
110
110
|
const baseUrl = selectBasePath(location.pathname).replace(/^\/*/, '/');
|
|
111
111
|
const _basename = '/' === baseUrl ? urlJoin(baseUrl, runtimeContext._internalRouterBaseName || basename || '') : baseUrl;
|
|
112
|
-
const routeTree =
|
|
112
|
+
const routeTree = useMemo(()=>{
|
|
113
113
|
if (cachedRouteTree) return cachedRouteTree;
|
|
114
114
|
const routeObjects = getRouteObjects();
|
|
115
115
|
if (!routeObjects.length) return null;
|
|
@@ -117,7 +117,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
117
117
|
return cachedRouteTree;
|
|
118
118
|
}, []);
|
|
119
119
|
if (!routeTree) return App ? /*#__PURE__*/ jsx(App, {}) : null;
|
|
120
|
-
const router =
|
|
120
|
+
const router = useMemo(()=>{
|
|
121
121
|
const lifecycleContext = {
|
|
122
122
|
framework: 'tanstack',
|
|
123
123
|
phase: 'client-create',
|
|
@@ -182,11 +182,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
182
182
|
router,
|
|
183
183
|
runtimeContext: runtimeState
|
|
184
184
|
});
|
|
185
|
-
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ jsx(
|
|
186
|
-
|
|
187
|
-
children: /*#__PURE__*/ jsx(RouterClient, {
|
|
188
|
-
router: router
|
|
189
|
-
})
|
|
185
|
+
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ jsx(RouterClient, {
|
|
186
|
+
router: router
|
|
190
187
|
}) : /*#__PURE__*/ jsx(RouterProvider, {
|
|
191
188
|
router: router
|
|
192
189
|
});
|
|
@@ -5,7 +5,7 @@ import { time } from "@modern-js/runtime-utils/time";
|
|
|
5
5
|
import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
|
|
6
6
|
import { RouterProvider, createMemoryHistory, createRouter } from "@tanstack/react-router";
|
|
7
7
|
import { attachRouterServerSsrUtils } from "@tanstack/react-router/ssr/server";
|
|
8
|
-
import {
|
|
8
|
+
import { useContext } from "react";
|
|
9
9
|
import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlobalRoutes } from "../../../core/context/index.mjs";
|
|
10
10
|
import { applyRouterServerPrepareResult, createRouterServerSnapshot } from "../lifecycle.mjs";
|
|
11
11
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
@@ -227,11 +227,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
227
227
|
if (!router) return App ? /*#__PURE__*/ jsx(App, {
|
|
228
228
|
...props
|
|
229
229
|
}) : null;
|
|
230
|
-
const routerWrapper = /*#__PURE__*/ jsx(
|
|
231
|
-
|
|
232
|
-
children: /*#__PURE__*/ jsx(RouterProvider, {
|
|
233
|
-
router: router
|
|
234
|
-
})
|
|
230
|
+
const routerWrapper = /*#__PURE__*/ jsx(RouterProvider, {
|
|
231
|
+
router: router
|
|
235
232
|
});
|
|
236
233
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
237
234
|
children: routerWrapper
|
|
@@ -4,6 +4,7 @@ import { merge } from "@modern-js/runtime-utils/merge";
|
|
|
4
4
|
import { normalizePathname } from "@modern-js/runtime-utils/url";
|
|
5
5
|
import { RouterProvider, createBrowserHistory, createHashHistory, createRouter, useLocation, useMatches, useNavigate, useRouter } from "@tanstack/react-router";
|
|
6
6
|
import { RouterClient } from "@tanstack/react-router/ssr/client";
|
|
7
|
+
import { useContext, useMemo } from "react";
|
|
7
8
|
import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlobalRoutes } from "../../../core/context/index.mjs";
|
|
8
9
|
import { onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeHydrateRouter } from "../hooks.mjs";
|
|
9
10
|
import { applyRouterRuntimeState } from "../lifecycle.mjs";
|
|
@@ -12,7 +13,6 @@ import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
|
12
13
|
import { Link } from "./prefetchLink.mjs";
|
|
13
14
|
import { createRouteTreeFromRouteObjects } from "./routeTree.mjs";
|
|
14
15
|
import { getTanstackRscSerializationAdapters } from "./rsc/client.mjs";
|
|
15
|
-
import * as __rspack_external_react from "react";
|
|
16
16
|
const BLOCKING_SUBSCRIBE_SYMBOL = Symbol.for('@modern-js/plugin-runtime:tanstack-blocking-subscribe');
|
|
17
17
|
const BLOCKING_STATE_SYMBOL = Symbol.for('@modern-js/plugin-runtime:tanstack-blocking-state');
|
|
18
18
|
function normalizeBase(b) {
|
|
@@ -107,10 +107,10 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
107
107
|
let cachedRouter = null;
|
|
108
108
|
let cachedRouterBasepath = null;
|
|
109
109
|
const RouterWrapper = ()=>{
|
|
110
|
-
const runtimeContext =
|
|
110
|
+
const runtimeContext = useContext(InternalRuntimeContext);
|
|
111
111
|
const baseUrl = selectBasePath(location.pathname).replace(/^\/*/, '/');
|
|
112
112
|
const _basename = '/' === baseUrl ? urlJoin(baseUrl, runtimeContext._internalRouterBaseName || basename || '') : baseUrl;
|
|
113
|
-
const routeTree =
|
|
113
|
+
const routeTree = useMemo(()=>{
|
|
114
114
|
if (cachedRouteTree) return cachedRouteTree;
|
|
115
115
|
const routeObjects = getRouteObjects();
|
|
116
116
|
if (!routeObjects.length) return null;
|
|
@@ -118,7 +118,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
118
118
|
return cachedRouteTree;
|
|
119
119
|
}, []);
|
|
120
120
|
if (!routeTree) return App ? /*#__PURE__*/ jsx(App, {}) : null;
|
|
121
|
-
const router =
|
|
121
|
+
const router = useMemo(()=>{
|
|
122
122
|
const lifecycleContext = {
|
|
123
123
|
framework: 'tanstack',
|
|
124
124
|
phase: 'client-create',
|
|
@@ -183,11 +183,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
183
183
|
router,
|
|
184
184
|
runtimeContext: runtimeState
|
|
185
185
|
});
|
|
186
|
-
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ jsx(
|
|
187
|
-
|
|
188
|
-
children: /*#__PURE__*/ jsx(RouterClient, {
|
|
189
|
-
router: router
|
|
190
|
-
})
|
|
186
|
+
const RouterContent = hasSSRBootstrap ? /*#__PURE__*/ jsx(RouterClient, {
|
|
187
|
+
router: router
|
|
191
188
|
}) : /*#__PURE__*/ jsx(RouterProvider, {
|
|
192
189
|
router: router
|
|
193
190
|
});
|
|
@@ -6,7 +6,7 @@ import { time } from "@modern-js/runtime-utils/time";
|
|
|
6
6
|
import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
|
|
7
7
|
import { RouterProvider, createMemoryHistory, createRouter } from "@tanstack/react-router";
|
|
8
8
|
import { attachRouterServerSsrUtils } from "@tanstack/react-router/ssr/server";
|
|
9
|
-
import {
|
|
9
|
+
import { useContext } from "react";
|
|
10
10
|
import { InternalRuntimeContext, getGlobalEnableRsc, getGlobalLayoutApp, getGlobalRoutes } from "../../../core/context/index.mjs";
|
|
11
11
|
import { applyRouterServerPrepareResult, createRouterServerSnapshot } from "../lifecycle.mjs";
|
|
12
12
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
@@ -228,11 +228,8 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
228
228
|
if (!router) return App ? /*#__PURE__*/ jsx(App, {
|
|
229
229
|
...props
|
|
230
230
|
}) : null;
|
|
231
|
-
const routerWrapper = /*#__PURE__*/ jsx(
|
|
232
|
-
|
|
233
|
-
children: /*#__PURE__*/ jsx(RouterProvider, {
|
|
234
|
-
router: router
|
|
235
|
-
})
|
|
231
|
+
const routerWrapper = /*#__PURE__*/ jsx(RouterProvider, {
|
|
232
|
+
router: router
|
|
236
233
|
});
|
|
237
234
|
return App ? /*#__PURE__*/ jsx(App, {
|
|
238
235
|
children: routerWrapper
|
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.65",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -234,12 +234,12 @@
|
|
|
234
234
|
"isbot": "5.1.40",
|
|
235
235
|
"react-helmet": "^6.1.0",
|
|
236
236
|
"react-is": "^19.2.6",
|
|
237
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.
|
|
238
|
-
"@modern-js/
|
|
239
|
-
"@modern-js/
|
|
240
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.
|
|
241
|
-
"@modern-js/
|
|
242
|
-
"@modern-js/
|
|
237
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.65",
|
|
238
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.65",
|
|
239
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.65",
|
|
240
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.65",
|
|
241
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.65",
|
|
242
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.65"
|
|
243
243
|
},
|
|
244
244
|
"peerDependencies": {
|
|
245
245
|
"react": "^19.2.6",
|
|
@@ -258,8 +258,8 @@
|
|
|
258
258
|
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
259
259
|
"react": "^19.2.6",
|
|
260
260
|
"react-dom": "^19.2.6",
|
|
261
|
-
"@
|
|
262
|
-
"@
|
|
261
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.65",
|
|
262
|
+
"@scripts/rstest-config": "2.66.0"
|
|
263
263
|
},
|
|
264
264
|
"sideEffects": false,
|
|
265
265
|
"publishConfig": {
|