@modern-js/runtime 2.60.5-alpha.0 → 2.60.5-alpha.2
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/hooks.js +3 -3
- package/dist/cjs/router/runtime/plugin.node.js +2 -2
- package/dist/esm/router/runtime/hooks.js +2 -2
- package/dist/esm/router/runtime/plugin.node.js +3 -3
- package/dist/esm-node/router/runtime/hooks.js +2 -2
- package/dist/esm-node/router/runtime/plugin.node.js +3 -3
- package/dist/types/router/runtime/hooks.d.ts +2 -2
- package/package.json +7 -7
|
@@ -18,15 +18,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var hooks_exports = {};
|
|
20
20
|
__export(hooks_exports, {
|
|
21
|
-
|
|
21
|
+
beforeCreateRoutes: () => beforeCreateRoutes,
|
|
22
22
|
modifyRoutes: () => modifyRoutes
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(hooks_exports);
|
|
25
25
|
var import_plugin = require("@modern-js/plugin");
|
|
26
26
|
const modifyRoutes = (0, import_plugin.createWaterfall)();
|
|
27
|
-
const
|
|
27
|
+
const beforeCreateRoutes = (0, import_plugin.createAsyncInterruptWorkflow)();
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
30
|
-
|
|
30
|
+
beforeCreateRoutes,
|
|
31
31
|
modifyRoutes
|
|
32
32
|
});
|
|
@@ -62,7 +62,7 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
62
62
|
name: "@modern-js/plugin-router",
|
|
63
63
|
registerHook: {
|
|
64
64
|
modifyRoutes: import_hooks.modifyRoutes,
|
|
65
|
-
|
|
65
|
+
beforeCreateRoutes: import_hooks.beforeCreateRoutes
|
|
66
66
|
},
|
|
67
67
|
setup: (api) => {
|
|
68
68
|
let finalRouteConfig = {};
|
|
@@ -86,7 +86,7 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
86
86
|
const requestContext = (0, import_node.createRequestContext)((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.loaderContext);
|
|
87
87
|
requestContext.set(import_node.reporterCtx, reporter);
|
|
88
88
|
const runner = api.useHookRunners();
|
|
89
|
-
await runner.
|
|
89
|
+
await runner.beforeCreateRoutes(context);
|
|
90
90
|
let routes = createRoutes ? createRoutes() : (0, import_router2.createRoutesFromElements)((0, import_utils.renderRoutes)({
|
|
91
91
|
routesConfig: finalRouteConfig,
|
|
92
92
|
ssrMode,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAsyncInterruptWorkflow, createWaterfall } from "@modern-js/plugin";
|
|
2
2
|
var modifyRoutes = createWaterfall();
|
|
3
|
-
var
|
|
3
|
+
var beforeCreateRoutes = createAsyncInterruptWorkflow();
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
beforeCreateRoutes,
|
|
6
6
|
modifyRoutes
|
|
7
7
|
};
|
|
@@ -16,7 +16,7 @@ import { JSX_SHELL_STREAM_END_MARK } from "../../common";
|
|
|
16
16
|
import { RuntimeReactContext } from "../../core";
|
|
17
17
|
import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
|
|
18
18
|
import DeferredDataScripts from "./DeferredDataScripts.node";
|
|
19
|
-
import {
|
|
19
|
+
import { beforeCreateRoutes as beforeCreateRoutesHook, modifyRoutes as modifyRoutesHook } from "./hooks";
|
|
20
20
|
import { renderRoutes, urlJoin } from "./utils";
|
|
21
21
|
function createRemixReuqest(request) {
|
|
22
22
|
var method = "GET";
|
|
@@ -34,7 +34,7 @@ var routerPlugin = function() {
|
|
|
34
34
|
name: "@modern-js/plugin-router",
|
|
35
35
|
registerHook: {
|
|
36
36
|
modifyRoutes: modifyRoutesHook,
|
|
37
|
-
|
|
37
|
+
beforeCreateRoutes: beforeCreateRoutesHook
|
|
38
38
|
},
|
|
39
39
|
setup: function(api) {
|
|
40
40
|
var finalRouteConfig = {};
|
|
@@ -65,7 +65,7 @@ var routerPlugin = function() {
|
|
|
65
65
|
runner = api.useHookRunners();
|
|
66
66
|
return [
|
|
67
67
|
4,
|
|
68
|
-
runner.
|
|
68
|
+
runner.beforeCreateRoutes(context)
|
|
69
69
|
];
|
|
70
70
|
case 1:
|
|
71
71
|
_state.sent();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAsyncInterruptWorkflow, createWaterfall } from "@modern-js/plugin";
|
|
2
2
|
const modifyRoutes = createWaterfall();
|
|
3
|
-
const
|
|
3
|
+
const beforeCreateRoutes = createAsyncInterruptWorkflow();
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
beforeCreateRoutes,
|
|
6
6
|
modifyRoutes
|
|
7
7
|
};
|
|
@@ -11,7 +11,7 @@ import { JSX_SHELL_STREAM_END_MARK } from "../../common";
|
|
|
11
11
|
import { RuntimeReactContext } from "../../core";
|
|
12
12
|
import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
|
|
13
13
|
import DeferredDataScripts from "./DeferredDataScripts.node";
|
|
14
|
-
import {
|
|
14
|
+
import { beforeCreateRoutes as beforeCreateRoutesHook, modifyRoutes as modifyRoutesHook } from "./hooks";
|
|
15
15
|
import { renderRoutes, urlJoin } from "./utils";
|
|
16
16
|
function createRemixReuqest(request) {
|
|
17
17
|
const method = "GET";
|
|
@@ -28,7 +28,7 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
28
28
|
name: "@modern-js/plugin-router",
|
|
29
29
|
registerHook: {
|
|
30
30
|
modifyRoutes: modifyRoutesHook,
|
|
31
|
-
|
|
31
|
+
beforeCreateRoutes: beforeCreateRoutesHook
|
|
32
32
|
},
|
|
33
33
|
setup: (api) => {
|
|
34
34
|
let finalRouteConfig = {};
|
|
@@ -52,7 +52,7 @@ const routerPlugin = (userConfig = {}) => {
|
|
|
52
52
|
const requestContext = createRequestContext((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.loaderContext);
|
|
53
53
|
requestContext.set(reporterCtx, reporter);
|
|
54
54
|
const runner = api.useHookRunners();
|
|
55
|
-
await runner.
|
|
55
|
+
await runner.beforeCreateRoutes(context);
|
|
56
56
|
let routes = createRoutes ? createRoutes() : createRoutesFromElements(renderRoutes({
|
|
57
57
|
routesConfig: finalRouteConfig,
|
|
58
58
|
ssrMode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
2
|
import type { RuntimeContext } from '../../core';
|
|
3
3
|
declare const modifyRoutes: import("@modern-js/plugin").Waterfall<RouteObject[]>;
|
|
4
|
-
declare const
|
|
5
|
-
export { modifyRoutes,
|
|
4
|
+
declare const beforeCreateRoutes: import("@modern-js/plugin").AsyncInterruptWorkflow<RuntimeContext, void>;
|
|
5
|
+
export { modifyRoutes, beforeCreateRoutes };
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.60.5-alpha.
|
|
18
|
+
"version": "2.60.5-alpha.2",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -199,11 +199,11 @@
|
|
|
199
199
|
"react-is": "^18",
|
|
200
200
|
"react-side-effect": "^2.1.1",
|
|
201
201
|
"styled-components": "^5.3.1",
|
|
202
|
+
"@modern-js/plugin-data-loader": "2.60.4",
|
|
202
203
|
"@modern-js/plugin": "2.60.4",
|
|
203
|
-
"@modern-js/runtime-utils": "2.60.4",
|
|
204
204
|
"@modern-js/types": "2.60.4",
|
|
205
|
-
"@modern-js/utils": "2.60.4",
|
|
206
|
-
"@modern-js/
|
|
205
|
+
"@modern-js/runtime-utils": "2.60.4",
|
|
206
|
+
"@modern-js/utils": "2.60.4"
|
|
207
207
|
},
|
|
208
208
|
"peerDependencies": {
|
|
209
209
|
"react": ">=17",
|
|
@@ -226,10 +226,10 @@
|
|
|
226
226
|
"ts-jest": "^29.1.0",
|
|
227
227
|
"typescript": "^5",
|
|
228
228
|
"webpack": "^5.95.0",
|
|
229
|
-
"@modern-js/app-tools": "2.60.4",
|
|
230
229
|
"@scripts/build": "2.60.4",
|
|
231
|
-
"@modern-js/
|
|
232
|
-
"@scripts/jest-config": "2.60.4"
|
|
230
|
+
"@modern-js/app-tools": "2.60.4",
|
|
231
|
+
"@scripts/jest-config": "2.60.4",
|
|
232
|
+
"@modern-js/core": "2.60.4"
|
|
233
233
|
},
|
|
234
234
|
"sideEffects": false,
|
|
235
235
|
"publishConfig": {
|