@modern-js/runtime 2.56.1 → 2.56.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/cli/code.js +5 -1
- package/dist/cjs/cli/constants.js +3 -0
- package/dist/cjs/core/browser/hydrate.js +3 -3
- package/dist/cjs/router/cli/code/templates.js +11 -1
- package/dist/esm/cli/code.js +7 -3
- package/dist/esm/cli/constants.js +2 -0
- package/dist/esm/core/browser/hydrate.js +3 -3
- package/dist/esm/router/cli/code/templates.js +4 -1
- package/dist/esm-node/cli/code.js +6 -2
- package/dist/esm-node/cli/constants.js +2 -0
- package/dist/esm-node/core/browser/hydrate.js +3 -3
- package/dist/esm-node/router/cli/code/templates.js +11 -1
- package/dist/types/cli/constants.d.ts +1 -0
- package/dist/types/exports/server.d.ts +1 -1
- package/package.json +10 -10
package/dist/cjs/cli/code.js
CHANGED
|
@@ -75,11 +75,15 @@ const generateCode = async (entrypoints, appContext, config, onCollectRuntimePlu
|
|
|
75
75
|
});
|
|
76
76
|
const indexFile = import_path.default.resolve(internalDirectory, `./${entryName}/${import_constants.ENTRY_POINT_FILE_NAME}`);
|
|
77
77
|
import_utils.fs.outputFileSync(indexFile, indexCode, "utf8");
|
|
78
|
+
const ssrMode = getSSRMode(entryName, config);
|
|
78
79
|
if (enableAsyncEntry) {
|
|
79
80
|
const bootstrapFile = import_path.default.resolve(internalDirectory, `./${entryName}/${import_constants.ENTRY_BOOTSTRAP_FILE_NAME}`);
|
|
80
81
|
import_utils.fs.outputFileSync(bootstrapFile, `import('./${import_constants.INDEX_FILE_NAME}');`, "utf8");
|
|
82
|
+
const bootstrapServerFile = import_path.default.resolve(internalDirectory, `./${entryName}/${import_constants.ENTRY_SERVER_BOOTSTRAP_FILE_NAME}`);
|
|
83
|
+
if (ssrMode) {
|
|
84
|
+
import_utils.fs.outputFileSync(bootstrapServerFile, `export const requestHandler = import('./${import_constants.SERVER_ENTRY_POINT_FILE_NAME}').then((m) => m.requestHandler)`, "utf8");
|
|
85
|
+
}
|
|
81
86
|
}
|
|
82
|
-
const ssrMode = getSSRMode(entryName, config);
|
|
83
87
|
if (ssrMode) {
|
|
84
88
|
const indexServerCode = serverTemplate.serverIndex({
|
|
85
89
|
entry,
|
|
@@ -24,6 +24,7 @@ __export(constants_exports, {
|
|
|
24
24
|
ENTRY_POINT_REGISTER_FILE_NAME: () => ENTRY_POINT_REGISTER_FILE_NAME,
|
|
25
25
|
ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME: () => ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME,
|
|
26
26
|
ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME: () => ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME,
|
|
27
|
+
ENTRY_SERVER_BOOTSTRAP_FILE_NAME: () => ENTRY_SERVER_BOOTSTRAP_FILE_NAME,
|
|
27
28
|
INDEX_FILE_NAME: () => INDEX_FILE_NAME,
|
|
28
29
|
SERVER_ENTRY_POINT_FILE_NAME: () => SERVER_ENTRY_POINT_FILE_NAME
|
|
29
30
|
});
|
|
@@ -33,6 +34,7 @@ const ENTRY_POINT_FILE_NAME = "index.jsx";
|
|
|
33
34
|
const SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
|
|
34
35
|
const INDEX_FILE_NAME = "index";
|
|
35
36
|
const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
|
37
|
+
const ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
|
|
36
38
|
const ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
|
|
37
39
|
const ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context.js";
|
|
38
40
|
const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
@@ -44,6 +46,7 @@ const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
|
44
46
|
ENTRY_POINT_REGISTER_FILE_NAME,
|
|
45
47
|
ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME,
|
|
46
48
|
ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME,
|
|
49
|
+
ENTRY_SERVER_BOOTSTRAP_FILE_NAME,
|
|
47
50
|
INDEX_FILE_NAME,
|
|
48
51
|
SERVER_ENTRY_POINT_FILE_NAME
|
|
49
52
|
});
|
|
@@ -40,7 +40,7 @@ var import_constants = require("../constants");
|
|
|
40
40
|
var import_withCallback = require("./withCallback");
|
|
41
41
|
const isReact18 = () => process.env.IS_REACT18 === "true";
|
|
42
42
|
function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
43
|
-
var _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
43
|
+
var _ssrContext_request, _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
44
44
|
const hydrateContext = {
|
|
45
45
|
...context,
|
|
46
46
|
get routes() {
|
|
@@ -50,8 +50,8 @@ function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
|
50
50
|
};
|
|
51
51
|
const { ssrContext } = hydrateContext;
|
|
52
52
|
const currentPathname = (0, import_url.normalizePathname)(window.location.pathname);
|
|
53
|
-
const initialPathname = (0, import_url.normalizePathname)(ssrContext.request.pathname);
|
|
54
|
-
if (initialPathname !== currentPathname && context.router) {
|
|
53
|
+
const initialPathname = (ssrContext === null || ssrContext === void 0 ? void 0 : (_ssrContext_request = ssrContext.request) === null || _ssrContext_request === void 0 ? void 0 : _ssrContext_request.pathname) && (0, import_url.normalizePathname)(ssrContext.request.pathname);
|
|
54
|
+
if (initialPathname && initialPathname !== currentPathname && context.router) {
|
|
55
55
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
56
56
|
console.error(errorMsg);
|
|
57
57
|
window.location.reload();
|
|
@@ -360,7 +360,17 @@ function ssrLoaderCombinedModule(entrypoints, entrypoint, config, appContext) {
|
|
|
360
360
|
const serverLoaderRuntime = require.resolve("@modern-js/plugin-data-loader/runtime");
|
|
361
361
|
const serverLoadersFile = (0, import_utils2.getServerLoadersFile)(internalDirectory, entryName);
|
|
362
362
|
const combinedModule = `export * from "${(0, import_utils.slash)(serverLoaderRuntime)}"; export * from "${(0, import_utils.slash)(serverLoadersFile)}"`;
|
|
363
|
-
|
|
363
|
+
if (!config.source.enableAsyncEntry) {
|
|
364
|
+
return combinedModule;
|
|
365
|
+
}
|
|
366
|
+
return `export default Promise.all([import("${(0, import_utils.slash)(serverLoaderRuntime)}"),import("${(0, import_utils.slash)(serverLoadersFile)}")]).then(res=>{
|
|
367
|
+
return res.reduce((sum,cur)=>{
|
|
368
|
+
return {
|
|
369
|
+
...sum,
|
|
370
|
+
...cur
|
|
371
|
+
}
|
|
372
|
+
},{})
|
|
373
|
+
})`;
|
|
364
374
|
}
|
|
365
375
|
return null;
|
|
366
376
|
}
|
package/dist/esm/cli/code.js
CHANGED
|
@@ -2,7 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
|
2
2
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { MAIN_ENTRY_NAME, fs } from "@modern-js/utils";
|
|
5
|
-
import { INDEX_FILE_NAME, ENTRY_BOOTSTRAP_FILE_NAME, ENTRY_POINT_FILE_NAME, ENTRY_POINT_REGISTER_FILE_NAME, ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME, ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME, SERVER_ENTRY_POINT_FILE_NAME } from "./constants";
|
|
5
|
+
import { INDEX_FILE_NAME, ENTRY_BOOTSTRAP_FILE_NAME, ENTRY_POINT_FILE_NAME, ENTRY_POINT_REGISTER_FILE_NAME, ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME, ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME, SERVER_ENTRY_POINT_FILE_NAME, ENTRY_SERVER_BOOTSTRAP_FILE_NAME } from "./constants";
|
|
6
6
|
import * as template from "./template";
|
|
7
7
|
import * as serverTemplate from "./template.server";
|
|
8
8
|
function getSSRMode() {
|
|
@@ -35,7 +35,7 @@ var generateCode = function() {
|
|
|
35
35
|
4,
|
|
36
36
|
Promise.all(entrypoints.map(function() {
|
|
37
37
|
var _ref2 = _async_to_generator(function(entrypoint) {
|
|
38
|
-
var entryName, isAutoMount, entry, customEntry, customBootstrap, customServerEntry, _ref3, runtimePlugins, indexCode, indexFile, bootstrapFile,
|
|
38
|
+
var entryName, isAutoMount, entry, customEntry, customBootstrap, customServerEntry, _ref3, runtimePlugins, indexCode, indexFile, ssrMode, bootstrapFile, bootstrapServerFile, indexServerCode, indexServerFile, registerCode, registerFile, registerRuntimeCode, registerRuntimeFile, contextCode, contextFile;
|
|
39
39
|
return _ts_generator(this, function(_state2) {
|
|
40
40
|
switch (_state2.label) {
|
|
41
41
|
case 0:
|
|
@@ -62,11 +62,15 @@ var generateCode = function() {
|
|
|
62
62
|
});
|
|
63
63
|
indexFile = path.resolve(internalDirectory, "./".concat(entryName, "/").concat(ENTRY_POINT_FILE_NAME));
|
|
64
64
|
fs.outputFileSync(indexFile, indexCode, "utf8");
|
|
65
|
+
ssrMode = getSSRMode(entryName, config);
|
|
65
66
|
if (enableAsyncEntry) {
|
|
66
67
|
bootstrapFile = path.resolve(internalDirectory, "./".concat(entryName, "/").concat(ENTRY_BOOTSTRAP_FILE_NAME));
|
|
67
68
|
fs.outputFileSync(bootstrapFile, "import('./".concat(INDEX_FILE_NAME, "');"), "utf8");
|
|
69
|
+
bootstrapServerFile = path.resolve(internalDirectory, "./".concat(entryName, "/").concat(ENTRY_SERVER_BOOTSTRAP_FILE_NAME));
|
|
70
|
+
if (ssrMode) {
|
|
71
|
+
fs.outputFileSync(bootstrapServerFile, "export const requestHandler = import('./".concat(SERVER_ENTRY_POINT_FILE_NAME, "').then((m) => m.requestHandler)"), "utf8");
|
|
72
|
+
}
|
|
68
73
|
}
|
|
69
|
-
ssrMode = getSSRMode(entryName, config);
|
|
70
74
|
if (ssrMode) {
|
|
71
75
|
indexServerCode = serverTemplate.serverIndex({
|
|
72
76
|
entry,
|
|
@@ -3,6 +3,7 @@ var ENTRY_POINT_FILE_NAME = "index.jsx";
|
|
|
3
3
|
var SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
|
|
4
4
|
var INDEX_FILE_NAME = "index";
|
|
5
5
|
var ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
|
6
|
+
var ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
|
|
6
7
|
var ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
|
|
7
8
|
var ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context.js";
|
|
8
9
|
var ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
@@ -13,6 +14,7 @@ export {
|
|
|
13
14
|
ENTRY_POINT_REGISTER_FILE_NAME,
|
|
14
15
|
ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME,
|
|
15
16
|
ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME,
|
|
17
|
+
ENTRY_SERVER_BOOTSTRAP_FILE_NAME,
|
|
16
18
|
INDEX_FILE_NAME,
|
|
17
19
|
SERVER_ENTRY_POINT_FILE_NAME
|
|
18
20
|
};
|
|
@@ -10,7 +10,7 @@ var isReact18 = function() {
|
|
|
10
10
|
return process.env.IS_REACT18 === "true";
|
|
11
11
|
};
|
|
12
12
|
function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
13
|
-
var _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
13
|
+
var _ssrContext_request, _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
14
14
|
var hydrateContext = _object_spread_props(_object_spread({}, context), {
|
|
15
15
|
get routes() {
|
|
16
16
|
return context.routes;
|
|
@@ -19,8 +19,8 @@ function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
|
19
19
|
});
|
|
20
20
|
var ssrContext = hydrateContext.ssrContext;
|
|
21
21
|
var currentPathname = normalizePathname(window.location.pathname);
|
|
22
|
-
var initialPathname = normalizePathname(ssrContext.request.pathname);
|
|
23
|
-
if (initialPathname !== currentPathname && context.router) {
|
|
22
|
+
var initialPathname = (ssrContext === null || ssrContext === void 0 ? void 0 : (_ssrContext_request = ssrContext.request) === null || _ssrContext_request === void 0 ? void 0 : _ssrContext_request.pathname) && normalizePathname(ssrContext.request.pathname);
|
|
23
|
+
if (initialPathname && initialPathname !== currentPathname && context.router) {
|
|
24
24
|
var errorMsg = "The initial URL ".concat(initialPathname, " and the URL ").concat(currentPathname, " to be hydrated do not match, reload.");
|
|
25
25
|
console.error(errorMsg);
|
|
26
26
|
window.location.reload();
|
|
@@ -406,7 +406,10 @@ function ssrLoaderCombinedModule(entrypoints, entrypoint, config, appContext) {
|
|
|
406
406
|
var serverLoaderRuntime = require.resolve("@modern-js/plugin-data-loader/runtime");
|
|
407
407
|
var serverLoadersFile = getServerLoadersFile(internalDirectory, entryName);
|
|
408
408
|
var combinedModule = 'export * from "'.concat(slash(serverLoaderRuntime), '"; export * from "').concat(slash(serverLoadersFile), '"');
|
|
409
|
-
|
|
409
|
+
if (!config.source.enableAsyncEntry) {
|
|
410
|
+
return combinedModule;
|
|
411
|
+
}
|
|
412
|
+
return 'export default Promise.all([import("'.concat(slash(serverLoaderRuntime), '"),import("').concat(slash(serverLoadersFile), '")]).then(res=>{\n return res.reduce((sum,cur)=>{\n return {\n ...sum,\n ...cur\n }\n },{})\n })');
|
|
410
413
|
}
|
|
411
414
|
return null;
|
|
412
415
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { MAIN_ENTRY_NAME, fs } from "@modern-js/utils";
|
|
3
|
-
import { INDEX_FILE_NAME, ENTRY_BOOTSTRAP_FILE_NAME, ENTRY_POINT_FILE_NAME, ENTRY_POINT_REGISTER_FILE_NAME, ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME, ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME, SERVER_ENTRY_POINT_FILE_NAME } from "./constants";
|
|
3
|
+
import { INDEX_FILE_NAME, ENTRY_BOOTSTRAP_FILE_NAME, ENTRY_POINT_FILE_NAME, ENTRY_POINT_REGISTER_FILE_NAME, ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME, ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME, SERVER_ENTRY_POINT_FILE_NAME, ENTRY_SERVER_BOOTSTRAP_FILE_NAME } from "./constants";
|
|
4
4
|
import * as template from "./template";
|
|
5
5
|
import * as serverTemplate from "./template.server";
|
|
6
6
|
function getSSRMode(entry = MAIN_ENTRY_NAME, config) {
|
|
@@ -42,11 +42,15 @@ const generateCode = async (entrypoints, appContext, config, onCollectRuntimePlu
|
|
|
42
42
|
});
|
|
43
43
|
const indexFile = path.resolve(internalDirectory, `./${entryName}/${ENTRY_POINT_FILE_NAME}`);
|
|
44
44
|
fs.outputFileSync(indexFile, indexCode, "utf8");
|
|
45
|
+
const ssrMode = getSSRMode(entryName, config);
|
|
45
46
|
if (enableAsyncEntry) {
|
|
46
47
|
const bootstrapFile = path.resolve(internalDirectory, `./${entryName}/${ENTRY_BOOTSTRAP_FILE_NAME}`);
|
|
47
48
|
fs.outputFileSync(bootstrapFile, `import('./${INDEX_FILE_NAME}');`, "utf8");
|
|
49
|
+
const bootstrapServerFile = path.resolve(internalDirectory, `./${entryName}/${ENTRY_SERVER_BOOTSTRAP_FILE_NAME}`);
|
|
50
|
+
if (ssrMode) {
|
|
51
|
+
fs.outputFileSync(bootstrapServerFile, `export const requestHandler = import('./${SERVER_ENTRY_POINT_FILE_NAME}').then((m) => m.requestHandler)`, "utf8");
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
|
-
const ssrMode = getSSRMode(entryName, config);
|
|
50
54
|
if (ssrMode) {
|
|
51
55
|
const indexServerCode = serverTemplate.serverIndex({
|
|
52
56
|
entry,
|
|
@@ -3,6 +3,7 @@ const ENTRY_POINT_FILE_NAME = "index.jsx";
|
|
|
3
3
|
const SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
|
|
4
4
|
const INDEX_FILE_NAME = "index";
|
|
5
5
|
const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
|
6
|
+
const ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
|
|
6
7
|
const ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
|
|
7
8
|
const ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context.js";
|
|
8
9
|
const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
@@ -13,6 +14,7 @@ export {
|
|
|
13
14
|
ENTRY_POINT_REGISTER_FILE_NAME,
|
|
14
15
|
ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME,
|
|
15
16
|
ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME,
|
|
17
|
+
ENTRY_SERVER_BOOTSTRAP_FILE_NAME,
|
|
16
18
|
INDEX_FILE_NAME,
|
|
17
19
|
SERVER_ENTRY_POINT_FILE_NAME
|
|
18
20
|
};
|
|
@@ -6,7 +6,7 @@ import { RenderLevel } from "../constants";
|
|
|
6
6
|
import { WithCallback } from "./withCallback";
|
|
7
7
|
const isReact18 = () => process.env.IS_REACT18 === "true";
|
|
8
8
|
function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
9
|
-
var _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
9
|
+
var _ssrContext_request, _window__SSR_DATA, _window, _window__SSR_DATA1, _window1;
|
|
10
10
|
const hydrateContext = {
|
|
11
11
|
...context,
|
|
12
12
|
get routes() {
|
|
@@ -16,8 +16,8 @@ function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
|
16
16
|
};
|
|
17
17
|
const { ssrContext } = hydrateContext;
|
|
18
18
|
const currentPathname = normalizePathname(window.location.pathname);
|
|
19
|
-
const initialPathname = normalizePathname(ssrContext.request.pathname);
|
|
20
|
-
if (initialPathname !== currentPathname && context.router) {
|
|
19
|
+
const initialPathname = (ssrContext === null || ssrContext === void 0 ? void 0 : (_ssrContext_request = ssrContext.request) === null || _ssrContext_request === void 0 ? void 0 : _ssrContext_request.pathname) && normalizePathname(ssrContext.request.pathname);
|
|
20
|
+
if (initialPathname && initialPathname !== currentPathname && context.router) {
|
|
21
21
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
22
22
|
console.error(errorMsg);
|
|
23
23
|
window.location.reload();
|
|
@@ -324,7 +324,17 @@ function ssrLoaderCombinedModule(entrypoints, entrypoint, config, appContext) {
|
|
|
324
324
|
const serverLoaderRuntime = require.resolve("@modern-js/plugin-data-loader/runtime");
|
|
325
325
|
const serverLoadersFile = getServerLoadersFile(internalDirectory, entryName);
|
|
326
326
|
const combinedModule = `export * from "${slash(serverLoaderRuntime)}"; export * from "${slash(serverLoadersFile)}"`;
|
|
327
|
-
|
|
327
|
+
if (!config.source.enableAsyncEntry) {
|
|
328
|
+
return combinedModule;
|
|
329
|
+
}
|
|
330
|
+
return `export default Promise.all([import("${slash(serverLoaderRuntime)}"),import("${slash(serverLoadersFile)}")]).then(res=>{
|
|
331
|
+
return res.reduce((sum,cur)=>{
|
|
332
|
+
return {
|
|
333
|
+
...sum,
|
|
334
|
+
...cur
|
|
335
|
+
}
|
|
336
|
+
},{})
|
|
337
|
+
})`;
|
|
328
338
|
}
|
|
329
339
|
return null;
|
|
330
340
|
}
|
|
@@ -3,6 +3,7 @@ export declare const ENTRY_POINT_FILE_NAME = "index.jsx";
|
|
|
3
3
|
export declare const SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
|
|
4
4
|
export declare const INDEX_FILE_NAME = "index";
|
|
5
5
|
export declare const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
|
6
|
+
export declare const ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
|
|
6
7
|
export declare const ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
|
|
7
8
|
export declare const ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context.js";
|
|
8
9
|
export declare const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AfterMatchContext, AfterRenderContext, MiddlewareContext, NextFunction } from '@modern-js/types';
|
|
2
|
-
export type { Container, CacheControl, CacheOptionProvider, CacheOption, UnstableMiddlewareContext, UnstableMiddleware, UnstableNext, } from '@modern-js/types';
|
|
2
|
+
export type { Container, CacheControl, CacheOptionProvider, CacheOption, UnstableMiddlewareContext, UnstableMiddleware, UnstableNext, MonitorEvent, Monitors, CoreMonitor, LogEvent, LogLevel, TimingEvent, } from '@modern-js/types';
|
|
3
3
|
export declare const hook: (attacher: ({ addMiddleware, afterMatch, afterRender, }: {
|
|
4
4
|
addMiddleware: (mid: Middleware) => void;
|
|
5
5
|
afterRender: (hook: AfterRenderHook) => void;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.56.
|
|
18
|
+
"version": "2.56.2",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -199,11 +199,11 @@
|
|
|
199
199
|
"react-side-effect": "^2.1.1",
|
|
200
200
|
"styled-components": "^5.3.1",
|
|
201
201
|
"@swc/helpers": "0.5.3",
|
|
202
|
-
"@modern-js/
|
|
203
|
-
"@modern-js/
|
|
204
|
-
"@modern-js/utils": "2.56.
|
|
205
|
-
"@modern-js/
|
|
206
|
-
"@modern-js/
|
|
202
|
+
"@modern-js/plugin": "2.56.2",
|
|
203
|
+
"@modern-js/utils": "2.56.2",
|
|
204
|
+
"@modern-js/runtime-utils": "2.56.2",
|
|
205
|
+
"@modern-js/types": "2.56.2",
|
|
206
|
+
"@modern-js/plugin-data-loader": "2.56.2"
|
|
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.93.0",
|
|
229
|
-
"@modern-js/app-tools": "2.56.
|
|
230
|
-
"@modern-js/core": "2.56.
|
|
231
|
-
"@scripts/
|
|
232
|
-
"@scripts/
|
|
229
|
+
"@modern-js/app-tools": "2.56.2",
|
|
230
|
+
"@modern-js/core": "2.56.2",
|
|
231
|
+
"@scripts/jest-config": "2.56.2",
|
|
232
|
+
"@scripts/build": "2.56.2"
|
|
233
233
|
},
|
|
234
234
|
"sideEffects": false,
|
|
235
235
|
"publishConfig": {
|