@modern-js/runtime 2.67.4 → 2.67.6
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/plugin.js +2 -1
- package/dist/cjs/router/runtime/plugin.node.js +6 -1
- package/dist/esm/router/runtime/plugin.js +2 -1
- package/dist/esm/router/runtime/plugin.node.js +6 -1
- package/dist/esm-node/router/runtime/plugin.js +2 -1
- package/dist/esm-node/router/runtime/plugin.node.js +6 -1
- package/dist/types/core/context/runtime.d.ts +3 -1
- package/package.json +12 -12
|
@@ -118,7 +118,12 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
118
118
|
const router = (0, import_router.createStaticRouter)(routes, routerContext);
|
|
119
119
|
context.routerContext = routerContext;
|
|
120
120
|
context.remixRouter = router;
|
|
121
|
-
context
|
|
121
|
+
Object.defineProperty(context, "routes", {
|
|
122
|
+
get() {
|
|
123
|
+
return routes;
|
|
124
|
+
},
|
|
125
|
+
enumerable: true
|
|
126
|
+
});
|
|
122
127
|
});
|
|
123
128
|
api.wrapRoot((App) => {
|
|
124
129
|
if (!finalRouteConfig) {
|
|
@@ -107,7 +107,12 @@ var routerPlugin = function() {
|
|
|
107
107
|
router = createStaticRouter(routes, routerContext);
|
|
108
108
|
context.routerContext = routerContext;
|
|
109
109
|
context.remixRouter = router;
|
|
110
|
-
context
|
|
110
|
+
Object.defineProperty(context, "routes", {
|
|
111
|
+
get: function get() {
|
|
112
|
+
return routes;
|
|
113
|
+
},
|
|
114
|
+
enumerable: true
|
|
115
|
+
});
|
|
111
116
|
return [
|
|
112
117
|
2
|
|
113
118
|
];
|
|
@@ -84,7 +84,12 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
84
84
|
const router = createStaticRouter(routes, routerContext);
|
|
85
85
|
context.routerContext = routerContext;
|
|
86
86
|
context.remixRouter = router;
|
|
87
|
-
context
|
|
87
|
+
Object.defineProperty(context, "routes", {
|
|
88
|
+
get() {
|
|
89
|
+
return routes;
|
|
90
|
+
},
|
|
91
|
+
enumerable: true
|
|
92
|
+
});
|
|
88
93
|
});
|
|
89
94
|
api.wrapRoot((App) => {
|
|
90
95
|
if (!finalRouteConfig) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StaticHandlerContext } from '@modern-js/runtime-utils/remix-router';
|
|
2
|
+
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
3
|
import type { RouteManifest } from '../../router/runtime/types';
|
|
3
4
|
import { createLoaderManager } from '../loader/loaderManager';
|
|
4
5
|
import type { SSRServerContext, TSSRContext } from '../types';
|
|
@@ -20,7 +21,7 @@ export interface RuntimeContext extends BaseRuntimeContext {
|
|
|
20
21
|
}
|
|
21
22
|
export declare const RuntimeReactContext: import("react").Context<RuntimeContext>;
|
|
22
23
|
export declare const ServerRouterContext: import("react").Context<any>;
|
|
23
|
-
export interface TRuntimeContext
|
|
24
|
+
export interface TRuntimeContext {
|
|
24
25
|
initialData?: Record<string, unknown>;
|
|
25
26
|
isBrowser: boolean;
|
|
26
27
|
context: TSSRContext;
|
|
@@ -28,6 +29,7 @@ export interface TRuntimeContext extends Partial<BaseRuntimeContext> {
|
|
|
28
29
|
request?: SSRServerContext['request'];
|
|
29
30
|
/** @deprecated use context.response field instead */
|
|
30
31
|
response?: SSRServerContext['response'];
|
|
32
|
+
routes?: RouteObject[];
|
|
31
33
|
[key: string]: any;
|
|
32
34
|
}
|
|
33
35
|
export declare const getInitialContext: (isBrowser?: boolean, routeManifest?: RouteManifest) => RuntimeContext;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.67.
|
|
18
|
+
"version": "2.67.6",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"@loadable/babel-plugin": "5.15.3",
|
|
199
199
|
"@loadable/component": "5.15.3",
|
|
200
200
|
"@loadable/server": "5.15.3",
|
|
201
|
-
"@swc/helpers": "0.5.
|
|
201
|
+
"@swc/helpers": "^0.5.17",
|
|
202
202
|
"@types/loadable__component": "^5.13.4",
|
|
203
203
|
"@types/react-helmet": "^6.1.2",
|
|
204
204
|
"@types/styled-components": "^5.1.14",
|
|
@@ -211,13 +211,13 @@
|
|
|
211
211
|
"react-is": "^18",
|
|
212
212
|
"react-side-effect": "^2.1.1",
|
|
213
213
|
"styled-components": "^5.3.1",
|
|
214
|
-
"@modern-js/plugin": "2.67.
|
|
215
|
-
"@modern-js/plugin-data-loader": "2.67.
|
|
216
|
-
"@modern-js/
|
|
217
|
-
"@modern-js/
|
|
218
|
-
"@modern-js/
|
|
219
|
-
"@modern-js/
|
|
220
|
-
"@modern-js/utils": "2.67.
|
|
214
|
+
"@modern-js/plugin": "2.67.6",
|
|
215
|
+
"@modern-js/plugin-data-loader": "2.67.6",
|
|
216
|
+
"@modern-js/render": "2.67.6",
|
|
217
|
+
"@modern-js/plugin-v2": "2.67.6",
|
|
218
|
+
"@modern-js/types": "2.67.6",
|
|
219
|
+
"@modern-js/runtime-utils": "2.67.6",
|
|
220
|
+
"@modern-js/utils": "2.67.6"
|
|
221
221
|
},
|
|
222
222
|
"peerDependencies": {
|
|
223
223
|
"react": ">=17",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
},
|
|
226
226
|
"devDependencies": {
|
|
227
227
|
"@remix-run/web-fetch": "^4.1.3",
|
|
228
|
-
"@rsbuild/core": "1.3.
|
|
228
|
+
"@rsbuild/core": "1.3.20",
|
|
229
229
|
"@testing-library/react": "^13.4.0",
|
|
230
230
|
"@types/cookie": "0.6.0",
|
|
231
231
|
"@types/invariant": "^2.2.30",
|
|
@@ -240,8 +240,8 @@
|
|
|
240
240
|
"ts-jest": "^29.1.0",
|
|
241
241
|
"ts-node": "^10.9.1",
|
|
242
242
|
"typescript": "^5",
|
|
243
|
-
"webpack": "^5.
|
|
244
|
-
"@modern-js/app-tools": "2.67.
|
|
243
|
+
"webpack": "^5.99.8",
|
|
244
|
+
"@modern-js/app-tools": "2.67.6",
|
|
245
245
|
"@scripts/build": "2.66.0",
|
|
246
246
|
"@scripts/jest-config": "2.66.0"
|
|
247
247
|
},
|