@bleedingdev/modern-js-runtime 3.2.0-ultramodern.10 → 3.2.0-ultramodern.100
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/boundary-debugger/index.js +299 -0
- package/dist/cjs/cli/ssr/index.js +5 -15
- package/dist/cjs/cli/template.server.js +1 -0
- package/dist/cjs/core/react/wrapper.js +9 -3
- package/dist/cjs/core/server/federatedCss.js +47 -0
- package/dist/cjs/core/server/helmet.js +8 -2
- package/dist/cjs/core/server/scriptOrder.js +59 -0
- package/dist/cjs/core/server/stream/afterTemplate.js +13 -5
- package/dist/cjs/core/server/stream/beforeTemplate.js +13 -20
- package/dist/cjs/core/server/stream/beforeTemplate.worker.js +98 -0
- package/dist/cjs/core/server/stream/createReadableStream.js +7 -2
- package/dist/cjs/core/server/stream/createReadableStream.worker.js +4 -2
- package/dist/cjs/core/server/stream/shared.js +3 -1
- package/dist/cjs/core/server/string/index.js +16 -9
- package/dist/cjs/core/server/string/loadable.js +74 -10
- package/dist/cjs/exports/head.js +196 -5
- package/dist/cjs/exports/loadable.js +34 -4
- package/dist/cjs/exports/tanstack-router.js +311 -54
- package/dist/cjs/router/cli/code/tanstackTypes.js +116 -51
- package/dist/cjs/router/cli/code/templates.js +15 -9
- package/dist/cjs/router/runtime/tanstack/hydrationBoundary.js +44 -0
- package/dist/cjs/router/runtime/tanstack/outlet.js +54 -0
- package/dist/cjs/router/runtime/tanstack/plugin.js +190 -88
- package/dist/cjs/router/runtime/tanstack/plugin.node.js +4 -14
- package/dist/cjs/router/runtime/tanstack/routeTree.js +64 -12
- package/dist/cjs/rsc/server.worker.js +58 -0
- package/dist/cjs/ssr/serverRender/renderToString/entry.js +9 -8
- package/dist/esm/boundary-debugger/index.mjs +263 -0
- package/dist/esm/cli/ssr/index.mjs +5 -15
- package/dist/esm/cli/template.server.mjs +1 -0
- package/dist/esm/core/react/wrapper.mjs +9 -3
- package/dist/esm/core/server/federatedCss.mjs +13 -0
- package/dist/esm/core/server/helmet.mjs +5 -2
- package/dist/esm/core/server/scriptOrder.mjs +25 -0
- package/dist/esm/core/server/stream/afterTemplate.mjs +14 -6
- package/dist/esm/core/server/stream/beforeTemplate.mjs +14 -11
- package/dist/esm/core/server/stream/beforeTemplate.worker.mjs +64 -0
- package/dist/esm/core/server/stream/createReadableStream.mjs +7 -2
- package/dist/esm/core/server/stream/createReadableStream.worker.mjs +4 -2
- package/dist/esm/core/server/stream/shared.mjs +3 -1
- package/dist/esm/core/server/string/index.mjs +17 -9
- package/dist/esm/core/server/string/loadable.mjs +70 -9
- package/dist/esm/exports/head.mjs +189 -4
- package/dist/esm/exports/loadable.mjs +20 -3
- package/dist/esm/exports/tanstack-router.mjs +2 -1
- package/dist/esm/router/cli/code/tanstackTypes.mjs +116 -51
- package/dist/esm/router/cli/code/templates.mjs +15 -9
- package/dist/esm/router/runtime/tanstack/hydrationBoundary.mjs +10 -0
- package/dist/esm/router/runtime/tanstack/outlet.mjs +17 -0
- package/dist/esm/router/runtime/tanstack/plugin.mjs +193 -91
- package/dist/esm/router/runtime/tanstack/plugin.node.mjs +5 -15
- package/dist/esm/router/runtime/tanstack/routeTree.mjs +65 -13
- package/dist/esm/rsc/server.worker.mjs +1 -0
- package/dist/esm/ssr/serverRender/renderToString/entry.mjs +9 -6
- package/dist/esm-node/boundary-debugger/index.mjs +264 -0
- package/dist/esm-node/cli/ssr/index.mjs +5 -15
- package/dist/esm-node/cli/template.server.mjs +1 -0
- package/dist/esm-node/core/react/wrapper.mjs +9 -3
- package/dist/esm-node/core/server/federatedCss.mjs +14 -0
- package/dist/esm-node/core/server/helmet.mjs +5 -2
- package/dist/esm-node/core/server/scriptOrder.mjs +26 -0
- package/dist/esm-node/core/server/stream/afterTemplate.mjs +14 -6
- package/dist/esm-node/core/server/stream/beforeTemplate.mjs +14 -11
- package/dist/esm-node/core/server/stream/beforeTemplate.worker.mjs +65 -0
- package/dist/esm-node/core/server/stream/createReadableStream.mjs +7 -2
- package/dist/esm-node/core/server/stream/createReadableStream.worker.mjs +4 -2
- package/dist/esm-node/core/server/stream/shared.mjs +3 -1
- package/dist/esm-node/core/server/string/index.mjs +17 -9
- package/dist/esm-node/core/server/string/loadable.mjs +70 -9
- package/dist/esm-node/exports/head.mjs +189 -4
- package/dist/esm-node/exports/loadable.mjs +20 -3
- package/dist/esm-node/exports/tanstack-router.mjs +2 -1
- package/dist/esm-node/router/cli/code/tanstackTypes.mjs +116 -51
- package/dist/esm-node/router/cli/code/templates.mjs +15 -9
- package/dist/esm-node/router/runtime/tanstack/hydrationBoundary.mjs +11 -0
- package/dist/esm-node/router/runtime/tanstack/outlet.mjs +18 -0
- package/dist/esm-node/router/runtime/tanstack/plugin.mjs +193 -91
- package/dist/esm-node/router/runtime/tanstack/plugin.node.mjs +5 -15
- package/dist/esm-node/router/runtime/tanstack/routeTree.mjs +65 -13
- package/dist/esm-node/rsc/server.worker.mjs +2 -0
- package/dist/esm-node/ssr/serverRender/renderToString/entry.mjs +9 -6
- package/dist/types/boundary-debugger/index.d.ts +28 -0
- package/dist/types/core/context/runtime.d.ts +4 -0
- package/dist/types/core/server/federatedCss.d.ts +5 -0
- package/dist/types/core/server/helmet.d.ts +5 -3
- package/dist/types/core/server/scriptOrder.d.ts +1 -0
- package/dist/types/core/server/stream/beforeTemplate.d.ts +1 -0
- package/dist/types/core/server/stream/beforeTemplate.worker.d.ts +10 -0
- package/dist/types/core/server/stream/shared.d.ts +8 -0
- package/dist/types/core/server/string/loadable.d.ts +11 -0
- package/dist/types/exports/head.d.ts +10 -3
- package/dist/types/exports/loadable.d.ts +8 -1
- package/dist/types/exports/tanstack-router.d.ts +3 -1
- package/dist/types/router/runtime/tanstack/hydrationBoundary.d.ts +2 -0
- package/dist/types/router/runtime/tanstack/outlet.d.ts +2 -0
- package/dist/types/rsc/server.worker.d.ts +1 -0
- package/package.json +24 -18
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
buildShellBeforeTemplate: ()=>buildShellBeforeTemplate
|
|
28
|
+
});
|
|
29
|
+
const router_namespaceObject = require("@modern-js/runtime-utils/router");
|
|
30
|
+
const lifecycle_js_namespaceObject = require("../../../router/runtime/lifecycle.js");
|
|
31
|
+
const external_constants_js_namespaceObject = require("../constants.js");
|
|
32
|
+
const external_federatedCss_js_namespaceObject = require("../federatedCss.js");
|
|
33
|
+
const external_helmet_js_namespaceObject = require("../helmet.js");
|
|
34
|
+
const external_shared_js_namespaceObject = require("../shared.js");
|
|
35
|
+
const external_utils_js_namespaceObject = require("../utils.js");
|
|
36
|
+
const checkIsInline = (chunk, enableInline)=>{
|
|
37
|
+
if ('production' !== process.env.NODE_ENV) return false;
|
|
38
|
+
if (enableInline instanceof RegExp) return enableInline.test(chunk);
|
|
39
|
+
return Boolean(enableInline);
|
|
40
|
+
};
|
|
41
|
+
async function buildShellBeforeTemplate(beforeAppTemplate, options) {
|
|
42
|
+
const { config, runtimeContext, styledComponentsStyleTags, entryName, moduleFederationCssAssets } = options;
|
|
43
|
+
const helmetData = (0, external_helmet_js_namespaceObject.getHelmetData)(runtimeContext);
|
|
44
|
+
const callbacks = [
|
|
45
|
+
(0, external_helmet_js_namespaceObject.createReplaceHelemt)(helmetData),
|
|
46
|
+
(template)=>injectCss(template, entryName, styledComponentsStyleTags)
|
|
47
|
+
];
|
|
48
|
+
return (0, external_shared_js_namespaceObject.buildHtml)(beforeAppTemplate, callbacks);
|
|
49
|
+
async function injectCss(template, entryName, styledComponentsStyleTags) {
|
|
50
|
+
let css = await getCssChunks();
|
|
51
|
+
if (styledComponentsStyleTags) css += styledComponentsStyleTags;
|
|
52
|
+
css += (0, external_federatedCss_js_namespaceObject.createFederatedCssLinks)(moduleFederationCssAssets, {
|
|
53
|
+
template,
|
|
54
|
+
existingAssets: css.match(/href="([^"]+)"/g)?.map((item)=>item.replace(/^href="/, '').replace(/"$/, ''))
|
|
55
|
+
});
|
|
56
|
+
return (0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject.CHUNK_CSS_PLACEHOLDER, css);
|
|
57
|
+
async function getCssChunks() {
|
|
58
|
+
const { routeManifest, routerContext, routes } = runtimeContext;
|
|
59
|
+
if (!routeManifest) return '';
|
|
60
|
+
const { routeAssets } = routeManifest;
|
|
61
|
+
let matchedRouteManifests = [];
|
|
62
|
+
const matchedRouteIds = (0, lifecycle_js_namespaceObject.getRouterMatchedRouteIds)(runtimeContext);
|
|
63
|
+
if (matchedRouteIds?.length) matchedRouteManifests = matchedRouteIds.map((routeId)=>routeAssets[routeId]).filter(Boolean);
|
|
64
|
+
else if (routerContext && routes) {
|
|
65
|
+
const matches = (0, router_namespaceObject.matchRoutes)(routes, routerContext.location, routerContext.basename);
|
|
66
|
+
matchedRouteManifests = matches?.map((match, index)=>{
|
|
67
|
+
if (!index) return;
|
|
68
|
+
const routeId = match.route.id;
|
|
69
|
+
if (routeId) return routeAssets[routeId];
|
|
70
|
+
}).filter(Boolean) ?? [];
|
|
71
|
+
}
|
|
72
|
+
const asyncEntry = routeAssets[`async-${entryName}`];
|
|
73
|
+
if (asyncEntry) matchedRouteManifests.push(asyncEntry);
|
|
74
|
+
const cssChunks = matchedRouteManifests.reduce((chunks, routeManifest)=>{
|
|
75
|
+
const { referenceCssAssets = [] } = routeManifest;
|
|
76
|
+
const _cssChunks = referenceCssAssets.filter((asset)=>asset?.endsWith('.css') && !template.includes(asset));
|
|
77
|
+
return [
|
|
78
|
+
...chunks,
|
|
79
|
+
..._cssChunks
|
|
80
|
+
];
|
|
81
|
+
}, []);
|
|
82
|
+
const { inlineStyles } = config;
|
|
83
|
+
const styles = cssChunks.map((chunk)=>{
|
|
84
|
+
const link = `<link href="${chunk}" rel="stylesheet" />`;
|
|
85
|
+
checkIsInline(chunk, inlineStyles);
|
|
86
|
+
return link;
|
|
87
|
+
});
|
|
88
|
+
return `${styles.join('')}`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.buildShellBeforeTemplate = __webpack_exports__.buildShellBeforeTemplate;
|
|
93
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
94
|
+
"buildShellBeforeTemplate"
|
|
95
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
96
|
+
Object.defineProperty(exports, '__esModule', {
|
|
97
|
+
value: true
|
|
98
|
+
});
|
|
@@ -43,7 +43,7 @@ const defaultExtender = {
|
|
|
43
43
|
};
|
|
44
44
|
const createReadableStreamFromElement = async (request, rootElement, options)=>{
|
|
45
45
|
const { renderToPipeableStream } = await import("react-dom/server");
|
|
46
|
-
const { runtimeContext, htmlTemplate, config, ssrConfig, entryName } = options;
|
|
46
|
+
const { runtimeContext, htmlTemplate, config, ssrConfig, entryName, moduleFederationCssAssets } = options;
|
|
47
47
|
let shellChunkStatus = external_shared_js_namespaceObject.ShellChunkStatus.START;
|
|
48
48
|
let renderLevel = external_constants_js_namespaceObject.RenderLevel.SERVER_RENDER;
|
|
49
49
|
const forceStream2String = Boolean(process.env.MODERN_JS_STREAM_TO_STRING);
|
|
@@ -63,11 +63,14 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
|
|
|
63
63
|
if (extender.modifyRootElement) processedRootElement = extender.modifyRootElement(processedRootElement);
|
|
64
64
|
});
|
|
65
65
|
const chunkVec = [];
|
|
66
|
+
let hasStartedPipe = false;
|
|
66
67
|
return new Promise((resolve)=>{
|
|
67
68
|
const { pipe: reactStreamingPipe } = renderToPipeableStream(processedRootElement, {
|
|
68
69
|
nonce: config.nonce,
|
|
69
70
|
identifierPrefix: constants_namespaceObject.SSR_HYDRATION_ID_PREFIX,
|
|
70
71
|
[onReady] () {
|
|
72
|
+
if (hasStartedPipe) return;
|
|
73
|
+
hasStartedPipe = true;
|
|
71
74
|
let styledComponentsStyleTags = '';
|
|
72
75
|
extenders.forEach((extender)=>{
|
|
73
76
|
if (extender.getStyleTags) styledComponentsStyleTags += extender.getStyleTags();
|
|
@@ -80,6 +83,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
|
|
|
80
83
|
runtimeContext,
|
|
81
84
|
config,
|
|
82
85
|
entryName,
|
|
86
|
+
moduleFederationCssAssets,
|
|
83
87
|
styledComponentsStyleTags
|
|
84
88
|
}).then(({ shellAfter, shellBefore })=>{
|
|
85
89
|
const pendingScripts = [];
|
|
@@ -137,7 +141,8 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
|
|
|
137
141
|
renderLevel,
|
|
138
142
|
runtimeContext,
|
|
139
143
|
entryName,
|
|
140
|
-
config
|
|
144
|
+
config,
|
|
145
|
+
moduleFederationCssAssets
|
|
141
146
|
}).then(({ shellAfter, shellBefore })=>{
|
|
142
147
|
const fallbackHtml = `${shellBefore}${shellAfter}`;
|
|
143
148
|
const readableStream = (0, external_shared_js_namespaceObject.getReadableStreamFromString)(fallbackHtml);
|
|
@@ -36,19 +36,21 @@ const external_template_js_namespaceObject = require("./template.js");
|
|
|
36
36
|
const createReadableStreamFromElement = async (request, rootElement, options)=>{
|
|
37
37
|
let shellChunkStatus = external_shared_js_namespaceObject.ShellChunkStatus.START;
|
|
38
38
|
const chunkVec = [];
|
|
39
|
-
const { htmlTemplate, runtimeContext, config, ssrConfig, entryName, rscRoot } = options;
|
|
39
|
+
const { htmlTemplate, runtimeContext, config, ssrConfig, entryName, moduleFederationCssAssets, rscManifest, rscRoot } = options;
|
|
40
40
|
const { shellBefore, shellAfter } = await (0, external_template_js_namespaceObject.getTemplates)(htmlTemplate, {
|
|
41
41
|
renderLevel: external_constants_js_namespaceObject.RenderLevel.SERVER_RENDER,
|
|
42
42
|
runtimeContext,
|
|
43
43
|
ssrConfig,
|
|
44
44
|
request,
|
|
45
45
|
config,
|
|
46
|
-
entryName
|
|
46
|
+
entryName,
|
|
47
|
+
moduleFederationCssAssets
|
|
47
48
|
});
|
|
48
49
|
try {
|
|
49
50
|
const readableOriginal = await (0, ssr_namespaceObject.renderSSRStream)(rootElement, {
|
|
50
51
|
request,
|
|
51
52
|
nonce: config.nonce,
|
|
53
|
+
rscManifest,
|
|
52
54
|
rscRoot: rscRoot,
|
|
53
55
|
routes: runtimeContext.routes,
|
|
54
56
|
onError (error) {
|
|
@@ -95,7 +95,7 @@ function createRenderStreaming(createReadableStreamPromise) {
|
|
|
95
95
|
const end = (0, time_namespaceObject.time)();
|
|
96
96
|
const { runtimeContext, config, resource } = options;
|
|
97
97
|
const { onError, onTiming } = options;
|
|
98
|
-
const { htmlTemplate, entryName } = resource;
|
|
98
|
+
const { htmlTemplate, entryName, moduleFederationCssAssets } = resource;
|
|
99
99
|
const ssrConfig = (0, external_utils_js_namespaceObject.getSSRConfigByEntry)(entryName, config.ssr, config.ssrByEntries);
|
|
100
100
|
const StreamServerRootWrapper = ({ children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
101
101
|
children: [
|
|
@@ -115,9 +115,11 @@ function createRenderStreaming(createReadableStreamPromise) {
|
|
|
115
115
|
runtimeContext,
|
|
116
116
|
ssrConfig,
|
|
117
117
|
entryName,
|
|
118
|
+
moduleFederationCssAssets,
|
|
118
119
|
rscClientManifest: options.rscClientManifest,
|
|
119
120
|
rscSSRManifest: options.rscSSRManifest,
|
|
120
121
|
rscServerManifest: options.rscServerManifest,
|
|
122
|
+
rscManifest: options.rscManifest,
|
|
121
123
|
rscRoot: options.rscRoot,
|
|
122
124
|
onShellReady () {
|
|
123
125
|
const cost = end();
|
|
@@ -39,13 +39,12 @@ const time_namespaceObject = require("@modern-js/runtime-utils/time");
|
|
|
39
39
|
const constants_namespaceObject = require("@modern-js/utils/universal/constants");
|
|
40
40
|
const server_namespaceObject = require("react-dom/server");
|
|
41
41
|
var server_default = /*#__PURE__*/ __webpack_require__.n(server_namespaceObject);
|
|
42
|
-
const external_react_helmet_namespaceObject = require("react-helmet");
|
|
43
|
-
var external_react_helmet_default = /*#__PURE__*/ __webpack_require__.n(external_react_helmet_namespaceObject);
|
|
44
42
|
const external_constants_js_namespaceObject = require("../../constants.js");
|
|
45
43
|
const index_js_namespaceObject = require("../../context/index.js");
|
|
46
44
|
const wrapper_js_namespaceObject = require("../../react/wrapper.js");
|
|
47
45
|
const external_constants_js_namespaceObject_1 = require("../constants.js");
|
|
48
46
|
const external_helmet_js_namespaceObject = require("../helmet.js");
|
|
47
|
+
const external_scriptOrder_js_namespaceObject = require("../scriptOrder.js");
|
|
49
48
|
const external_shared_js_namespaceObject = require("../shared.js");
|
|
50
49
|
const external_tracer_js_namespaceObject = require("../tracer.js");
|
|
51
50
|
const external_utils_js_namespaceObject = require("../utils.js");
|
|
@@ -58,7 +57,7 @@ const renderString = async (request, serverRoot, options)=>{
|
|
|
58
57
|
onTiming
|
|
59
58
|
};
|
|
60
59
|
const routerContext = runtimeContext.routerContext;
|
|
61
|
-
const { htmlTemplate, entryName, loadableStats, routeManifest } = resource;
|
|
60
|
+
const { htmlTemplate, entryName, loadableStats, routeManifest, moduleFederationCssAssets } = resource;
|
|
62
61
|
const ssrConfig = (0, external_utils_js_namespaceObject.getSSRConfigByEntry)(entryName, config.ssr, config.ssrByEntries);
|
|
63
62
|
const chunkSet = {
|
|
64
63
|
renderLevel: external_constants_js_namespaceObject.RenderLevel.CLIENT_RENDER,
|
|
@@ -71,8 +70,10 @@ const renderString = async (request, serverRoot, options)=>{
|
|
|
71
70
|
stats: loadableStats,
|
|
72
71
|
nonce: config.nonce,
|
|
73
72
|
routeManifest,
|
|
73
|
+
runtimeContext,
|
|
74
74
|
template: htmlTemplate,
|
|
75
75
|
entryName,
|
|
76
|
+
moduleFederationCssAssets,
|
|
76
77
|
chunkSet,
|
|
77
78
|
config
|
|
78
79
|
}),
|
|
@@ -96,10 +97,10 @@ const renderString = async (request, serverRoot, options)=>{
|
|
|
96
97
|
const rootElement = (0, wrapper_js_namespaceObject.wrapRuntimeContextProvider)(serverRoot, Object.assign(runtimeContext, {
|
|
97
98
|
ssr: true
|
|
98
99
|
}));
|
|
99
|
-
const html = await generateHtml(rootElement, htmlTemplate, chunkSet, collectors, runtimeContext.ssrContext?.htmlModifiers || [], tracer);
|
|
100
|
+
const html = await generateHtml(rootElement, htmlTemplate, chunkSet, collectors, runtimeContext.ssrContext?.htmlModifiers || [], runtimeContext, entryName, tracer);
|
|
100
101
|
return html;
|
|
101
102
|
};
|
|
102
|
-
async function generateHtml(App, htmlTemplate, chunkSet, collectors, htmlModifiers, { onError, onTiming }) {
|
|
103
|
+
async function generateHtml(App, htmlTemplate, chunkSet, collectors, htmlModifiers, runtimeContext, entryName, { onError, onTiming }) {
|
|
103
104
|
let html = '';
|
|
104
105
|
let helmetData;
|
|
105
106
|
const finalApp = collectors.reduce((pre, creator)=>creator.collect?.(pre) || pre, App);
|
|
@@ -109,7 +110,7 @@ async function generateHtml(App, htmlTemplate, chunkSet, collectors, htmlModifie
|
|
|
109
110
|
identifierPrefix: constants_namespaceObject.SSR_HYDRATION_ID_PREFIX
|
|
110
111
|
});
|
|
111
112
|
chunkSet.renderLevel = external_constants_js_namespaceObject.RenderLevel.SERVER_RENDER;
|
|
112
|
-
helmetData =
|
|
113
|
+
helmetData = (0, external_helmet_js_namespaceObject.getHelmetData)(runtimeContext);
|
|
113
114
|
const cost = end();
|
|
114
115
|
onTiming(external_tracer_js_namespaceObject.SSRTimings.RENDER_HTML, cost);
|
|
115
116
|
} catch (e) {
|
|
@@ -120,7 +121,7 @@ async function generateHtml(App, htmlTemplate, chunkSet, collectors, htmlModifie
|
|
|
120
121
|
const { ssrScripts, cssChunk, jsChunk } = chunkSet;
|
|
121
122
|
const finalHtml = await (0, external_shared_js_namespaceObject.buildHtml)(htmlTemplate, [
|
|
122
123
|
createReplaceHtml(html),
|
|
123
|
-
createReplaceChunkJs(jsChunk),
|
|
124
|
+
createReplaceChunkJs(jsChunk, entryName),
|
|
124
125
|
createReplaceChunkCss(cssChunk),
|
|
125
126
|
createReplaceSSRDataScript(ssrScripts),
|
|
126
127
|
(0, external_helmet_js_namespaceObject.createReplaceHelemt)(helmetData),
|
|
@@ -134,8 +135,14 @@ function createReplaceHtml(html) {
|
|
|
134
135
|
function createReplaceSSRDataScript(data) {
|
|
135
136
|
return (template)=>(0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject_1.SSR_DATA_PLACEHOLDER, data);
|
|
136
137
|
}
|
|
137
|
-
function createReplaceChunkJs(js) {
|
|
138
|
-
return (template)=>
|
|
138
|
+
function createReplaceChunkJs(js, entryName) {
|
|
139
|
+
return (template)=>{
|
|
140
|
+
if (!js) return (0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject_1.CHUNK_JS_PLACEHOLDER, '');
|
|
141
|
+
const withoutPlaceholder = (0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject_1.CHUNK_JS_PLACEHOLDER, '');
|
|
142
|
+
const withEarlyScripts = (0, external_scriptOrder_js_namespaceObject.injectBeforeHydrationEntryScript)(withoutPlaceholder, js, entryName);
|
|
143
|
+
if (withEarlyScripts !== withoutPlaceholder) return withEarlyScripts;
|
|
144
|
+
return (0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject_1.CHUNK_JS_PLACEHOLDER, js);
|
|
145
|
+
};
|
|
139
146
|
}
|
|
140
147
|
function createReplaceChunkCss(css) {
|
|
141
148
|
return (template)=>(0, external_utils_js_namespaceObject.safeReplace)(template, external_constants_js_namespaceObject_1.CHUNK_CSS_PLACEHOLDER, css);
|
|
@@ -24,15 +24,45 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
LoadableCollector: ()=>LoadableCollector
|
|
27
|
+
LoadableCollector: ()=>LoadableCollector,
|
|
28
|
+
orderHydrationScriptChunks: ()=>orderHydrationScriptChunks
|
|
28
29
|
});
|
|
29
30
|
const server_namespaceObject = require("@loadable/server");
|
|
31
|
+
const lifecycle_js_namespaceObject = require("../../../router/runtime/lifecycle.js");
|
|
32
|
+
const external_federatedCss_js_namespaceObject = require("../federatedCss.js");
|
|
30
33
|
const external_utils_js_namespaceObject = require("../utils.js");
|
|
31
34
|
const extname = (uri)=>{
|
|
32
35
|
if ('string' != typeof uri || !uri.includes('.')) return '';
|
|
33
36
|
return `.${uri?.split('.').pop()}` || '';
|
|
34
37
|
};
|
|
35
38
|
const generateChunks = (chunks, ext)=>chunks.filter((chunk)=>Boolean(chunk.url)).filter((chunk)=>extname(chunk.url).slice(1) === ext);
|
|
39
|
+
const dedupeChunksByUrl = (chunks)=>{
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
return chunks.filter((chunk)=>{
|
|
42
|
+
if (!chunk.url || seen.has(chunk.url)) return false;
|
|
43
|
+
seen.add(chunk.url);
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const isAsyncEntryScriptChunk = (chunk, entryName)=>{
|
|
48
|
+
if (!chunk.url?.endsWith('.js')) return false;
|
|
49
|
+
const asyncEntryName = `async-${entryName}`;
|
|
50
|
+
const filename = chunk.filename || chunk.url;
|
|
51
|
+
const basename = filename.split('/').pop() || filename;
|
|
52
|
+
return basename === `${asyncEntryName}.js` || basename.startsWith(`${asyncEntryName}.`) || basename.startsWith(`${asyncEntryName}-`);
|
|
53
|
+
};
|
|
54
|
+
const orderHydrationScriptChunks = ({ asyncEntryChunks, collectedChunks, matchedRouteChunks, entryName })=>{
|
|
55
|
+
const asyncEntryScriptChunks = [];
|
|
56
|
+
const asyncEntryDependencyChunks = [];
|
|
57
|
+
for (const chunk of asyncEntryChunks)if (isAsyncEntryScriptChunk(chunk, entryName)) asyncEntryScriptChunks.push(chunk);
|
|
58
|
+
else asyncEntryDependencyChunks.push(chunk);
|
|
59
|
+
return dedupeChunksByUrl([
|
|
60
|
+
...asyncEntryDependencyChunks,
|
|
61
|
+
...collectedChunks,
|
|
62
|
+
...matchedRouteChunks,
|
|
63
|
+
...asyncEntryScriptChunks
|
|
64
|
+
]);
|
|
65
|
+
};
|
|
36
66
|
const checkIsInline = (chunk, enableInline)=>{
|
|
37
67
|
if ('production' !== process.env.NODE_ENV) return false;
|
|
38
68
|
if (enableInline instanceof RegExp) return enableInline.test(chunk.url);
|
|
@@ -49,6 +79,20 @@ class LoadableCollector {
|
|
|
49
79
|
const { routeManifest, entryName } = this.options;
|
|
50
80
|
return routeManifest?.routeAssets?.[entryName]?.assets;
|
|
51
81
|
}
|
|
82
|
+
getMatchedRouteChunks() {
|
|
83
|
+
const { routeManifest, runtimeContext } = this.options;
|
|
84
|
+
const routeAssets = routeManifest?.routeAssets;
|
|
85
|
+
if (!routeAssets) return [];
|
|
86
|
+
const matchedRouteIds = (0, lifecycle_js_namespaceObject.getRouterMatchedRouteIds)(runtimeContext) ?? [];
|
|
87
|
+
return matchedRouteIds.flatMap((routeId)=>{
|
|
88
|
+
const routeAsset = routeAssets[routeId];
|
|
89
|
+
return (routeAsset?.assets ?? []).map((asset)=>({
|
|
90
|
+
filename: asset.replace(/^\//, ''),
|
|
91
|
+
path: asset,
|
|
92
|
+
url: asset
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
52
96
|
collect(comopnent) {
|
|
53
97
|
const { stats, entryName } = this.options;
|
|
54
98
|
if (!stats) return comopnent;
|
|
@@ -61,20 +105,29 @@ class LoadableCollector {
|
|
|
61
105
|
return this.extractor.collectChunks(comopnent);
|
|
62
106
|
}
|
|
63
107
|
async effect() {
|
|
64
|
-
if (!this.extractor) return;
|
|
65
108
|
const { extractor, options } = this;
|
|
66
109
|
const { entryName, config } = options;
|
|
67
110
|
const asyncChunks = [];
|
|
68
|
-
if (config.enableAsyncEntry) try {
|
|
111
|
+
if (extractor && config.enableAsyncEntry) try {
|
|
69
112
|
asyncChunks.push(...extractor.getChunkAssets([
|
|
70
113
|
`async-${entryName}`
|
|
71
114
|
]));
|
|
72
115
|
} catch (e) {}
|
|
73
|
-
const
|
|
74
|
-
const
|
|
116
|
+
const collectedChunks = extractor ? extractor.getChunkAssets(extractor.chunks) : [];
|
|
117
|
+
const matchedRouteChunks = this.getMatchedRouteChunks();
|
|
118
|
+
const orderedScriptChunks = orderHydrationScriptChunks({
|
|
119
|
+
asyncEntryChunks: asyncChunks,
|
|
120
|
+
collectedChunks,
|
|
121
|
+
matchedRouteChunks,
|
|
122
|
+
entryName
|
|
123
|
+
});
|
|
124
|
+
const chunks = [].concat(asyncChunks).concat(collectedChunks).concat(matchedRouteChunks);
|
|
125
|
+
const scriptChunks = generateChunks(orderedScriptChunks, 'js');
|
|
75
126
|
const styleChunks = generateChunks(chunks, 'css');
|
|
76
|
-
|
|
77
|
-
|
|
127
|
+
if (extractor) {
|
|
128
|
+
this.emitLoadableScripts(extractor);
|
|
129
|
+
await this.emitScriptAssets(scriptChunks);
|
|
130
|
+
}
|
|
78
131
|
await this.emitStyleAssets(styleChunks);
|
|
79
132
|
}
|
|
80
133
|
emitLoadableScripts(extractor) {
|
|
@@ -109,19 +162,28 @@ class LoadableCollector {
|
|
|
109
162
|
chunkSet.jsChunk += scripts.filter((script)=>Boolean(script)).join('');
|
|
110
163
|
}
|
|
111
164
|
async emitStyleAssets(chunks) {
|
|
112
|
-
const { template, chunkSet, config,
|
|
165
|
+
const { template, chunkSet, config, moduleFederationCssAssets } = this.options;
|
|
113
166
|
const { inlineStyles } = config;
|
|
114
167
|
const atrributes = (0, external_utils_js_namespaceObject.attributesToString)(this.generateAttributes());
|
|
115
168
|
const linkRegExp = /<link .*?href="([^"]+)".*?>/g;
|
|
116
169
|
const matchs = template.matchAll(linkRegExp);
|
|
117
170
|
const existedLinks = [];
|
|
118
171
|
for (const match of matchs)existedLinks.push(match[1]);
|
|
119
|
-
const
|
|
172
|
+
const emittedChunks = chunks.filter((chunk)=>!existedLinks.includes(chunk.url) && !this.existsAssets?.includes(chunk.path));
|
|
173
|
+
const css = await Promise.all(emittedChunks.map(async (chunk)=>{
|
|
120
174
|
const link = `<link${atrributes} href="${chunk.url}" rel="stylesheet" />`;
|
|
121
175
|
if ((0, external_utils_js_namespaceObject.checkIsNode)() && checkIsInline(chunk, inlineStyles)) return readAsset(chunk).then((content)=>`<style>${content}</style>`).catch((_)=>link);
|
|
122
176
|
return link;
|
|
123
177
|
}));
|
|
124
178
|
chunkSet.cssChunk += css.filter((css)=>Boolean(css)).join('');
|
|
179
|
+
chunkSet.cssChunk += (0, external_federatedCss_js_namespaceObject.createFederatedCssLinks)(moduleFederationCssAssets, {
|
|
180
|
+
template,
|
|
181
|
+
attributes: this.generateAttributes(),
|
|
182
|
+
existingAssets: [
|
|
183
|
+
...existedLinks,
|
|
184
|
+
...emittedChunks.map((chunk)=>chunk.url)
|
|
185
|
+
]
|
|
186
|
+
});
|
|
125
187
|
}
|
|
126
188
|
generateAttributes(extraAtr = {}) {
|
|
127
189
|
const { config } = this.options;
|
|
@@ -138,8 +200,10 @@ class LoadableCollector {
|
|
|
138
200
|
}
|
|
139
201
|
}
|
|
140
202
|
exports.LoadableCollector = __webpack_exports__.LoadableCollector;
|
|
203
|
+
exports.orderHydrationScriptChunks = __webpack_exports__.orderHydrationScriptChunks;
|
|
141
204
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
142
|
-
"LoadableCollector"
|
|
205
|
+
"LoadableCollector",
|
|
206
|
+
"orderHydrationScriptChunks"
|
|
143
207
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
144
208
|
Object.defineProperty(exports, '__esModule', {
|
|
145
209
|
value: true
|
package/dist/cjs/exports/head.js
CHANGED
|
@@ -34,16 +34,207 @@ var __webpack_require__ = {};
|
|
|
34
34
|
var __webpack_exports__ = {};
|
|
35
35
|
__webpack_require__.r(__webpack_exports__);
|
|
36
36
|
__webpack_require__.d(__webpack_exports__, {
|
|
37
|
-
Helmet: ()=>
|
|
38
|
-
|
|
37
|
+
Helmet: ()=>Helmet,
|
|
38
|
+
HelmetData: ()=>external_react_helmet_async_namespaceObject.HelmetData,
|
|
39
|
+
HelmetProvider: ()=>external_react_helmet_async_namespaceObject.HelmetProvider,
|
|
40
|
+
default: ()=>exports_head
|
|
39
41
|
});
|
|
40
|
-
const
|
|
41
|
-
var
|
|
42
|
-
const
|
|
42
|
+
const external_react_namespaceObject = require("react");
|
|
43
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
44
|
+
const external_react_helmet_async_namespaceObject = require("react-helmet-async");
|
|
45
|
+
const index_js_namespaceObject = require("../core/context/index.js");
|
|
46
|
+
const ATTRIBUTE_NAME_MAP = {
|
|
47
|
+
charSet: 'charset',
|
|
48
|
+
className: 'class',
|
|
49
|
+
contentEditable: 'contenteditable',
|
|
50
|
+
httpEquiv: 'http-equiv',
|
|
51
|
+
itemProp: 'itemprop',
|
|
52
|
+
tabIndex: 'tabindex'
|
|
53
|
+
};
|
|
54
|
+
const escapeHtml = (value)=>String(value).replaceAll('&', '&').replaceAll('"', '"').replaceAll('<', '<').replaceAll('>', '>');
|
|
55
|
+
const toHtmlAttributeName = (name)=>ATTRIBUTE_NAME_MAP[name] ?? name;
|
|
56
|
+
const attributesToString = (attributes, includeHelmetAttribute = false)=>{
|
|
57
|
+
const pairs = [];
|
|
58
|
+
if (includeHelmetAttribute) pairs.push('data-rh="true"');
|
|
59
|
+
for (const [name, value] of Object.entries(attributes ?? {})){
|
|
60
|
+
if (false === value || null == value) continue;
|
|
61
|
+
const htmlName = toHtmlAttributeName(name);
|
|
62
|
+
if (true === value) pairs.push(htmlName);
|
|
63
|
+
else pairs.push(`${htmlName}="${escapeHtml(value)}"`);
|
|
64
|
+
}
|
|
65
|
+
return pairs.join(' ');
|
|
66
|
+
};
|
|
67
|
+
const createDatum = (tagName, tags)=>({
|
|
68
|
+
toComponent: ()=>[],
|
|
69
|
+
toString: ()=>tags.map((tag)=>{
|
|
70
|
+
const attrs = attributesToString(tag, true);
|
|
71
|
+
if ("script" === tagName && 'string' == typeof tag.innerHTML) return `<script ${attrs}>${tag.innerHTML}</script>`;
|
|
72
|
+
if ('style' === tagName && 'string' == typeof tag.cssText) return `<style ${attrs}>${tag.cssText}</style>`;
|
|
73
|
+
if ("noscript" === tagName && 'string' == typeof tag.innerHTML) return `<noscript ${attrs}>${tag.innerHTML}</noscript>`;
|
|
74
|
+
return `<${tagName} ${attrs}>`;
|
|
75
|
+
}).join('')
|
|
76
|
+
});
|
|
77
|
+
const createAttributeDatum = (attributes)=>({
|
|
78
|
+
toComponent: ()=>attributes,
|
|
79
|
+
toString: ()=>attributesToString(attributes)
|
|
80
|
+
});
|
|
81
|
+
const createTitleDatum = (title, attributes)=>({
|
|
82
|
+
toComponent: ()=>[],
|
|
83
|
+
toString: ()=>{
|
|
84
|
+
if (!title) return '';
|
|
85
|
+
const attrs = attributesToString(attributes, true);
|
|
86
|
+
return `<title ${attrs}>${escapeHtml(title)}</title>`;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const createEmptyHelmetState = ()=>({
|
|
90
|
+
base: createDatum('base', []),
|
|
91
|
+
bodyAttributes: createAttributeDatum({}),
|
|
92
|
+
htmlAttributes: createAttributeDatum({}),
|
|
93
|
+
link: createDatum('link', []),
|
|
94
|
+
meta: createDatum('meta', []),
|
|
95
|
+
noscript: createDatum("noscript", []),
|
|
96
|
+
priority: createDatum('meta', []),
|
|
97
|
+
script: createDatum("script", []),
|
|
98
|
+
style: createDatum('style', []),
|
|
99
|
+
title: createTitleDatum(void 0, {})
|
|
100
|
+
});
|
|
101
|
+
const mergeAttributes = (current, next)=>({
|
|
102
|
+
...current,
|
|
103
|
+
...next ?? {}
|
|
104
|
+
});
|
|
105
|
+
const collectChildren = (children, draft)=>{
|
|
106
|
+
external_react_default().Children.forEach(children, (child)=>{
|
|
107
|
+
if (!external_react_default().isValidElement(child)) return;
|
|
108
|
+
if (child.type === external_react_default().Fragment) return void collectChildren(child.props.children, draft);
|
|
109
|
+
if ('string' != typeof child.type) return;
|
|
110
|
+
const { children: nestedChildren, ...props } = child.props;
|
|
111
|
+
if ('title' === child.type) {
|
|
112
|
+
draft.title = external_react_default().Children.toArray(nestedChildren).join('');
|
|
113
|
+
draft.titleAttributes = mergeAttributes(draft.titleAttributes, props);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if ('html' === child.type || 'body' === child.type) return;
|
|
117
|
+
if ('base' === child.type || 'link' === child.type || 'meta' === child.type || "noscript" === child.type || "script" === child.type || 'style' === child.type) {
|
|
118
|
+
const tag = {
|
|
119
|
+
...props
|
|
120
|
+
};
|
|
121
|
+
if (("script" === child.type || 'style' === child.type || "noscript" === child.type) && 'string' == typeof nestedChildren) tag['style' === child.type ? 'cssText' : 'innerHTML'] = nestedChildren;
|
|
122
|
+
draft[child.type].push(tag);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const collectHelmetProps = (current, props)=>{
|
|
127
|
+
const baseState = current ?? createEmptyHelmetState();
|
|
128
|
+
const draft = {
|
|
129
|
+
base: [
|
|
130
|
+
...props.base ? [
|
|
131
|
+
props.base
|
|
132
|
+
] : []
|
|
133
|
+
],
|
|
134
|
+
bodyAttributes: props.bodyAttributes,
|
|
135
|
+
htmlAttributes: props.htmlAttributes,
|
|
136
|
+
link: [
|
|
137
|
+
...props.link ?? []
|
|
138
|
+
],
|
|
139
|
+
meta: [
|
|
140
|
+
...props.meta ?? []
|
|
141
|
+
],
|
|
142
|
+
noscript: [
|
|
143
|
+
...props.noscript ?? []
|
|
144
|
+
],
|
|
145
|
+
script: [
|
|
146
|
+
...props.script ?? []
|
|
147
|
+
],
|
|
148
|
+
style: [
|
|
149
|
+
...props.style ?? []
|
|
150
|
+
],
|
|
151
|
+
title: 'string' == typeof props.title ? props.title : Array.isArray(props.title) ? props.title.join('') : void 0,
|
|
152
|
+
titleAttributes: props.titleAttributes ?? {}
|
|
153
|
+
};
|
|
154
|
+
collectChildren(props.children, draft);
|
|
155
|
+
const title = draft.title && props.titleTemplate ? props.titleTemplate.replaceAll('%s', draft.title) : draft.title ?? props.defaultTitle;
|
|
156
|
+
return {
|
|
157
|
+
base: createDatum('base', [
|
|
158
|
+
...baseState.__baseTags ?? [],
|
|
159
|
+
...draft.base
|
|
160
|
+
]),
|
|
161
|
+
bodyAttributes: createAttributeDatum(mergeAttributes(baseState.__bodyAttributes ?? {}, draft.bodyAttributes)),
|
|
162
|
+
htmlAttributes: createAttributeDatum(mergeAttributes(baseState.__htmlAttributes ?? {}, draft.htmlAttributes)),
|
|
163
|
+
link: createDatum('link', [
|
|
164
|
+
...baseState.__linkTags ?? [],
|
|
165
|
+
...draft.link
|
|
166
|
+
]),
|
|
167
|
+
meta: createDatum('meta', [
|
|
168
|
+
...baseState.__metaTags ?? [],
|
|
169
|
+
...draft.meta
|
|
170
|
+
]),
|
|
171
|
+
noscript: createDatum("noscript", [
|
|
172
|
+
...baseState.__noscriptTags ?? [],
|
|
173
|
+
...draft.noscript
|
|
174
|
+
]),
|
|
175
|
+
priority: createDatum('meta', []),
|
|
176
|
+
script: createDatum("script", [
|
|
177
|
+
...baseState.__scriptTags ?? [],
|
|
178
|
+
...draft.script
|
|
179
|
+
]),
|
|
180
|
+
style: createDatum('style', [
|
|
181
|
+
...baseState.__styleTags ?? [],
|
|
182
|
+
...draft.style
|
|
183
|
+
]),
|
|
184
|
+
title: createTitleDatum(title ?? baseState.__title, mergeAttributes(baseState.__titleAttributes ?? {}, draft.titleAttributes)),
|
|
185
|
+
__baseTags: [
|
|
186
|
+
...baseState.__baseTags ?? [],
|
|
187
|
+
...draft.base
|
|
188
|
+
],
|
|
189
|
+
__bodyAttributes: mergeAttributes(baseState.__bodyAttributes ?? {}, draft.bodyAttributes),
|
|
190
|
+
__htmlAttributes: mergeAttributes(baseState.__htmlAttributes ?? {}, draft.htmlAttributes),
|
|
191
|
+
__linkTags: [
|
|
192
|
+
...baseState.__linkTags ?? [],
|
|
193
|
+
...draft.link
|
|
194
|
+
],
|
|
195
|
+
__metaTags: [
|
|
196
|
+
...baseState.__metaTags ?? [],
|
|
197
|
+
...draft.meta
|
|
198
|
+
],
|
|
199
|
+
__noscriptTags: [
|
|
200
|
+
...baseState.__noscriptTags ?? [],
|
|
201
|
+
...draft.noscript
|
|
202
|
+
],
|
|
203
|
+
__scriptTags: [
|
|
204
|
+
...baseState.__scriptTags ?? [],
|
|
205
|
+
...draft.script
|
|
206
|
+
],
|
|
207
|
+
__styleTags: [
|
|
208
|
+
...baseState.__styleTags ?? [],
|
|
209
|
+
...draft.style
|
|
210
|
+
],
|
|
211
|
+
__title: title ?? baseState.__title,
|
|
212
|
+
__titleAttributes: mergeAttributes(baseState.__titleAttributes ?? {}, draft.titleAttributes)
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
const Helmet = (props)=>{
|
|
216
|
+
const runtimeContext = external_react_default().useContext(index_js_namespaceObject.InternalRuntimeContext);
|
|
217
|
+
if (runtimeContext && !runtimeContext.isBrowser) {
|
|
218
|
+
runtimeContext._helmetContext ??= {};
|
|
219
|
+
runtimeContext._helmetContext.helmet = collectHelmetProps(runtimeContext._helmetContext.helmet ?? void 0, props);
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
return external_react_default().createElement(external_react_helmet_async_namespaceObject.Helmet, props);
|
|
223
|
+
};
|
|
224
|
+
const head = {
|
|
225
|
+
Helmet,
|
|
226
|
+
HelmetData: external_react_helmet_async_namespaceObject.HelmetData,
|
|
227
|
+
HelmetProvider: external_react_helmet_async_namespaceObject.HelmetProvider
|
|
228
|
+
};
|
|
229
|
+
const exports_head = head;
|
|
43
230
|
exports.Helmet = __webpack_exports__.Helmet;
|
|
231
|
+
exports.HelmetData = __webpack_exports__.HelmetData;
|
|
232
|
+
exports.HelmetProvider = __webpack_exports__.HelmetProvider;
|
|
44
233
|
exports["default"] = __webpack_exports__["default"];
|
|
45
234
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
46
235
|
"Helmet",
|
|
236
|
+
"HelmetData",
|
|
237
|
+
"HelmetProvider",
|
|
47
238
|
"default"
|
|
48
239
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
240
|
Object.defineProperty(exports, '__esModule', {
|