@modern-js/runtime 2.57.1 → 2.57.2-alpha.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/ssr/index.js +14 -1
- package/dist/cjs/core/browser/hydrate.js +9 -25
- package/dist/cjs/core/browser/index.js +3 -5
- package/dist/cjs/core/compatible.js +6 -19
- package/dist/cjs/core/react/index.js +1 -10
- package/dist/cjs/core/react/wrapper.js +44 -0
- package/dist/cjs/core/server/stream/shared.js +4 -16
- package/dist/cjs/core/server/string/index.js +4 -6
- package/dist/cjs/core/server/string/prefetch.js +7 -21
- package/dist/esm/cli/ssr/index.js +16 -1
- package/dist/esm/core/browser/hydrate.js +9 -15
- package/dist/esm/core/browser/index.js +3 -5
- package/dist/esm/core/compatible.js +5 -22
- package/dist/esm/core/react/index.js +2 -14
- package/dist/esm/core/react/wrapper.js +10 -0
- package/dist/esm/core/server/stream/shared.js +4 -6
- package/dist/esm/core/server/string/index.js +4 -6
- package/dist/esm/core/server/string/prefetch.js +7 -11
- package/dist/esm-node/cli/ssr/index.js +14 -1
- package/dist/esm-node/core/browser/hydrate.js +9 -15
- package/dist/esm-node/core/browser/index.js +3 -5
- package/dist/esm-node/core/compatible.js +6 -19
- package/dist/esm-node/core/react/index.js +2 -11
- package/dist/esm-node/core/react/wrapper.js +10 -0
- package/dist/esm-node/core/server/stream/shared.js +4 -6
- package/dist/esm-node/core/server/string/index.js +4 -6
- package/dist/esm-node/core/server/string/prefetch.js +7 -11
- package/dist/index.js +635 -0
- package/dist/types/core/compatible.d.ts +1 -1
- package/dist/types/core/react/index.d.ts +1 -1
- package/dist/types/core/react/wrapper.d.ts +3 -0
- package/package.json +5 -5
|
@@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
|
3
3
|
import { time } from "@modern-js/runtime-utils/time";
|
|
4
4
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
5
5
|
import { run } from "@modern-js/runtime-utils/node";
|
|
6
|
-
import
|
|
6
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
7
7
|
import { SSRErrors, SSRTimings, createOnError, createOnTiming } from "../tracer";
|
|
8
8
|
import { getSSRConfigByEntry } from "../utils";
|
|
9
9
|
var ShellChunkStatus;
|
|
@@ -49,11 +49,9 @@ function createRenderStreaming(createReadableStreamFromElement) {
|
|
|
49
49
|
onTiming = createOnTiming(options.onTiming);
|
|
50
50
|
htmlTemplate = resource.htmlTemplate, entryName = resource.entryName;
|
|
51
51
|
ssrConfig = getSSRConfigByEntry(entryName, config.ssr, config.ssrByEntries);
|
|
52
|
-
rootElement =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
});
|
|
52
|
+
rootElement = wrapRuntimeContextProvider(serverRoot, Object.assign(runtimeContext, {
|
|
53
|
+
ssr: true
|
|
54
|
+
}));
|
|
57
55
|
return [
|
|
58
56
|
4,
|
|
59
57
|
createReadableStreamFromElement(request, rootElement, {
|
|
@@ -3,10 +3,10 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
|
3
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
4
|
import ReactHelmet from "react-helmet";
|
|
5
5
|
import ReactDomServer from "react-dom/server";
|
|
6
|
-
import React from "react";
|
|
7
6
|
import { time } from "@modern-js/runtime-utils/time";
|
|
8
7
|
import { run } from "@modern-js/runtime-utils/node";
|
|
9
8
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
9
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
10
10
|
import { createReplaceHelemt } from "../helmet";
|
|
11
11
|
import { getSSRConfigByEntry, safeReplace } from "../utils";
|
|
12
12
|
import { CHUNK_CSS_PLACEHOLDER, CHUNK_JS_PLACEHOLDER, HTML_PLACEHOLDER, SSR_DATA_PLACEHOLDER } from "../constants";
|
|
@@ -93,11 +93,9 @@ var renderString = function() {
|
|
|
93
93
|
nonce: config.nonce
|
|
94
94
|
})
|
|
95
95
|
];
|
|
96
|
-
rootElement =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
100
|
-
});
|
|
96
|
+
rootElement = wrapRuntimeContextProvider(serverRoot, Object.assign(runtimeContext, {
|
|
97
|
+
ssr: true
|
|
98
|
+
}));
|
|
101
99
|
return [
|
|
102
100
|
4,
|
|
103
101
|
generateHtml(rootElement, htmlTemplate, chunkSet, collectors, ((_runtimeContext_ssrContext = runtimeContext.ssrContext) === null || _runtimeContext_ssrContext === void 0 ? void 0 : _runtimeContext_ssrContext.htmlModifiers) || [], tracer)
|
|
@@ -5,7 +5,7 @@ import { run } from "@modern-js/runtime-utils/node";
|
|
|
5
5
|
import { ChunkExtractor } from "@loadable/server";
|
|
6
6
|
import { time } from "@modern-js/runtime-utils/time";
|
|
7
7
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
8
|
-
import
|
|
8
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
9
9
|
import { SSRErrors, SSRTimings } from "../tracer";
|
|
10
10
|
var prefetch = function() {
|
|
11
11
|
var _ref = _async_to_generator(function(App, request, options, ssrConfig, param) {
|
|
@@ -32,17 +32,13 @@ var prefetch = function() {
|
|
|
32
32
|
entryName
|
|
33
33
|
].filter(Boolean)
|
|
34
34
|
});
|
|
35
|
-
renderToStaticMarkup(extractor.collectChunks(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
})));
|
|
35
|
+
renderToStaticMarkup(extractor.collectChunks(wrapRuntimeContextProvider(App, Object.assign(context, {
|
|
36
|
+
ssr: false
|
|
37
|
+
}))));
|
|
40
38
|
} else {
|
|
41
|
-
renderToStaticMarkup(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
}));
|
|
39
|
+
renderToStaticMarkup(wrapRuntimeContextProvider(App, Object.assign(context, {
|
|
40
|
+
ssr: false
|
|
41
|
+
})));
|
|
46
42
|
}
|
|
47
43
|
cost = end();
|
|
48
44
|
onTiming(SSRTimings.PRERENDER, cost);
|
|
@@ -52,6 +52,7 @@ const ssrPlugin = () => ({
|
|
|
52
52
|
"@modern-js/runtime"
|
|
53
53
|
],
|
|
54
54
|
setup: (api) => {
|
|
55
|
+
const appContext = api.useAppContext();
|
|
55
56
|
return {
|
|
56
57
|
// for bundle
|
|
57
58
|
config() {
|
|
@@ -89,7 +90,19 @@ const ssrPlugin = () => ({
|
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
tools: {
|
|
92
|
-
babel: babelHandler
|
|
93
|
+
babel: babelHandler,
|
|
94
|
+
bundlerChain: (chain, { isServer }) => {
|
|
95
|
+
if (isServer && appContext.moduleType === "module") {
|
|
96
|
+
chain.output.libraryTarget("module").set("chunkFormat", "module");
|
|
97
|
+
chain.output.library({
|
|
98
|
+
type: "module"
|
|
99
|
+
});
|
|
100
|
+
chain.experiments({
|
|
101
|
+
...chain.get("experiments"),
|
|
102
|
+
outputModule: true
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
93
106
|
}
|
|
94
107
|
};
|
|
95
108
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { normalizePathname } from "@modern-js/runtime-utils/url";
|
|
3
3
|
import { loadableReady } from "@loadable/component";
|
|
4
|
-
import React from "react";
|
|
5
4
|
import { RenderLevel } from "../constants";
|
|
5
|
+
import { wrapRuntimeContextProvider } from "../react/wrapper";
|
|
6
6
|
import { WithCallback } from "./withCallback";
|
|
7
7
|
const isReact18 = () => process.env.IS_REACT18 === "true";
|
|
8
8
|
function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
@@ -34,38 +34,32 @@ function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
|
34
34
|
if (renderLevel === RenderLevel.SERVER_RENDER) {
|
|
35
35
|
const SSRApp = () => /* @__PURE__ */ _jsx(WithCallback, {
|
|
36
36
|
callback,
|
|
37
|
-
children:
|
|
38
|
-
_internal_context: hydrateContext
|
|
39
|
-
})
|
|
37
|
+
children: App
|
|
40
38
|
});
|
|
41
|
-
return ModernHydrate(/* @__PURE__ */ _jsx(SSRApp, {}));
|
|
39
|
+
return ModernHydrate(wrapRuntimeContextProvider(/* @__PURE__ */ _jsx(SSRApp, {}), hydrateContext));
|
|
42
40
|
} else {
|
|
43
|
-
return ModernRender(App);
|
|
41
|
+
return ModernRender(wrapRuntimeContextProvider(App, context));
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
return stringSSRHydrate();
|
|
47
45
|
function stringSSRHydrate() {
|
|
48
46
|
if (renderLevel === RenderLevel.CLIENT_RENDER || renderLevel === RenderLevel.SERVER_PREFETCH) {
|
|
49
|
-
return ModernRender(App);
|
|
47
|
+
return ModernRender(wrapRuntimeContextProvider(App, context));
|
|
50
48
|
} else if (renderLevel === RenderLevel.SERVER_RENDER) {
|
|
51
49
|
return new Promise((resolve) => {
|
|
52
50
|
if (isReact18()) {
|
|
53
51
|
loadableReady(() => {
|
|
54
52
|
const SSRApp = () => /* @__PURE__ */ _jsx(WithCallback, {
|
|
55
53
|
callback,
|
|
56
|
-
children:
|
|
57
|
-
_internal_context: hydrateContext
|
|
58
|
-
})
|
|
54
|
+
children: App
|
|
59
55
|
});
|
|
60
|
-
ModernHydrate(/* @__PURE__ */ _jsx(SSRApp, {})).then((root) => {
|
|
56
|
+
ModernHydrate(wrapRuntimeContextProvider(/* @__PURE__ */ _jsx(SSRApp, {}), hydrateContext)).then((root) => {
|
|
61
57
|
resolve(root);
|
|
62
58
|
});
|
|
63
59
|
});
|
|
64
60
|
} else {
|
|
65
61
|
loadableReady(() => {
|
|
66
|
-
ModernHydrate(
|
|
67
|
-
_internal_context: hydrateContext
|
|
68
|
-
}), callback).then((root) => {
|
|
62
|
+
ModernHydrate(wrapRuntimeContextProvider(App, hydrateContext), callback).then((root) => {
|
|
69
63
|
resolve(root);
|
|
70
64
|
});
|
|
71
65
|
});
|
|
@@ -73,7 +67,7 @@ function hydrateRoot(App, context, ModernRender, ModernHydrate) {
|
|
|
73
67
|
});
|
|
74
68
|
} else {
|
|
75
69
|
console.warn(`unknow render level: ${renderLevel}, execute render()`);
|
|
76
|
-
return ModernRender(App);
|
|
70
|
+
return ModernRender(wrapRuntimeContextProvider(App, context));
|
|
77
71
|
}
|
|
78
72
|
}
|
|
79
73
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import cookieTool from "cookie";
|
|
3
2
|
import { getGlobalAppInit } from "../context";
|
|
4
3
|
import { getInitialContext } from "../context/runtime";
|
|
5
4
|
import { createLoaderManager } from "../loader/loaderManager";
|
|
6
5
|
import { getGlobalRunner } from "../plugin/runner";
|
|
6
|
+
import { wrapRuntimeContextProvider } from "../react/wrapper";
|
|
7
7
|
import { hydrateRoot } from "./hydrate";
|
|
8
8
|
const IS_REACT18 = process.env.IS_REACT18 === "true";
|
|
9
9
|
function getSSRData() {
|
|
@@ -66,9 +66,7 @@ async function render(App, id) {
|
|
|
66
66
|
const rootElement = id && typeof id !== "string" ? id : document.getElementById(id || "root");
|
|
67
67
|
async function ModernRender(App2) {
|
|
68
68
|
const renderFunc = IS_REACT18 ? renderWithReact18 : renderWithReact17;
|
|
69
|
-
return renderFunc(
|
|
70
|
-
_internal_context: context
|
|
71
|
-
}), rootElement);
|
|
69
|
+
return renderFunc(App2, rootElement);
|
|
72
70
|
}
|
|
73
71
|
async function ModernHydrate(App2, callback) {
|
|
74
72
|
const hydrateFunc = IS_REACT18 ? hydrateWithReact18 : hydrateWithReact17;
|
|
@@ -77,7 +75,7 @@ async function render(App, id) {
|
|
|
77
75
|
if (ssrData) {
|
|
78
76
|
return hydrateRoot(App, context, ModernRender, ModernHydrate);
|
|
79
77
|
}
|
|
80
|
-
return ModernRender(App);
|
|
78
|
+
return ModernRender(wrapRuntimeContextProvider(App, context));
|
|
81
79
|
}
|
|
82
80
|
throw Error("`render` function needs id in browser environment, it needs to be string or element");
|
|
83
81
|
}
|
|
@@ -7,6 +7,7 @@ import { createLoaderManager } from "./loader/loaderManager";
|
|
|
7
7
|
import { getGlobalRunner } from "./plugin/runner";
|
|
8
8
|
import { getGlobalAppInit } from "./context";
|
|
9
9
|
import { hydrateRoot as ModernHydrateRoot } from "./browser/hydrate";
|
|
10
|
+
import { wrapRuntimeContextProvider } from "./react/wrapper";
|
|
10
11
|
const IS_REACT18 = process.env.IS_REACT18 === "true";
|
|
11
12
|
function isClientArgs(id) {
|
|
12
13
|
return typeof id === "string" || typeof HTMLElement !== "undefined" && id instanceof HTMLElement;
|
|
@@ -31,23 +32,13 @@ const createApp = ({ plugins, runtime, props: globalProps }) => {
|
|
|
31
32
|
}) : child));
|
|
32
33
|
};
|
|
33
34
|
const WrapperApp = runner.wrapRoot(WrapperComponent);
|
|
34
|
-
const WrapComponent = (
|
|
35
|
-
let contextValue = _internal_context;
|
|
36
|
-
if (!(contextValue === null || contextValue === void 0 ? void 0 : contextValue.runner)) {
|
|
37
|
-
var _getGlobalAppInit;
|
|
38
|
-
contextValue = getInitialContext(runner);
|
|
39
|
-
runner === null || runner === void 0 ? void 0 : runner.beforeRender(contextValue);
|
|
40
|
-
(_getGlobalAppInit = getGlobalAppInit()) === null || _getGlobalAppInit === void 0 ? void 0 : _getGlobalAppInit(contextValue);
|
|
41
|
-
}
|
|
35
|
+
const WrapComponent = (props) => {
|
|
42
36
|
const mergedProps = {
|
|
43
37
|
...props,
|
|
44
38
|
...globalProps
|
|
45
39
|
};
|
|
46
|
-
return /* @__PURE__ */ _jsx(
|
|
47
|
-
|
|
48
|
-
children: /* @__PURE__ */ _jsx(WrapperApp, {
|
|
49
|
-
...mergedProps
|
|
50
|
-
})
|
|
40
|
+
return /* @__PURE__ */ _jsx(WrapperApp, {
|
|
41
|
+
...mergedProps
|
|
51
42
|
});
|
|
52
43
|
};
|
|
53
44
|
return WrapComponent;
|
|
@@ -63,9 +54,7 @@ const bootstrap = async (BootApp, id, root, ReactDOM) => {
|
|
|
63
54
|
return init === null || init === void 0 ? void 0 : init(context2);
|
|
64
55
|
};
|
|
65
56
|
if (!id) {
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
_internal_context: context
|
|
68
|
-
});
|
|
57
|
+
return wrapRuntimeContextProvider(/* @__PURE__ */ _jsx(App, {}), context);
|
|
69
58
|
}
|
|
70
59
|
const isBrowser = typeof window !== "undefined" && window.name !== "nodejs";
|
|
71
60
|
if (isBrowser) {
|
|
@@ -136,9 +125,7 @@ const bootstrap = async (BootApp, id, root, ReactDOM) => {
|
|
|
136
125
|
if (ssrData) {
|
|
137
126
|
return ModernHydrateRoot(/* @__PURE__ */ _jsx(App, {}), context, ModernRender, ModernHydrate);
|
|
138
127
|
}
|
|
139
|
-
return ModernRender(/* @__PURE__ */
|
|
140
|
-
_internal_context: context
|
|
141
|
-
}));
|
|
128
|
+
return ModernRender(wrapRuntimeContextProvider(/* @__PURE__ */ _jsx(App, {}), context));
|
|
142
129
|
} else {
|
|
143
130
|
throw Error("`bootstrap` needs id in browser environment, it needs to be string or element");
|
|
144
131
|
}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RuntimeReactContext, getGlobalApp } from "../context";
|
|
1
|
+
import { getGlobalApp } from "../context";
|
|
3
2
|
import { getGlobalRunner } from "../plugin/runner";
|
|
4
3
|
function createRoot(UserApp) {
|
|
5
4
|
const App = UserApp || getGlobalApp();
|
|
6
5
|
const runner = getGlobalRunner();
|
|
7
6
|
const WrapperApp = runner.wrapRoot(App);
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ _jsx(RuntimeReactContext.Provider, {
|
|
10
|
-
value: _internal_context,
|
|
11
|
-
children: /* @__PURE__ */ _jsx(WrapperApp, {
|
|
12
|
-
...props
|
|
13
|
-
})
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
return WrapComponent;
|
|
7
|
+
return WrapperApp;
|
|
17
8
|
}
|
|
18
9
|
export {
|
|
19
10
|
createRoot
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RuntimeReactContext } from "../context";
|
|
3
|
+
function wrapRuntimeContextProvider(App, contextValue) {
|
|
4
|
+
return /* @__PURE__ */ React.createElement(RuntimeReactContext.Provider, {
|
|
5
|
+
value: contextValue
|
|
6
|
+
}, App);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
wrapRuntimeContextProvider
|
|
10
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { time } from "@modern-js/runtime-utils/time";
|
|
2
2
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
3
3
|
import { run } from "@modern-js/runtime-utils/node";
|
|
4
|
-
import
|
|
4
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
5
5
|
import { SSRErrors, SSRTimings, createOnError, createOnTiming } from "../tracer";
|
|
6
6
|
import { getSSRConfigByEntry } from "../utils";
|
|
7
7
|
var ShellChunkStatus;
|
|
@@ -38,11 +38,9 @@ function createRenderStreaming(createReadableStreamFromElement) {
|
|
|
38
38
|
const onTiming = createOnTiming(options.onTiming);
|
|
39
39
|
const { htmlTemplate, entryName } = resource;
|
|
40
40
|
const ssrConfig = getSSRConfigByEntry(entryName, config.ssr, config.ssrByEntries);
|
|
41
|
-
const rootElement =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
});
|
|
41
|
+
const rootElement = wrapRuntimeContextProvider(serverRoot, Object.assign(runtimeContext, {
|
|
42
|
+
ssr: true
|
|
43
|
+
}));
|
|
46
44
|
const stream = await createReadableStreamFromElement(request, rootElement, {
|
|
47
45
|
config,
|
|
48
46
|
htmlTemplate,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import ReactHelmet from "react-helmet";
|
|
2
2
|
import ReactDomServer from "react-dom/server";
|
|
3
|
-
import React from "react";
|
|
4
3
|
import { time } from "@modern-js/runtime-utils/time";
|
|
5
4
|
import { run } from "@modern-js/runtime-utils/node";
|
|
6
5
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
6
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
7
7
|
import { createReplaceHelemt } from "../helmet";
|
|
8
8
|
import { getSSRConfigByEntry, safeReplace } from "../utils";
|
|
9
9
|
import { CHUNK_CSS_PLACEHOLDER, CHUNK_JS_PLACEHOLDER, HTML_PLACEHOLDER, SSR_DATA_PLACEHOLDER } from "../constants";
|
|
@@ -61,11 +61,9 @@ const renderString = async (request, serverRoot, options) => {
|
|
|
61
61
|
nonce: config.nonce
|
|
62
62
|
})
|
|
63
63
|
];
|
|
64
|
-
const rootElement =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
});
|
|
64
|
+
const rootElement = wrapRuntimeContextProvider(serverRoot, Object.assign(runtimeContext, {
|
|
65
|
+
ssr: true
|
|
66
|
+
}));
|
|
69
67
|
const html = await generateHtml(rootElement, htmlTemplate, chunkSet, collectors, ((_runtimeContext_ssrContext = runtimeContext.ssrContext) === null || _runtimeContext_ssrContext === void 0 ? void 0 : _runtimeContext_ssrContext.htmlModifiers) || [], tracer);
|
|
70
68
|
return html;
|
|
71
69
|
});
|
|
@@ -3,7 +3,7 @@ import { run } from "@modern-js/runtime-utils/node";
|
|
|
3
3
|
import { ChunkExtractor } from "@loadable/server";
|
|
4
4
|
import { time } from "@modern-js/runtime-utils/time";
|
|
5
5
|
import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
|
|
6
|
-
import
|
|
6
|
+
import { wrapRuntimeContextProvider } from "../../react/wrapper";
|
|
7
7
|
import { SSRErrors, SSRTimings } from "../tracer";
|
|
8
8
|
const prefetch = async (App, request, options, ssrConfig, { onError, onTiming }) => {
|
|
9
9
|
const headersData = parseHeaders(request);
|
|
@@ -21,17 +21,13 @@ const prefetch = async (App, request, options, ssrConfig, { onError, onTiming })
|
|
|
21
21
|
entryName
|
|
22
22
|
].filter(Boolean)
|
|
23
23
|
});
|
|
24
|
-
renderToStaticMarkup(extractor.collectChunks(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
})));
|
|
24
|
+
renderToStaticMarkup(extractor.collectChunks(wrapRuntimeContextProvider(App, Object.assign(context, {
|
|
25
|
+
ssr: false
|
|
26
|
+
}))));
|
|
29
27
|
} else {
|
|
30
|
-
renderToStaticMarkup(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
}));
|
|
28
|
+
renderToStaticMarkup(wrapRuntimeContextProvider(App, Object.assign(context, {
|
|
29
|
+
ssr: false
|
|
30
|
+
})));
|
|
35
31
|
}
|
|
36
32
|
const cost = end();
|
|
37
33
|
onTiming(SSRTimings.PRERENDER, cost);
|