@modern-js/runtime 2.42.2 → 2.44.0
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/index.js +2 -3
- package/dist/cjs/ssr/cli/index.js +6 -4
- package/dist/cjs/ssr/index.js +11 -3
- package/dist/cjs/ssr/react/prerender/index.js +1 -0
- package/dist/cjs/ssr/serverRender/{renderToString/type.js → constants.js} +21 -11
- package/dist/cjs/ssr/serverRender/helmet.js +5 -4
- package/dist/cjs/ssr/serverRender/index.js +2 -2
- package/dist/cjs/ssr/serverRender/renderToStream/buildTemplate.after.js +2 -1
- package/dist/cjs/ssr/serverRender/renderToStream/buildTemplate.share.js +1 -1
- package/dist/cjs/ssr/serverRender/renderToStream/bulidTemplate.before.js +37 -10
- package/dist/cjs/ssr/serverRender/renderToStream/index.js +2 -7
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.js +32 -30
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.worker.js +3 -3
- package/dist/cjs/ssr/serverRender/renderToStream/template.js +3 -3
- package/dist/cjs/ssr/serverRender/renderToString/buildHtml.js +6 -12
- package/dist/cjs/ssr/serverRender/renderToString/entry.js +14 -12
- package/dist/cjs/ssr/serverRender/renderToString/index.js +0 -5
- package/dist/cjs/ssr/serverRender/renderToString/loadable.js +2 -6
- package/dist/cjs/ssr/serverRender/types.js +7 -2
- package/dist/cjs/ssr/serverRender/utils.js +13 -11
- package/dist/esm/cli/index.js +2 -3
- package/dist/esm/ssr/cli/index.js +6 -4
- package/dist/esm/ssr/index.js +10 -2
- package/dist/esm/ssr/react/prerender/index.js +1 -0
- package/dist/esm/ssr/serverRender/constants.js +14 -0
- package/dist/esm/ssr/serverRender/helmet.js +5 -4
- package/dist/esm/ssr/serverRender/index.js +2 -2
- package/dist/esm/ssr/serverRender/renderToStream/buildTemplate.after.js +3 -2
- package/dist/esm/ssr/serverRender/renderToStream/buildTemplate.share.js +5 -3
- package/dist/esm/ssr/serverRender/renderToStream/bulidTemplate.before.js +169 -33
- package/dist/esm/ssr/serverRender/renderToStream/index.js +2 -7
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.js +34 -30
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.worker.js +23 -13
- package/dist/esm/ssr/serverRender/renderToStream/template.js +37 -11
- package/dist/esm/ssr/serverRender/renderToString/buildHtml.js +6 -13
- package/dist/esm/ssr/serverRender/renderToString/entry.js +19 -13
- package/dist/esm/ssr/serverRender/renderToString/index.js +1 -6
- package/dist/esm/ssr/serverRender/renderToString/loadable.js +3 -7
- package/dist/esm/ssr/serverRender/types.js +6 -1
- package/dist/esm/ssr/serverRender/utils.js +12 -7
- package/dist/esm-node/cli/index.js +2 -3
- package/dist/esm-node/ssr/cli/index.js +6 -4
- package/dist/esm-node/ssr/index.js +9 -1
- package/dist/esm-node/ssr/react/prerender/index.js +1 -0
- package/dist/esm-node/ssr/serverRender/constants.js +14 -0
- package/dist/esm-node/ssr/serverRender/helmet.js +5 -4
- package/dist/esm-node/ssr/serverRender/index.js +2 -2
- package/dist/esm-node/ssr/serverRender/renderToStream/buildTemplate.after.js +3 -2
- package/dist/esm-node/ssr/serverRender/renderToStream/buildTemplate.share.js +1 -1
- package/dist/esm-node/ssr/serverRender/renderToStream/bulidTemplate.before.js +38 -11
- package/dist/esm-node/ssr/serverRender/renderToStream/index.js +2 -7
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.js +32 -30
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.worker.js +3 -3
- package/dist/esm-node/ssr/serverRender/renderToStream/template.js +3 -3
- package/dist/esm-node/ssr/serverRender/renderToString/buildHtml.js +6 -12
- package/dist/esm-node/ssr/serverRender/renderToString/entry.js +13 -11
- package/dist/esm-node/ssr/serverRender/renderToString/index.js +0 -5
- package/dist/esm-node/ssr/serverRender/renderToString/loadable.js +3 -7
- package/dist/esm-node/ssr/serverRender/types.js +6 -1
- package/dist/esm-node/ssr/serverRender/utils.js +10 -7
- package/dist/types/exports/server.d.ts +1 -0
- package/dist/types/ssr/react/prerender/index.d.ts +4 -0
- package/dist/types/ssr/serverRender/constants.d.ts +6 -0
- package/dist/types/ssr/serverRender/renderToStream/buildTemplate.after.d.ts +1 -1
- package/dist/types/ssr/serverRender/renderToStream/buildTemplate.share.d.ts +2 -2
- package/dist/types/ssr/serverRender/renderToStream/bulidTemplate.before.d.ts +2 -2
- package/dist/types/ssr/serverRender/renderToStream/index.d.ts +1 -1
- package/dist/types/ssr/serverRender/renderToStream/renderToPipe.d.ts +2 -2
- package/dist/types/ssr/serverRender/renderToStream/renderToPipe.worker.d.ts +2 -2
- package/dist/types/ssr/serverRender/renderToStream/template.d.ts +2 -2
- package/dist/types/ssr/serverRender/renderToString/entry.d.ts +1 -2
- package/dist/types/ssr/serverRender/renderToString/loadable.d.ts +1 -2
- package/dist/types/ssr/serverRender/renderToString/styledComponent.d.ts +1 -1
- package/dist/types/ssr/serverRender/types.d.ts +15 -2
- package/dist/types/ssr/serverRender/utils.d.ts +8 -3
- package/package.json +12 -12
- package/dist/esm/ssr/serverRender/renderToString/type.js +0 -9
- package/dist/esm-node/ssr/serverRender/renderToString/type.js +0 -9
- package/dist/types/ssr/serverRender/renderToString/type.d.ts +0 -13
package/dist/cjs/cli/index.js
CHANGED
|
@@ -32,7 +32,6 @@ __export(cli_exports, {
|
|
|
32
32
|
runtimePlugin: () => runtimePlugin
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(cli_exports);
|
|
35
|
-
var import_path = __toESM(require("path"));
|
|
36
35
|
var import_utils = require("@modern-js/utils");
|
|
37
36
|
var import_cli = require("../state/cli");
|
|
38
37
|
var import_cli2 = require("../ssr/cli");
|
|
@@ -57,8 +56,8 @@ const runtimePlugin = () => ({
|
|
|
57
56
|
setup: (api) => {
|
|
58
57
|
return {
|
|
59
58
|
config() {
|
|
60
|
-
const
|
|
61
|
-
process.env.IS_REACT18 = (0, import_utils.isReact18)(
|
|
59
|
+
const appDir = api.useAppContext().appDirectory;
|
|
60
|
+
process.env.IS_REACT18 = (0, import_utils.isReact18)(appDir).toString();
|
|
62
61
|
return {
|
|
63
62
|
runtime: {},
|
|
64
63
|
runtimeByEntries: {},
|
|
@@ -104,11 +104,11 @@ const ssrPlugin = () => ({
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
tools: {
|
|
107
|
-
bundlerChain(chain, { isServer, isServiceWorker
|
|
107
|
+
bundlerChain(chain, { isServer, isServiceWorker }) {
|
|
108
108
|
const userConfig = api.useResolvedConfigContext();
|
|
109
109
|
if ((0, import_utils.isUseSSRBundle)(userConfig) && !isServer && !isServiceWorker && checkUseStringSSR(userConfig)) {
|
|
110
110
|
const LoadableBundlerPlugin = require("./loadable-bundler-plugin.js");
|
|
111
|
-
chain.plugin(
|
|
111
|
+
chain.plugin("loadable").use(LoadableBundlerPlugin, [
|
|
112
112
|
{
|
|
113
113
|
filename: import_utils.LOADABLE_STATS_FILE
|
|
114
114
|
}
|
|
@@ -154,12 +154,13 @@ const ssrPlugin = () => ({
|
|
|
154
154
|
},
|
|
155
155
|
modifyEntryRuntimePlugins({ entrypoint, plugins, bundlerConfigs }) {
|
|
156
156
|
if (ssrConfigMap.get(entrypoint.entryName)) {
|
|
157
|
-
var _bundlerConfigs_find_output, _bundlerConfigs_find, _config_server;
|
|
157
|
+
var _bundlerConfigs_find_output, _bundlerConfigs_find, _config_server, _config_server1;
|
|
158
158
|
const chunkLoadingGlobal = bundlerConfigs === null || bundlerConfigs === void 0 ? void 0 : (_bundlerConfigs_find = bundlerConfigs.find((config2) => config2.name === "client")) === null || _bundlerConfigs_find === void 0 ? void 0 : (_bundlerConfigs_find_output = _bundlerConfigs_find.output) === null || _bundlerConfigs_find_output === void 0 ? void 0 : _bundlerConfigs_find_output.chunkLoadingGlobal;
|
|
159
159
|
const config = api.useResolvedConfigContext();
|
|
160
160
|
const { enableInlineScripts, enableInlineStyles } = config.output;
|
|
161
161
|
const { crossorigin, scriptLoading } = config.html;
|
|
162
162
|
const disablePrerender = typeof ((_config_server = config.server) === null || _config_server === void 0 ? void 0 : _config_server.ssr) === "object" ? Boolean(config.server.ssr.disablePrerender) : false;
|
|
163
|
+
const unsafeHeaders = typeof ((_config_server1 = config.server) === null || _config_server1 === void 0 ? void 0 : _config_server1.ssr) === "object" ? config.server.ssr.unsafeHeaders : void 0;
|
|
163
164
|
plugins.push({
|
|
164
165
|
name: PLUGIN_IDENTIFIER,
|
|
165
166
|
options: JSON.stringify({
|
|
@@ -169,7 +170,8 @@ const ssrPlugin = () => ({
|
|
|
169
170
|
chunkLoadingGlobal,
|
|
170
171
|
disablePrerender,
|
|
171
172
|
enableInlineScripts: typeof enableInlineScripts === "function" ? void 0 : enableInlineScripts,
|
|
172
|
-
enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles
|
|
173
|
+
enableInlineStyles: typeof enableInlineStyles === "function" ? void 0 : enableInlineStyles,
|
|
174
|
+
unsafeHeaders
|
|
173
175
|
})
|
|
174
176
|
});
|
|
175
177
|
}
|
package/dist/cjs/ssr/index.js
CHANGED
|
@@ -40,15 +40,15 @@ var import_parsed = require("@modern-js/runtime-utils/parsed");
|
|
|
40
40
|
var import_types = require("./serverRender/types");
|
|
41
41
|
var import_withCallback = require("./react/withCallback");
|
|
42
42
|
var import_utils = require("./utils");
|
|
43
|
-
var
|
|
43
|
+
var import_constants = require("./serverRender/constants");
|
|
44
44
|
__reExport(ssr_exports, require("./react"), module.exports);
|
|
45
45
|
const ssr = (config) => ({
|
|
46
46
|
name: "@modern-js/plugin-ssr",
|
|
47
47
|
setup: () => {
|
|
48
48
|
const mockResp = (0, import_utils.mockResponse)();
|
|
49
49
|
if (config.inlineScript === false) {
|
|
50
|
-
window._SSR_DATA = (0, import_parsed.parsedJSONFromElement)(
|
|
51
|
-
window._ROUTER_DATA = (0, import_parsed.parsedJSONFromElement)(
|
|
50
|
+
window._SSR_DATA = (0, import_parsed.parsedJSONFromElement)(import_constants.SSR_DATA_JSON_ID);
|
|
51
|
+
window._ROUTER_DATA = (0, import_parsed.parsedJSONFromElement)(import_constants.ROUTER_DATA_JSON_ID);
|
|
52
52
|
}
|
|
53
53
|
return {
|
|
54
54
|
client: async ({ App, context, ModernRender, ModernHydrate }) => {
|
|
@@ -60,6 +60,14 @@ const ssr = (config) => ({
|
|
|
60
60
|
},
|
|
61
61
|
_hydration: true
|
|
62
62
|
};
|
|
63
|
+
const { ssrContext } = hydrateContext;
|
|
64
|
+
const { pathname: initialPathname } = ssrContext.request;
|
|
65
|
+
const currentPathname = window.location.pathname;
|
|
66
|
+
if (initialPathname !== currentPathname) {
|
|
67
|
+
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
68
|
+
console.error(errorMsg);
|
|
69
|
+
window.location.reload();
|
|
70
|
+
}
|
|
63
71
|
const callback = () => {
|
|
64
72
|
delete hydrateContext._hydration;
|
|
65
73
|
};
|
|
@@ -101,6 +101,7 @@ function factory(Component) {
|
|
|
101
101
|
if (!validate) {
|
|
102
102
|
throw new Error("invalid props, check usage");
|
|
103
103
|
}
|
|
104
|
+
console.error("[Warn] PreRender has been deprecated, please use SSR Cache instead. reference to docs: https://modernjs.dev/guides/advanced-features/ssr.html");
|
|
104
105
|
return (0, import_react.createElement)(Component, {
|
|
105
106
|
...newProps
|
|
106
107
|
});
|
|
@@ -16,18 +16,28 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var constants_exports = {};
|
|
20
|
+
__export(constants_exports, {
|
|
21
|
+
CHUNK_CSS_PLACEHOLDER: () => CHUNK_CSS_PLACEHOLDER,
|
|
22
|
+
CHUNK_JS_PLACEHOLDER: () => CHUNK_JS_PLACEHOLDER,
|
|
23
|
+
HTML_PLACEHOLDER: () => HTML_PLACEHOLDER,
|
|
24
|
+
ROUTER_DATA_JSON_ID: () => ROUTER_DATA_JSON_ID,
|
|
25
|
+
SSR_DATA_JSON_ID: () => SSR_DATA_JSON_ID,
|
|
26
|
+
SSR_DATA_PLACEHOLDER: () => SSR_DATA_PLACEHOLDER
|
|
22
27
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
module.exports = __toCommonJS(constants_exports);
|
|
29
|
+
const HTML_PLACEHOLDER = "<!--<?- html ?>-->";
|
|
30
|
+
const SSR_DATA_PLACEHOLDER = "<!--<?- SSRDataScript ?>-->";
|
|
31
|
+
const CHUNK_JS_PLACEHOLDER = "<!--<?- chunksMap.js ?>-->";
|
|
32
|
+
const CHUNK_CSS_PLACEHOLDER = "<!--<?- chunksMap.css ?>-->";
|
|
33
|
+
const SSR_DATA_JSON_ID = "__MODERN_SSR_DATA__";
|
|
34
|
+
const ROUTER_DATA_JSON_ID = "__MODERN_ROUTER_DATA__";
|
|
30
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
36
|
0 && (module.exports = {
|
|
32
|
-
|
|
37
|
+
CHUNK_CSS_PLACEHOLDER,
|
|
38
|
+
CHUNK_JS_PLACEHOLDER,
|
|
39
|
+
HTML_PLACEHOLDER,
|
|
40
|
+
ROUTER_DATA_JSON_ID,
|
|
41
|
+
SSR_DATA_JSON_ID,
|
|
42
|
+
SSR_DATA_PLACEHOLDER
|
|
33
43
|
});
|
|
@@ -22,6 +22,7 @@ __export(helmet_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(helmet_exports);
|
|
24
24
|
var import_os = require("os");
|
|
25
|
+
var import_utils = require("./utils");
|
|
25
26
|
const RE_HTML_ATTR = /<html[^>]*>/;
|
|
26
27
|
const RE_BODY_ATTR = /<body[^>]*>/;
|
|
27
28
|
const RE_LAST_IN_HEAD = /<\/head>/;
|
|
@@ -31,11 +32,11 @@ function helmet(content, helmetData) {
|
|
|
31
32
|
let result = content;
|
|
32
33
|
const bodyAttributes = helmetData.bodyAttributes.toString();
|
|
33
34
|
if (bodyAttributes) {
|
|
34
|
-
result =
|
|
35
|
+
result = (0, import_utils.safeReplace)(result, RE_BODY_ATTR, `<body ${bodyAttributes}>`);
|
|
35
36
|
}
|
|
36
37
|
const htmlAttributes = helmetData.htmlAttributes.toString();
|
|
37
38
|
if (htmlAttributes) {
|
|
38
|
-
result =
|
|
39
|
+
result = (0, import_utils.safeReplace)(result, RE_HTML_ATTR, `<html ${htmlAttributes}>`);
|
|
39
40
|
}
|
|
40
41
|
const base = helmetData.base.toString();
|
|
41
42
|
const link = helmetData.link.toString();
|
|
@@ -47,7 +48,7 @@ function helmet(content, helmetData) {
|
|
|
47
48
|
const existTitleTag = RE_TITLE.test(content);
|
|
48
49
|
const shouldReplaceTitle = existTitleTag && TEST_TITLE_CONTENT.test(title.trim());
|
|
49
50
|
if (shouldReplaceTitle) {
|
|
50
|
-
result =
|
|
51
|
+
result = (0, import_utils.safeReplace)(result, RE_TITLE, title);
|
|
51
52
|
}
|
|
52
53
|
const helmetStr = [
|
|
53
54
|
base,
|
|
@@ -60,5 +61,5 @@ function helmet(content, helmetData) {
|
|
|
60
61
|
].reduce((pre, cur) => {
|
|
61
62
|
return pre + (cur.length > 0 ? ` ${cur}${import_os.EOL}` : "");
|
|
62
63
|
}, "");
|
|
63
|
-
return
|
|
64
|
+
return (0, import_utils.safeReplace)(result, RE_LAST_IN_HEAD, `${helmetStr}</head>`);
|
|
64
65
|
}
|
|
@@ -22,12 +22,12 @@ __export(serverRender_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(serverRender_exports);
|
|
24
24
|
var import_utils = require("../utils");
|
|
25
|
-
var
|
|
25
|
+
var import_constants = require("./constants");
|
|
26
26
|
async function serverRender(options) {
|
|
27
27
|
var _options_context_ssrContext;
|
|
28
28
|
if ((_options_context_ssrContext = options.context.ssrContext) === null || _options_context_ssrContext === void 0 ? void 0 : _options_context_ssrContext.template) {
|
|
29
29
|
var _options_context_ssrContext1;
|
|
30
|
-
options.context.ssrContext.template = (_options_context_ssrContext1 = options.context.ssrContext) === null || _options_context_ssrContext1 === void 0 ? void 0 : _options_context_ssrContext1.template.replace("</head>", `${
|
|
30
|
+
options.context.ssrContext.template = (_options_context_ssrContext1 = options.context.ssrContext) === null || _options_context_ssrContext1 === void 0 ? void 0 : _options_context_ssrContext1.template.replace("</head>", `${import_constants.CHUNK_CSS_PLACEHOLDER}</head>`);
|
|
31
31
|
}
|
|
32
32
|
if ((0, import_utils.isReact18)() && options.config.mode === "stream") {
|
|
33
33
|
const pipe = await require("./renderToStream").render(options);
|
|
@@ -23,6 +23,7 @@ __export(buildTemplate_after_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(buildTemplate_after_exports);
|
|
24
24
|
var import_node = require("@modern-js/runtime-utils/node");
|
|
25
25
|
var import_utils = require("../utils");
|
|
26
|
+
var import_constants = require("../constants");
|
|
26
27
|
var import_buildTemplate = require("./buildTemplate.share");
|
|
27
28
|
function buildShellAfterTemplate(afterAppTemplate, options) {
|
|
28
29
|
const callbacks = [
|
|
@@ -31,7 +32,7 @@ function buildShellAfterTemplate(afterAppTemplate, options) {
|
|
|
31
32
|
return (0, import_buildTemplate.buildTemplate)(afterAppTemplate, callbacks);
|
|
32
33
|
function injectSSRDataScript(template) {
|
|
33
34
|
const ssrDataScript = buildSSRDataScript();
|
|
34
|
-
return
|
|
35
|
+
return (0, import_utils.safeReplace)(template, import_constants.SSR_DATA_PLACEHOLDER, ssrDataScript);
|
|
35
36
|
function buildSSRDataScript() {
|
|
36
37
|
const { context: { ssrContext, initialData, __i18nData__ }, renderLevel } = options;
|
|
37
38
|
const { request, enableUnsafeCtx, nonce, tracker } = ssrContext;
|
|
@@ -24,7 +24,7 @@ __export(buildTemplate_share_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(buildTemplate_share_exports);
|
|
25
25
|
const HEAD_REG_EXP = /<head(.|\n)*>(.|\n)*<\/head>/;
|
|
26
26
|
function buildTemplate(template, callbacks) {
|
|
27
|
-
return callbacks.reduce((
|
|
27
|
+
return callbacks.reduce((promise, buildTemplateCb) => promise.then((template2) => buildTemplateCb(template2)), Promise.resolve(template));
|
|
28
28
|
}
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
30
|
0 && (module.exports = {
|
|
@@ -34,9 +34,27 @@ module.exports = __toCommonJS(bulidTemplate_before_exports);
|
|
|
34
34
|
var import_react_helmet = __toESM(require("react-helmet"));
|
|
35
35
|
var import_router = require("@modern-js/runtime-utils/router");
|
|
36
36
|
var import_helmet = __toESM(require("../helmet"));
|
|
37
|
+
var import_constants = require("../constants");
|
|
37
38
|
var import_utils = require("../utils");
|
|
38
39
|
var import_buildTemplate = require("./buildTemplate.share");
|
|
39
|
-
|
|
40
|
+
const readAsset = async (chunk) => {
|
|
41
|
+
const fs = await Promise.resolve().then(() => __toESM(require("fs/promises")));
|
|
42
|
+
const path = await Promise.resolve().then(() => __toESM(require("path")));
|
|
43
|
+
const filepath = path.join(__dirname, chunk);
|
|
44
|
+
return fs.readFile(filepath, "utf-8");
|
|
45
|
+
};
|
|
46
|
+
const checkIsInline = (chunk, enableInline) => {
|
|
47
|
+
if (process.env.NODE_ENV === "production") {
|
|
48
|
+
if (enableInline instanceof RegExp) {
|
|
49
|
+
return enableInline.test(chunk);
|
|
50
|
+
} else {
|
|
51
|
+
return Boolean(enableInline);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function getHeadTemplate(beforeEntryTemplate, context, pluginConfig) {
|
|
40
58
|
const callbacks = [
|
|
41
59
|
(headTemplate2) => {
|
|
42
60
|
const helmetData = import_react_helmet.default.renderStatic();
|
|
@@ -50,9 +68,10 @@ function getHeadTemplate(beforeEntryTemplate, context) {
|
|
|
50
68
|
return "";
|
|
51
69
|
}
|
|
52
70
|
return (0, import_buildTemplate.buildTemplate)(headTemplate, callbacks);
|
|
53
|
-
function injectCss(headTemplate2) {
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
async function injectCss(headTemplate2) {
|
|
72
|
+
const css = await getCssChunks();
|
|
73
|
+
return (0, import_utils.safeReplace)(headTemplate2, import_constants.CHUNK_CSS_PLACEHOLDER, css);
|
|
74
|
+
async function getCssChunks() {
|
|
56
75
|
const { routeManifest, routerContext, routes } = context;
|
|
57
76
|
if (!routeManifest || !routerContext || !routes) {
|
|
58
77
|
return "";
|
|
@@ -74,15 +93,23 @@ function getHeadTemplate(beforeEntryTemplate, context) {
|
|
|
74
93
|
}
|
|
75
94
|
}
|
|
76
95
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
const { enableInlineStyles } = pluginConfig;
|
|
97
|
+
const styles = await Promise.all(cssChunks.map(async (chunk) => {
|
|
98
|
+
const link = `<link href="${chunk}" rel="stylesheet" />`;
|
|
99
|
+
if ((0, import_utils.checkIsNode)() && checkIsInline(chunk, enableInlineStyles)) {
|
|
100
|
+
return readAsset(chunk).then((content) => `<style>${content}</style>`).catch((_) => {
|
|
101
|
+
return link;
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
return link;
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
107
|
+
return `${styles.join("")}`;
|
|
81
108
|
}
|
|
82
109
|
}
|
|
83
110
|
}
|
|
84
|
-
function buildShellBeforeTemplate(beforeAppTemplate, context) {
|
|
85
|
-
const headTemplate = getHeadTemplate(beforeAppTemplate, context);
|
|
111
|
+
async function buildShellBeforeTemplate(beforeAppTemplate, context, pluginConfig) {
|
|
112
|
+
const headTemplate = await getHeadTemplate(beforeAppTemplate, context, pluginConfig);
|
|
86
113
|
return beforeAppTemplate.replace(import_buildTemplate.HEAD_REG_EXP, headTemplate);
|
|
87
114
|
}
|
|
88
115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -34,10 +34,9 @@ module.exports = __toCommonJS(renderToStream_exports);
|
|
|
34
34
|
var import_react = require("react");
|
|
35
35
|
var import_node = require("@modern-js/runtime-utils/node");
|
|
36
36
|
var import_time = require("@modern-js/runtime-utils/time");
|
|
37
|
-
var import_prerender = require("../../react/prerender");
|
|
38
37
|
var import_tracker = require("../tracker");
|
|
39
38
|
var import_renderToPipe = __toESM(require("./renderToPipe"));
|
|
40
|
-
const render = ({ App, context }) => {
|
|
39
|
+
const render = ({ App, context, config }) => {
|
|
41
40
|
const { ssrContext } = context;
|
|
42
41
|
if (!ssrContext) {
|
|
43
42
|
throw new Error('The "ssrContext" must not be undefined, but received undefined');
|
|
@@ -50,12 +49,8 @@ const render = ({ App, context }) => {
|
|
|
50
49
|
})
|
|
51
50
|
});
|
|
52
51
|
const { tracker } = ssrContext;
|
|
53
|
-
const pipe = (0, import_renderToPipe.default)(rootElement, context, {
|
|
52
|
+
const pipe = (0, import_renderToPipe.default)(rootElement, context, config, {
|
|
54
53
|
onShellReady() {
|
|
55
|
-
const cacheConfig = import_prerender.PreRender.config();
|
|
56
|
-
if (cacheConfig) {
|
|
57
|
-
ssrContext.cacheConfig = cacheConfig;
|
|
58
|
-
}
|
|
59
54
|
const cost = end();
|
|
60
55
|
tracker.trackTiming(import_tracker.SSRTimings.RENDER_SHELL, cost);
|
|
61
56
|
},
|
|
@@ -30,7 +30,7 @@ var ShellChunkStatus;
|
|
|
30
30
|
ShellChunkStatus2[ShellChunkStatus2["START"] = 0] = "START";
|
|
31
31
|
ShellChunkStatus2[ShellChunkStatus2["FINIESH"] = 1] = "FINIESH";
|
|
32
32
|
})(ShellChunkStatus || (ShellChunkStatus = {}));
|
|
33
|
-
function renderToPipe(rootElement, context, options) {
|
|
33
|
+
function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
34
34
|
let shellChunkStatus = 0;
|
|
35
35
|
const { ssrContext } = context;
|
|
36
36
|
const chunkVec = [];
|
|
@@ -45,41 +45,43 @@ function renderToPipe(rootElement, context, options) {
|
|
|
45
45
|
...options,
|
|
46
46
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
47
47
|
onShellReady() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
(0, import_template.getTemplates)(context, import_types.RenderLevel.SERVER_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
49
|
+
var _options_onShellReady;
|
|
50
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
51
|
+
const injectableTransform = new import_stream.Transform({
|
|
52
|
+
transform(chunk, _encoding, callback) {
|
|
53
|
+
try {
|
|
54
|
+
if (shellChunkStatus !== 1) {
|
|
55
|
+
chunkVec.push(chunk.toString());
|
|
56
|
+
let concatedChunk = chunkVec.join("");
|
|
57
|
+
if (concatedChunk.endsWith(import_common.ESCAPED_SHELL_STREAM_END_MARK)) {
|
|
58
|
+
concatedChunk = concatedChunk.replace(import_common.ESCAPED_SHELL_STREAM_END_MARK, "");
|
|
59
|
+
shellChunkStatus = 1;
|
|
60
|
+
this.push(`${shellBefore}${concatedChunk}${shellAfter}`);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
this.push(chunk);
|
|
64
|
+
}
|
|
65
|
+
callback();
|
|
66
|
+
} catch (e) {
|
|
67
|
+
if (e instanceof Error) {
|
|
68
|
+
callback(e);
|
|
69
|
+
} else {
|
|
70
|
+
callback(new Error("Received unkown error when streaming"));
|
|
61
71
|
}
|
|
62
|
-
} else {
|
|
63
|
-
this.push(chunk);
|
|
64
|
-
}
|
|
65
|
-
callback();
|
|
66
|
-
} catch (e) {
|
|
67
|
-
if (e instanceof Error) {
|
|
68
|
-
callback(e);
|
|
69
|
-
} else {
|
|
70
|
-
callback(new Error("Received unkown error when streaming"));
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
}
|
|
74
|
+
});
|
|
75
|
+
resolve(pipe(injectableTransform).pipe(stream));
|
|
74
76
|
});
|
|
75
|
-
resolve(pipe(injectableTransform).pipe(stream));
|
|
76
77
|
},
|
|
77
78
|
onShellError(error) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
(0, import_template.getTemplates)(context, import_types.RenderLevel.CLIENT_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
80
|
+
var _options_onShellError;
|
|
81
|
+
const fallbackHtml = `${shellBefore}${shellAfter}`;
|
|
82
|
+
resolve(fallbackHtml);
|
|
83
|
+
options === null || options === void 0 ? void 0 : (_options_onShellError = options.onShellError) === null || _options_onShellError === void 0 ? void 0 : _options_onShellError.call(options, error);
|
|
84
|
+
});
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
});
|
|
@@ -30,7 +30,7 @@ var ShellChunkStatus;
|
|
|
30
30
|
ShellChunkStatus2[ShellChunkStatus2["START"] = 0] = "START";
|
|
31
31
|
ShellChunkStatus2[ShellChunkStatus2["FINIESH"] = 1] = "FINIESH";
|
|
32
32
|
})(ShellChunkStatus || (ShellChunkStatus = {}));
|
|
33
|
-
function renderToPipe(rootElement, context, options) {
|
|
33
|
+
function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
34
34
|
let shellChunkStatus = 0;
|
|
35
35
|
const chunkVec = [];
|
|
36
36
|
const { ssrContext } = context;
|
|
@@ -40,7 +40,7 @@ function renderToPipe(rootElement, context, options) {
|
|
|
40
40
|
({ renderToReadableStream } = require("react-dom/server"));
|
|
41
41
|
} catch (e) {
|
|
42
42
|
}
|
|
43
|
-
const { shellAfter, shellBefore } = (0, import_template.getTemplates)(context, import_types.RenderLevel.SERVER_RENDER);
|
|
43
|
+
const { shellAfter, shellBefore } = await (0, import_template.getTemplates)(context, import_types.RenderLevel.SERVER_RENDER, pluginConfig);
|
|
44
44
|
try {
|
|
45
45
|
const readableOriginal = await renderToReadableStream(rootElement, {
|
|
46
46
|
...options,
|
|
@@ -79,7 +79,7 @@ function renderToPipe(rootElement, context, options) {
|
|
|
79
79
|
return injectableStream;
|
|
80
80
|
} catch (err) {
|
|
81
81
|
ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.tracker.trackError(import_tracker.SSRErrors.RENDER_SHELL, err);
|
|
82
|
-
const { shellAfter: shellAfter2, shellBefore: shellBefore2 } = (0, import_template.getTemplates)(context, import_types.RenderLevel.CLIENT_RENDER);
|
|
82
|
+
const { shellAfter: shellAfter2, shellBefore: shellBefore2 } = await (0, import_template.getTemplates)(context, import_types.RenderLevel.CLIENT_RENDER, pluginConfig);
|
|
83
83
|
const fallbackHtml = `${shellBefore2}${shellAfter2}`;
|
|
84
84
|
return fallbackHtml;
|
|
85
85
|
}
|
|
@@ -24,11 +24,11 @@ module.exports = __toCommonJS(template_exports);
|
|
|
24
24
|
var import_buildTemplate = require("./buildTemplate.after");
|
|
25
25
|
var import_bulidTemplate = require("./bulidTemplate.before");
|
|
26
26
|
const HTML_SEPARATOR = "<!--<?- html ?>-->";
|
|
27
|
-
const getTemplates = (context, renderLevel) => {
|
|
27
|
+
const getTemplates = async (context, renderLevel, pluginConfig) => {
|
|
28
28
|
const { ssrContext } = context;
|
|
29
29
|
const [beforeAppTemplate = "", afterAppHtmlTemplate = ""] = ssrContext.template.split(HTML_SEPARATOR) || [];
|
|
30
|
-
const builtBeforeTemplate = (0, import_bulidTemplate.buildShellBeforeTemplate)(beforeAppTemplate, context);
|
|
31
|
-
const builtAfterTemplate = (0, import_buildTemplate.buildShellAfterTemplate)(afterAppHtmlTemplate, {
|
|
30
|
+
const builtBeforeTemplate = await (0, import_bulidTemplate.buildShellBeforeTemplate)(beforeAppTemplate, context, pluginConfig);
|
|
31
|
+
const builtAfterTemplate = await (0, import_buildTemplate.buildShellAfterTemplate)(afterAppHtmlTemplate, {
|
|
32
32
|
context,
|
|
33
33
|
renderLevel
|
|
34
34
|
});
|
|
@@ -25,28 +25,22 @@ __export(buildHtml_exports, {
|
|
|
25
25
|
createReplaceSSRDataScript: () => createReplaceSSRDataScript
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(buildHtml_exports);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return s1 + replaceValue + s2;
|
|
31
|
-
}
|
|
28
|
+
var import_utils = require("../utils");
|
|
29
|
+
var import_constants = require("../constants");
|
|
32
30
|
function buildHtml(template, callbacks) {
|
|
33
31
|
return callbacks.reduce((tmp, cb) => cb(tmp), template);
|
|
34
32
|
}
|
|
35
33
|
function createReplaceHtml(html) {
|
|
36
|
-
|
|
37
|
-
return (template) => unsafeReplace(template, HTML_REMARK, html);
|
|
34
|
+
return (template) => (0, import_utils.safeReplace)(template, import_constants.HTML_PLACEHOLDER, html);
|
|
38
35
|
}
|
|
39
36
|
function createReplaceSSRDataScript(data) {
|
|
40
|
-
|
|
41
|
-
return (template) => unsafeReplace(template, SSR_DATA_REMARK, data);
|
|
37
|
+
return (template) => (0, import_utils.safeReplace)(template, import_constants.SSR_DATA_PLACEHOLDER, data);
|
|
42
38
|
}
|
|
43
39
|
function createReplaceChunkJs(js) {
|
|
44
|
-
|
|
45
|
-
return (template) => unsafeReplace(template, CHUNK_JS_REMARK, js);
|
|
40
|
+
return (template) => (0, import_utils.safeReplace)(template, import_constants.CHUNK_JS_PLACEHOLDER, js);
|
|
46
41
|
}
|
|
47
42
|
function createReplaceChunkCss(css) {
|
|
48
|
-
|
|
49
|
-
return (template) => unsafeReplace(template, CHUNK_CSS_REG, css);
|
|
43
|
+
return (template) => (0, import_utils.safeReplace)(template, import_constants.CHUNK_CSS_PLACEHOLDER, css);
|
|
50
44
|
}
|
|
51
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
46
|
0 && (module.exports = {
|
|
@@ -40,17 +40,20 @@ var import_utils = require("../../../router/runtime/utils");
|
|
|
40
40
|
var import_helmet = __toESM(require("../helmet"));
|
|
41
41
|
var import_types = require("../types");
|
|
42
42
|
var import_prefetch = __toESM(require("../../prefetch"));
|
|
43
|
+
var import_constants = require("../constants");
|
|
43
44
|
var import_utils2 = require("../utils");
|
|
44
45
|
var import_tracker = require("../tracker");
|
|
45
46
|
var import_loadable = require("./loadable");
|
|
46
47
|
var import_render = require("./render");
|
|
47
48
|
var import_styledComponent = require("./styledComponent");
|
|
48
49
|
var import_buildHtml = require("./buildHtml");
|
|
49
|
-
const buildTemplateData = (context, data, renderLevel, tracker) => {
|
|
50
|
-
const { request
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const buildTemplateData = (context, data, renderLevel, tracker, config) => {
|
|
51
|
+
const { request } = context;
|
|
52
|
+
const { unsafeHeaders } = config;
|
|
53
|
+
const headers = unsafeHeaders ? Object.fromEntries(Object.entries(request.headers).filter(([key, _]) => {
|
|
54
|
+
var _unsafeHeaders_map;
|
|
55
|
+
return unsafeHeaders === null || unsafeHeaders === void 0 ? void 0 : (_unsafeHeaders_map = unsafeHeaders.map((header) => header.toLowerCase())) === null || _unsafeHeaders_map === void 0 ? void 0 : _unsafeHeaders_map.includes(key.toLowerCase());
|
|
56
|
+
})) : void 0;
|
|
54
57
|
return {
|
|
55
58
|
data,
|
|
56
59
|
context: {
|
|
@@ -60,7 +63,7 @@ const buildTemplateData = (context, data, renderLevel, tracker) => {
|
|
|
60
63
|
pathname: request.pathname,
|
|
61
64
|
host: request.host,
|
|
62
65
|
url: request.url,
|
|
63
|
-
|
|
66
|
+
headers
|
|
64
67
|
},
|
|
65
68
|
reporter: {
|
|
66
69
|
sessionId: tracker.sessionId
|
|
@@ -69,8 +72,7 @@ const buildTemplateData = (context, data, renderLevel, tracker) => {
|
|
|
69
72
|
renderLevel
|
|
70
73
|
};
|
|
71
74
|
};
|
|
72
|
-
|
|
73
|
-
Entry = class Entry2 {
|
|
75
|
+
class Entry {
|
|
74
76
|
async renderToHtml(context) {
|
|
75
77
|
var _ssrContext_redirection, _ssrContext_redirection1, _ssrContext_redirection2;
|
|
76
78
|
const ssrContext = context.ssrContext;
|
|
@@ -92,7 +94,7 @@ Entry = class Entry2 {
|
|
|
92
94
|
loaderData: routerContext.loaderData,
|
|
93
95
|
errors: (0, import_utils.serializeErrors)(routerContext.errors)
|
|
94
96
|
} : void 0;
|
|
95
|
-
const templateData = buildTemplateData(ssrContext, prefetchData, this.result.renderLevel, this.tracker);
|
|
97
|
+
const templateData = buildTemplateData(ssrContext, prefetchData, this.result.renderLevel, this.tracker, this.pluginConfig);
|
|
96
98
|
const ssrDataScripts = this.getSSRDataScript(templateData, routerData);
|
|
97
99
|
const html = (0, import_buildHtml.buildHtml)(this.template, [
|
|
98
100
|
(0, import_buildHtml.createReplaceChunkCss)(this.result.chunksMap.css),
|
|
@@ -147,12 +149,12 @@ Entry = class Entry2 {
|
|
|
147
149
|
const attrsStr = (0, import_utils2.attributesToString)({
|
|
148
150
|
nonce: this.nonce
|
|
149
151
|
});
|
|
150
|
-
let ssrDataScripts = useInlineScript ? `<script${attrsStr}>window._SSR_DATA = ${ssrData}</script>` : `<script type="application/json" id="${
|
|
152
|
+
let ssrDataScripts = useInlineScript ? `<script${attrsStr}>window._SSR_DATA = ${ssrData}</script>` : `<script type="application/json" id="${import_constants.SSR_DATA_JSON_ID}">${ssrData}</script>`;
|
|
151
153
|
if (routerData) {
|
|
152
154
|
const serializedRouterData = (0, import_node.serializeJson)(routerData);
|
|
153
155
|
ssrDataScripts += useInlineScript ? `
|
|
154
156
|
<script${attrsStr}>window._ROUTER_DATA = ${serializedRouterData}</script>` : `
|
|
155
|
-
<script type="application/json" id="${
|
|
157
|
+
<script type="application/json" id="${import_constants.ROUTER_DATA_JSON_ID}">${serializedRouterData}</script>`;
|
|
156
158
|
}
|
|
157
159
|
return ssrDataScripts;
|
|
158
160
|
}
|
|
@@ -187,4 +189,4 @@ Entry = class Entry2 {
|
|
|
187
189
|
}
|
|
188
190
|
};
|
|
189
191
|
}
|
|
190
|
-
}
|
|
192
|
+
}
|
|
@@ -32,7 +32,6 @@ __export(renderToString_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(renderToString_exports);
|
|
34
34
|
var import_node = require("@modern-js/runtime-utils/node");
|
|
35
|
-
var import_prerender = require("../../react/prerender");
|
|
36
35
|
var import_entry = __toESM(require("./entry"));
|
|
37
36
|
const render = ({ App, context, config }) => {
|
|
38
37
|
const ssrContext = context.ssrContext;
|
|
@@ -44,10 +43,6 @@ const render = ({ App, context, config }) => {
|
|
|
44
43
|
});
|
|
45
44
|
entry.metrics.emitCounter("app.visit.count", 1);
|
|
46
45
|
const html = await entry.renderToHtml(context);
|
|
47
|
-
const cacheConfig = import_prerender.PreRender.config();
|
|
48
|
-
if (cacheConfig) {
|
|
49
|
-
context.ssrContext.cacheConfig = cacheConfig;
|
|
50
|
-
}
|
|
51
46
|
return html;
|
|
52
47
|
});
|
|
53
48
|
};
|
|
@@ -58,10 +58,6 @@ const readAsset = async (chunk) => {
|
|
|
58
58
|
const filepath = path.resolve(__dirname, chunk.filename);
|
|
59
59
|
return fs.readFile(filepath, "utf-8");
|
|
60
60
|
};
|
|
61
|
-
const checkIsNode = () => {
|
|
62
|
-
var _process_release;
|
|
63
|
-
return typeof process !== "undefined" && ((_process_release = process.release) === null || _process_release === void 0 ? void 0 : _process_release.name) === "node";
|
|
64
|
-
};
|
|
65
61
|
class LoadableCollector {
|
|
66
62
|
get existsAssets() {
|
|
67
63
|
var _routeManifest_routeAssets_entryName, _routeManifest_routeAssets;
|
|
@@ -121,7 +117,7 @@ class LoadableCollector {
|
|
|
121
117
|
return !jsChunkReg.test(template) && !((_this_existsAssets = this.existsAssets) === null || _this_existsAssets === void 0 ? void 0 : _this_existsAssets.includes(chunk.path));
|
|
122
118
|
}).map(async (chunk) => {
|
|
123
119
|
const script = `<script${attributes} src="${chunk.url}"></script>`;
|
|
124
|
-
if (
|
|
120
|
+
if ((0, import_utils.checkIsNode)() && checkIsInline(chunk, enableInlineScripts)) {
|
|
125
121
|
return readAsset(chunk).then((content) => `<script>${content}</script>`).catch((_) => {
|
|
126
122
|
return script;
|
|
127
123
|
});
|
|
@@ -140,7 +136,7 @@ class LoadableCollector {
|
|
|
140
136
|
return !cssChunkReg.test(template) && !((_this_existsAssets = this.existsAssets) === null || _this_existsAssets === void 0 ? void 0 : _this_existsAssets.includes(chunk.path));
|
|
141
137
|
}).map(async (chunk) => {
|
|
142
138
|
const link = `<link${atrributes} href="${chunk.url}" rel="stylesheet" />`;
|
|
143
|
-
if (
|
|
139
|
+
if ((0, import_utils.checkIsNode)() && checkIsInline(chunk, enableInlineStyles)) {
|
|
144
140
|
return readAsset(chunk).then((content) => `<style>${content}</style>`).catch((_) => {
|
|
145
141
|
return link;
|
|
146
142
|
});
|
|
@@ -18,10 +18,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
RenderLevel: () =>
|
|
21
|
+
RenderLevel: () => RenderLevel
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
|
-
var
|
|
24
|
+
var RenderLevel;
|
|
25
|
+
(function(RenderLevel2) {
|
|
26
|
+
RenderLevel2[RenderLevel2["CLIENT_RENDER"] = 0] = "CLIENT_RENDER";
|
|
27
|
+
RenderLevel2[RenderLevel2["SERVER_PREFETCH"] = 1] = "SERVER_PREFETCH";
|
|
28
|
+
RenderLevel2[RenderLevel2["SERVER_RENDER"] = 2] = "SERVER_RENDER";
|
|
29
|
+
})(RenderLevel || (RenderLevel = {}));
|
|
25
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
31
|
0 && (module.exports = {
|
|
27
32
|
RenderLevel
|