@modern-js/runtime 2.67.4 → 2.67.5

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.
@@ -75,7 +75,8 @@ const routerPlugin = (userConfig = {}) => {
75
75
  Object.defineProperty(context, "routes", {
76
76
  get() {
77
77
  return routes;
78
- }
78
+ },
79
+ enumerable: true
79
80
  });
80
81
  });
81
82
  api.wrapRoot((App) => {
@@ -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.routes = routes;
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) {
@@ -53,7 +53,8 @@ var routerPlugin = function() {
53
53
  Object.defineProperty(context, "routes", {
54
54
  get: function get() {
55
55
  return routes;
56
- }
56
+ },
57
+ enumerable: true
57
58
  });
58
59
  });
59
60
  api.wrapRoot(function(App) {
@@ -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.routes = routes;
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
  ];
@@ -49,7 +49,8 @@ const routerPlugin = (userConfig = {}) => {
49
49
  Object.defineProperty(context, "routes", {
50
50
  get() {
51
51
  return routes;
52
- }
52
+ },
53
+ enumerable: true
53
54
  });
54
55
  });
55
56
  api.wrapRoot((App) => {
@@ -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.routes = routes;
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 extends Partial<BaseRuntimeContext> {
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.4",
18
+ "version": "2.67.5",
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.13",
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.4",
215
- "@modern-js/plugin-data-loader": "2.67.4",
216
- "@modern-js/plugin-v2": "2.67.4",
217
- "@modern-js/render": "2.67.4",
218
- "@modern-js/runtime-utils": "2.67.4",
219
- "@modern-js/types": "2.67.4",
220
- "@modern-js/utils": "2.67.4"
214
+ "@modern-js/plugin": "2.67.5",
215
+ "@modern-js/plugin-data-loader": "2.67.5",
216
+ "@modern-js/plugin-v2": "2.67.5",
217
+ "@modern-js/render": "2.67.5",
218
+ "@modern-js/runtime-utils": "2.67.5",
219
+ "@modern-js/types": "2.67.5",
220
+ "@modern-js/utils": "2.67.5"
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.16",
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,10 +240,10 @@
240
240
  "ts-jest": "^29.1.0",
241
241
  "ts-node": "^10.9.1",
242
242
  "typescript": "^5",
243
- "webpack": "^5.98.0",
244
- "@modern-js/app-tools": "2.67.4",
245
- "@scripts/build": "2.66.0",
246
- "@scripts/jest-config": "2.66.0"
243
+ "webpack": "^5.99.8",
244
+ "@modern-js/app-tools": "2.67.5",
245
+ "@scripts/jest-config": "2.66.0",
246
+ "@scripts/build": "2.66.0"
247
247
  },
248
248
  "sideEffects": false,
249
249
  "publishConfig": {