@modern-js/runtime 2.5.0 → 2.6.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/CHANGELOG.md +27 -0
- package/dist/cjs/cli/index.js +9 -0
- package/dist/cjs/core/app-config.js +5 -1
- package/dist/cjs/core/compatible.js +8 -7
- package/dist/cjs/core/loader/index.js +4 -0
- package/dist/cjs/core/loader/loaderManager.js +6 -0
- package/dist/cjs/core/loader/useLoader.js +4 -0
- package/dist/cjs/document/Body.js +6 -8
- package/dist/cjs/document/DocumentContext.js +4 -0
- package/dist/cjs/document/DocumentStructureContext.js +4 -0
- package/dist/cjs/document/Head.js +7 -11
- package/dist/cjs/document/Html.js +24 -22
- package/dist/cjs/document/Links.js +1 -3
- package/dist/cjs/document/Root.js +8 -14
- package/dist/cjs/document/Script.js +5 -7
- package/dist/cjs/document/Scripts.js +1 -3
- package/dist/cjs/document/cli/index.js +8 -2
- package/dist/cjs/exports/head.js +4 -0
- package/dist/cjs/exports/loadable.js +4 -0
- package/dist/cjs/exports/styled.js +4 -0
- package/dist/cjs/router/cli/index.js +3 -7
- package/dist/cjs/router/index.js +4 -0
- package/dist/cjs/router/runtime/DefaultNotFound.js +13 -10
- package/dist/cjs/router/runtime/plugin.js +5 -6
- package/dist/cjs/router/runtime/plugin.node.js +16 -9
- package/dist/cjs/router/runtime/utils.js +15 -36
- package/dist/cjs/router/runtime/withRouter.js +9 -6
- package/dist/cjs/ssr/cli/babel-plugin-ssr-loader-id.js +4 -0
- package/dist/cjs/ssr/cli/index.js +4 -0
- package/dist/cjs/ssr/index.js +10 -24
- package/dist/cjs/ssr/index.node.js +4 -0
- package/dist/cjs/ssr/prefetch.js +3 -6
- package/dist/cjs/ssr/react/nossr/index.js +4 -0
- package/dist/cjs/ssr/react/prerender/index.js +4 -0
- package/dist/cjs/ssr/serverRender/renderToStream/buildTemplate.after.js +10 -4
- package/dist/cjs/ssr/serverRender/renderToStream/bulidTemplate.before.js +5 -0
- package/dist/cjs/ssr/serverRender/renderToStream/index.js +4 -0
- package/dist/cjs/ssr/serverRender/renderToString/entry.js +10 -4
- package/dist/cjs/ssr/serverRender/renderToString/index.js +4 -0
- package/dist/cjs/ssr/serverRender/renderToString/loadable.js +1 -1
- package/dist/cjs/ssr/serverRender/time.worker.js +1 -1
- package/dist/cjs/ssr/serverRender/utils.js +1 -1
- package/dist/cjs/ssr/utils.js +16 -4
- package/dist/cjs/state/index.js +4 -0
- package/dist/cjs/state/plugins.js +4 -0
- package/dist/cjs/state/runtime/index.js +4 -0
- package/dist/cjs/state/runtime/plugin.js +5 -7
- package/dist/esm/cli/index.js +5 -1
- package/dist/esm/core/app-config.js +3 -1
- package/dist/esm/core/compatible.js +3 -1
- package/dist/esm/core/loader/loaderManager.js +3 -1
- package/dist/esm/document/cli/index.js +4 -2
- package/dist/esm/router/cli/index.js +1 -5
- package/dist/esm/ssr/prefetch.js +1 -0
- package/dist/esm/ssr/serverRender/renderToStream/buildTemplate.after.js +35 -6
- package/dist/esm/ssr/serverRender/renderToStream/bulidTemplate.before.js +1 -0
- package/dist/esm/ssr/serverRender/renderToString/entry.js +22 -6
- package/dist/esm/ssr/serverRender/time.worker.js +1 -1
- package/dist/esm/ssr/utils.js +6 -4
- package/dist/esm-node/cli/index.js +5 -0
- package/dist/esm-node/core/app-config.js +5 -1
- package/dist/esm-node/core/compatible.js +4 -7
- package/dist/esm-node/core/loader/loaderManager.js +2 -0
- package/dist/esm-node/document/Body.js +6 -8
- package/dist/esm-node/document/Head.js +7 -11
- package/dist/esm-node/document/Html.js +24 -22
- package/dist/esm-node/document/Links.js +1 -3
- package/dist/esm-node/document/Root.js +8 -14
- package/dist/esm-node/document/Script.js +5 -7
- package/dist/esm-node/document/Scripts.js +1 -3
- package/dist/esm-node/document/cli/index.js +4 -2
- package/dist/esm-node/router/cli/index.js +2 -5
- package/dist/esm-node/router/runtime/DefaultNotFound.js +13 -10
- package/dist/esm-node/router/runtime/plugin.js +1 -6
- package/dist/esm-node/router/runtime/plugin.node.js +12 -9
- package/dist/esm-node/router/runtime/utils.js +15 -36
- package/dist/esm-node/router/runtime/withRouter.js +9 -6
- package/dist/esm-node/ssr/index.js +6 -24
- package/dist/esm-node/ssr/prefetch.js +3 -6
- package/dist/esm-node/ssr/serverRender/renderToStream/buildTemplate.after.js +6 -4
- package/dist/esm-node/ssr/serverRender/renderToStream/bulidTemplate.before.js +1 -0
- package/dist/esm-node/ssr/serverRender/renderToString/entry.js +6 -4
- package/dist/esm-node/ssr/serverRender/renderToString/loadable.js +1 -1
- package/dist/esm-node/ssr/serverRender/time.worker.js +1 -1
- package/dist/esm-node/ssr/serverRender/utils.js +1 -1
- package/dist/esm-node/ssr/utils.js +6 -4
- package/dist/esm-node/state/runtime/plugin.js +1 -7
- package/dist/types/ssr/serverRender/renderToString/type.d.ts +1 -0
- package/package.json +11 -9
- package/dist/cjs/ssr/prefetch.worker.js +0 -67
- package/dist/cjs/ssr/serverRender/renderToStream/index.worker.js +0 -64
- package/dist/cjs/ssr/serverRender/renderToString/index.worker.js +0 -58
- package/dist/esm/ssr/prefetch.worker.js +0 -191
- package/dist/esm/ssr/serverRender/renderToStream/index.worker.js +0 -32
- package/dist/esm/ssr/serverRender/renderToString/index.worker.js +0 -167
- package/dist/esm-node/ssr/prefetch.worker.js +0 -46
- package/dist/esm-node/ssr/serverRender/renderToStream/index.worker.js +0 -35
- package/dist/esm-node/ssr/serverRender/renderToString/index.worker.js +0 -29
- package/dist/types/ssr/prefetch.worker.d.ts +0 -13
- package/dist/types/ssr/serverRender/renderToStream/index.worker.d.ts +0 -6
- package/dist/types/ssr/serverRender/renderToString/index.worker.d.ts +0 -6
|
@@ -53,22 +53,14 @@ const renderNestedRoute = (nestedRoute, parent) => {
|
|
|
53
53
|
if (parent == null ? void 0 : parent.loading) {
|
|
54
54
|
const Loading = parent.loading;
|
|
55
55
|
if (isLoadableComponent(Component)) {
|
|
56
|
-
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
57
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {})
|
|
58
|
-
});
|
|
56
|
+
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}) });
|
|
59
57
|
} else {
|
|
60
|
-
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, {
|
|
61
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}),
|
|
62
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {})
|
|
63
|
-
});
|
|
58
|
+
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) });
|
|
64
59
|
}
|
|
65
60
|
} else if (isLoadableComponent(Component) || isRoot) {
|
|
66
61
|
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {});
|
|
67
62
|
} else {
|
|
68
|
-
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, {
|
|
69
|
-
fallback: null,
|
|
70
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {})
|
|
71
|
-
});
|
|
63
|
+
element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) });
|
|
72
64
|
}
|
|
73
65
|
} else {
|
|
74
66
|
nestedRoute.loading = parent == null ? void 0 : parent.loading;
|
|
@@ -79,28 +71,16 @@ const renderNestedRoute = (nestedRoute, parent) => {
|
|
|
79
71
|
const childElements = children == null ? void 0 : children.map((childRoute) => {
|
|
80
72
|
return renderNestedRoute(childRoute, nestedRoute);
|
|
81
73
|
});
|
|
82
|
-
const routeElement = index ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, {
|
|
83
|
-
...routeProps,
|
|
84
|
-
index: true
|
|
85
|
-
}, id) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, {
|
|
86
|
-
...routeProps,
|
|
87
|
-
index: false,
|
|
88
|
-
children: childElements
|
|
89
|
-
}, id);
|
|
74
|
+
const routeElement = index ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, { ...routeProps, index: true }, id) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, { ...routeProps, index: false, children: childElements }, id);
|
|
90
75
|
return routeElement;
|
|
91
76
|
};
|
|
92
77
|
function getRouteComponents(routes, globalApp) {
|
|
93
78
|
const Layout = ({ Component, ...props }) => {
|
|
94
79
|
const GlobalLayout = globalApp;
|
|
95
80
|
if (!GlobalLayout) {
|
|
96
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
97
|
-
...props
|
|
98
|
-
});
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...props });
|
|
99
82
|
}
|
|
100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GlobalLayout, {
|
|
101
|
-
Component,
|
|
102
|
-
...props
|
|
103
|
-
});
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GlobalLayout, { Component, ...props });
|
|
104
84
|
};
|
|
105
85
|
const routeElements = [];
|
|
106
86
|
for (const route of routes) {
|
|
@@ -108,19 +88,18 @@ function getRouteComponents(routes, globalApp) {
|
|
|
108
88
|
const routeElement = renderNestedRoute(route);
|
|
109
89
|
routeElements.push(routeElement);
|
|
110
90
|
} else {
|
|
111
|
-
const routeElement = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
91
|
+
const routeElement = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_react_router_dom.Route,
|
|
93
|
+
{
|
|
94
|
+
path: route.path,
|
|
95
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Layout, { Component: route.component })
|
|
96
|
+
},
|
|
97
|
+
route.path
|
|
98
|
+
);
|
|
117
99
|
routeElements.push(routeElement);
|
|
118
100
|
}
|
|
119
101
|
}
|
|
120
|
-
routeElements.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, {
|
|
121
|
-
path: "*",
|
|
122
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultNotFound.DefaultNotFound, {})
|
|
123
|
-
}, "*"));
|
|
102
|
+
routeElements.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultNotFound.DefaultNotFound, {}) }, "*"));
|
|
124
103
|
return routeElements;
|
|
125
104
|
}
|
|
126
105
|
function renderRoutes(routesConfig) {
|
|
@@ -27,12 +27,15 @@ const withRouter = (Component) => {
|
|
|
27
27
|
const location = (0, import_react_router_dom.useLocation)();
|
|
28
28
|
const params = (0, import_react_router_dom.useParams)();
|
|
29
29
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
30
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
31
|
+
Component,
|
|
32
|
+
{
|
|
33
|
+
...props,
|
|
34
|
+
location,
|
|
35
|
+
params,
|
|
36
|
+
navigate
|
|
37
|
+
}
|
|
38
|
+
);
|
|
36
39
|
};
|
|
37
40
|
};
|
|
38
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -13,6 +13,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
13
|
return to;
|
|
14
14
|
};
|
|
15
15
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
16
20
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
17
21
|
mod
|
|
18
22
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
package/dist/cjs/ssr/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -56,51 +60,33 @@ const ssr = (config) => ({
|
|
|
56
60
|
return stringSSRHydrate();
|
|
57
61
|
function stringSSRHydrate() {
|
|
58
62
|
if (renderLevel === import_types.RenderLevel.CLIENT_RENDER || renderLevel === import_types.RenderLevel.SERVER_PREFETCH) {
|
|
59
|
-
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
60
|
-
context
|
|
61
|
-
}));
|
|
63
|
+
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context }));
|
|
62
64
|
} else if (renderLevel === import_types.RenderLevel.SERVER_RENDER) {
|
|
63
65
|
if ((0, import_utils.isReact18)()) {
|
|
64
66
|
(0, import_component.loadableReady)(() => {
|
|
65
|
-
let SSRApp = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_withCallback.WithCallback, {
|
|
66
|
-
callback,
|
|
67
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
68
|
-
context: hydrateContext
|
|
69
|
-
})
|
|
70
|
-
});
|
|
67
|
+
let SSRApp = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_withCallback.WithCallback, { callback, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context: hydrateContext }) });
|
|
71
68
|
SSRApp = (0, import_hoist_non_react_statics.default)(SSRApp, App);
|
|
72
69
|
ModernHydrate(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SSRApp, {}));
|
|
73
70
|
});
|
|
74
71
|
} else {
|
|
75
72
|
(0, import_component.loadableReady)(() => {
|
|
76
|
-
ModernHydrate(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
77
|
-
context: hydrateContext
|
|
78
|
-
}), callback);
|
|
73
|
+
ModernHydrate(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context: hydrateContext }), callback);
|
|
79
74
|
});
|
|
80
75
|
}
|
|
81
76
|
} else {
|
|
82
77
|
console.warn(
|
|
83
78
|
`unknow render level: ${renderLevel}, execute render()`
|
|
84
79
|
);
|
|
85
|
-
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
86
|
-
context
|
|
87
|
-
}));
|
|
80
|
+
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context }));
|
|
88
81
|
}
|
|
89
82
|
}
|
|
90
83
|
function streamSSRHydrate() {
|
|
91
84
|
if (renderLevel === import_types.RenderLevel.SERVER_RENDER) {
|
|
92
|
-
let SSRApp = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_withCallback.WithCallback, {
|
|
93
|
-
callback,
|
|
94
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
95
|
-
context: hydrateContext
|
|
96
|
-
})
|
|
97
|
-
});
|
|
85
|
+
let SSRApp = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_withCallback.WithCallback, { callback, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context: hydrateContext }) });
|
|
98
86
|
SSRApp = (0, import_hoist_non_react_statics.default)(SSRApp, App);
|
|
99
87
|
ModernHydrate(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SSRApp, {}));
|
|
100
88
|
} else {
|
|
101
|
-
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
102
|
-
context
|
|
103
|
-
}));
|
|
89
|
+
ModernRender(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context }));
|
|
104
90
|
}
|
|
105
91
|
}
|
|
106
92
|
},
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/cjs/ssr/prefetch.js
CHANGED
|
@@ -33,13 +33,9 @@ const prefetch = async (App, context) => (0, import_ssr.run)(context.ssrContext.
|
|
|
33
33
|
stats: loadableStats,
|
|
34
34
|
entrypoints: [ssrContext.entryName].filter(Boolean)
|
|
35
35
|
});
|
|
36
|
-
(0, import_server.renderToStaticMarkup)(extractor.collectChunks(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
37
|
-
context
|
|
38
|
-
})));
|
|
36
|
+
(0, import_server.renderToStaticMarkup)(extractor.collectChunks(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context })));
|
|
39
37
|
} else {
|
|
40
|
-
(0, import_server.renderToStaticMarkup)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
41
|
-
context
|
|
42
|
-
}));
|
|
38
|
+
(0, import_server.renderToStaticMarkup)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { context }));
|
|
43
39
|
}
|
|
44
40
|
if (!context.loaderManager.hasPendingLoaders()) {
|
|
45
41
|
return {
|
|
@@ -60,6 +56,7 @@ const prefetch = async (App, context) => (0, import_ssr.run)(context.ssrContext.
|
|
|
60
56
|
loadersData,
|
|
61
57
|
initialData: context.initialData,
|
|
62
58
|
i18nData: context.__i18nData__,
|
|
59
|
+
// todo: move to plugin state
|
|
63
60
|
storeState: (_a = context == null ? void 0 : context.store) == null ? void 0 : _a.getState()
|
|
64
61
|
};
|
|
65
62
|
});
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -36,7 +40,10 @@ function buildShellAfterTemplate(afterAppTemplate, options) {
|
|
|
36
40
|
return template.replace("<!--<?- SSRDataScript ?>-->", ssrDataScript);
|
|
37
41
|
function buildSSRDataScript() {
|
|
38
42
|
const { ssrContext, renderLevel } = options;
|
|
39
|
-
const { request } = ssrContext;
|
|
43
|
+
const { request, enableUnsafeCtx } = ssrContext;
|
|
44
|
+
const unsafeContext = {
|
|
45
|
+
headers: request.headers
|
|
46
|
+
};
|
|
40
47
|
const SSRData = {
|
|
41
48
|
context: {
|
|
42
49
|
request: {
|
|
@@ -45,8 +52,7 @@ function buildShellAfterTemplate(afterAppTemplate, options) {
|
|
|
45
52
|
pathname: request.pathname,
|
|
46
53
|
host: request.host,
|
|
47
54
|
url: request.url,
|
|
48
|
-
|
|
49
|
-
cookieMap: request.cookieMap
|
|
55
|
+
...enableUnsafeCtx ? unsafeContext : {}
|
|
50
56
|
}
|
|
51
57
|
},
|
|
52
58
|
renderLevel
|
|
@@ -54,7 +60,7 @@ function buildShellAfterTemplate(afterAppTemplate, options) {
|
|
|
54
60
|
return `
|
|
55
61
|
<script>window._SSR_DATA = ${(0, import_serialize_javascript.default)(SSRData, {
|
|
56
62
|
isJSON: true
|
|
57
|
-
})}
|
|
63
|
+
})}</script>
|
|
58
64
|
`;
|
|
59
65
|
}
|
|
60
66
|
}
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -37,6 +41,7 @@ function getHeadTemplate(beforeEntryTemplate, context) {
|
|
|
37
41
|
const helmetData = import_react_helmet.default.renderStatic();
|
|
38
42
|
return helmetData ? (0, import_helmet.default)(headTemplate2, helmetData) : headTemplate2;
|
|
39
43
|
},
|
|
44
|
+
// @TODO: prefetch scripts of lazy component
|
|
40
45
|
injectCss
|
|
41
46
|
];
|
|
42
47
|
const [headTemplate = ""] = beforeEntryTemplate.match(import_buildTemplate.HEAD_REG_EXP) || [];
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -39,7 +43,10 @@ var import_reduce = require("./reduce");
|
|
|
39
43
|
var loadableRenderer = __toESM(require("./loadable"));
|
|
40
44
|
var styledComponentRenderer = __toESM(require("./styledComponent"));
|
|
41
45
|
const buildTemplateData = (context, data, renderLevel) => {
|
|
42
|
-
const { request } = context;
|
|
46
|
+
const { request, enableUnsafeCtx } = context;
|
|
47
|
+
const unsafeContext = {
|
|
48
|
+
headers: request.headers
|
|
49
|
+
};
|
|
43
50
|
return {
|
|
44
51
|
data,
|
|
45
52
|
context: {
|
|
@@ -49,8 +56,7 @@ const buildTemplateData = (context, data, renderLevel) => {
|
|
|
49
56
|
pathname: request.pathname,
|
|
50
57
|
host: request.host,
|
|
51
58
|
url: request.url,
|
|
52
|
-
|
|
53
|
-
cookieMap: request.cookieMap
|
|
59
|
+
...enableUnsafeCtx ? unsafeContext : {}
|
|
54
60
|
}
|
|
55
61
|
},
|
|
56
62
|
renderLevel
|
|
@@ -164,7 +170,7 @@ class Entry {
|
|
|
164
170
|
SSRDataScript: `
|
|
165
171
|
<script>window._SSR_DATA = ${(0, import_serialize_javascript.default)(templateData, {
|
|
166
172
|
isJSON: true
|
|
167
|
-
})}
|
|
173
|
+
})}</script>
|
|
168
174
|
`
|
|
169
175
|
};
|
|
170
176
|
}
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -58,7 +58,7 @@ const toHtml = (jsx, renderer, next) => {
|
|
|
58
58
|
}
|
|
59
59
|
chunksMap[fileType] += `<script src="${v.url}" ${props.join(
|
|
60
60
|
" "
|
|
61
|
-
)}
|
|
61
|
+
)}></script>`;
|
|
62
62
|
} else if (fileType === "css") {
|
|
63
63
|
chunksMap[fileType] += `<link href="${v.url}" rel="stylesheet" />`;
|
|
64
64
|
}
|
|
@@ -21,7 +21,7 @@ __export(time_worker_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(time_worker_exports);
|
|
23
23
|
function processHrtime(previousTimestamp) {
|
|
24
|
-
const now = new Date().getTime();
|
|
24
|
+
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
25
25
|
const clocktime = now * 1e-3;
|
|
26
26
|
let seconds = Math.floor(clocktime);
|
|
27
27
|
let nanoseconds = Math.floor(clocktime % 1 * 1e9);
|
|
@@ -26,7 +26,7 @@ function getLoadableScripts(extractor) {
|
|
|
26
26
|
if (!check(scripts)) {
|
|
27
27
|
return "";
|
|
28
28
|
}
|
|
29
|
-
return scripts.split("
|
|
29
|
+
return scripts.split("</script>").slice(0, 2).map((i) => `${i}</script>`).join("");
|
|
30
30
|
}
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
package/dist/cjs/ssr/utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var utils_exports = {};
|
|
19
29
|
__export(utils_exports, {
|
|
@@ -24,6 +34,7 @@ __export(utils_exports, {
|
|
|
24
34
|
mockResponse: () => mockResponse
|
|
25
35
|
});
|
|
26
36
|
module.exports = __toCommonJS(utils_exports);
|
|
37
|
+
var import_cookie = __toESM(require("cookie"));
|
|
27
38
|
const isReact18 = () => process.env.IS_REACT18 === "true";
|
|
28
39
|
const formatServer = (request) => {
|
|
29
40
|
const {
|
|
@@ -33,6 +44,7 @@ const formatServer = (request) => {
|
|
|
33
44
|
} = request.headers || {};
|
|
34
45
|
return {
|
|
35
46
|
cookie,
|
|
47
|
+
cookieMap: import_cookie.default.parse(cookie || "") || {},
|
|
36
48
|
userAgent,
|
|
37
49
|
referer,
|
|
38
50
|
...request
|
|
@@ -46,15 +58,15 @@ const getQuery = () => window.location.search.substring(1).split("&").reduce((re
|
|
|
46
58
|
return res;
|
|
47
59
|
}, {});
|
|
48
60
|
const formatClient = (request) => {
|
|
49
|
-
var _a
|
|
61
|
+
var _a;
|
|
50
62
|
return {
|
|
51
63
|
params: request.params || {},
|
|
52
64
|
host: request.host || location.host,
|
|
53
65
|
pathname: request.pathname || location.pathname,
|
|
54
66
|
headers: request.headers || {},
|
|
55
|
-
cookieMap:
|
|
56
|
-
cookie:
|
|
57
|
-
userAgent: ((
|
|
67
|
+
cookieMap: import_cookie.default.parse(document.cookie || "") || {},
|
|
68
|
+
cookie: document.cookie || "",
|
|
69
|
+
userAgent: ((_a = request.headers) == null ? void 0 : _a["user-agent"]) || navigator.userAgent,
|
|
58
70
|
referer: request.referer || document.referrer,
|
|
59
71
|
query: request.query || getQuery(),
|
|
60
72
|
url: location.href
|
package/dist/cjs/state/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -70,13 +74,7 @@ const state = (config) => ({
|
|
|
70
74
|
hoc({ App }, next) {
|
|
71
75
|
const getStateApp = (props) => {
|
|
72
76
|
const context = (0, import_react.useContext)(import_core.RuntimeReactContext);
|
|
73
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Provider, {
|
|
74
|
-
store: context.store,
|
|
75
|
-
config: storeConfig,
|
|
76
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
77
|
-
...props
|
|
78
|
-
})
|
|
79
|
-
});
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Provider, { store: context.store, config: storeConfig, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, { ...props }) });
|
|
80
78
|
};
|
|
81
79
|
return next({
|
|
82
80
|
App: (0, import_hoist_non_react_statics.default)(getStateApp, App)
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -154,7 +154,11 @@ var cli_default = function() {
|
|
|
154
154
|
runtimeByEntries: {},
|
|
155
155
|
source: {
|
|
156
156
|
alias: {
|
|
157
|
-
|
|
157
|
+
/**
|
|
158
|
+
* twin.macro inserts styled-components into the code during the compilation process
|
|
159
|
+
* But it will not be installed under the user project.
|
|
160
|
+
* So need to add alias
|
|
161
|
+
*/ "styled-components": require.resolve("styled-components")
|
|
158
162
|
},
|
|
159
163
|
globalVars: {
|
|
160
164
|
"process.env.IS_REACT18": process.env.IS_REACT18
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
var APP_CONFIG_SYMBOL = "config";
|
|
2
2
|
var getConfig = function(Component) {
|
|
3
|
-
return
|
|
3
|
+
return(// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-expect-error
|
|
5
|
+
Component[APP_CONFIG_SYMBOL]);
|
|
4
6
|
};
|
|
5
7
|
var defineConfig = function(Component, config) {
|
|
6
8
|
Component[APP_CONFIG_SYMBOL] = config;
|
|
@@ -419,11 +419,13 @@ var bootstrap = function() {
|
|
|
419
419
|
isBrowser: false,
|
|
420
420
|
loaderManager: createLoaderManager({}, {
|
|
421
421
|
skipNonStatic: id.staticGenerate,
|
|
422
|
+
// if not static generate, only non-static loader can exec on prod env
|
|
422
423
|
skipStatic: process.env.NODE_ENV === "production" && !id.staticGenerate
|
|
423
424
|
})
|
|
424
425
|
});
|
|
425
426
|
isRedirectResponse = function(result) {
|
|
426
|
-
if (typeof Response !== "undefined" &&
|
|
427
|
+
if (typeof Response !== "undefined" && // fix: ssg workflow doesn't inject Web Response
|
|
428
|
+
_instanceof(result, Response) && result.status >= 300 && result.status <= 399) {
|
|
427
429
|
var status = result.status;
|
|
428
430
|
var redirectUrl = result.headers.get("Location") || "/";
|
|
429
431
|
var ssrContext = context.ssrContext;
|
|
@@ -266,6 +266,7 @@ var createLoader = function(id) {
|
|
|
266
266
|
reloading: hasLoaded && status === 1 /* loading */ ,
|
|
267
267
|
data: data,
|
|
268
268
|
error: _instanceof(error, Error) ? "".concat(error.message) : error,
|
|
269
|
+
// redundant fields for ssr log
|
|
269
270
|
_error: error
|
|
270
271
|
};
|
|
271
272
|
};
|
|
@@ -306,7 +307,8 @@ var createLoaderManager = function(initialDataMap) {
|
|
|
306
307
|
var skipExec = ignoreNonStatic || ignoreStatic;
|
|
307
308
|
loader = createLoader(id, typeof initialDataMap[id] !== "undefined" ? initialDataMap[id] : {
|
|
308
309
|
data: loaderOptions.initialData
|
|
309
|
-
}, loaderFn,
|
|
310
|
+
}, loaderFn, // Todo whether static loader is exec when CSR
|
|
311
|
+
skipExec);
|
|
310
312
|
loadersMap.set(id, loader);
|
|
311
313
|
}
|
|
312
314
|
return id;
|
|
@@ -236,7 +236,7 @@ var cli_default = function() {
|
|
|
236
236
|
case 0:
|
|
237
237
|
htmlWebpackPlugin = param.htmlWebpackPlugin;
|
|
238
238
|
documentParams = getDocParams({
|
|
239
|
-
config: api.
|
|
239
|
+
config: api.useResolvedConfigContext(),
|
|
240
240
|
entryName: entryName,
|
|
241
241
|
templateParameters: templateParameters
|
|
242
242
|
});
|
|
@@ -285,6 +285,7 @@ var cli_default = function() {
|
|
|
285
285
|
],
|
|
286
286
|
outfile: htmlOutputFile,
|
|
287
287
|
platform: "node",
|
|
288
|
+
// change esbuild use the rootDir tsconfig.json as default to tempTsConfigFile
|
|
288
289
|
tsconfig: tempTsConfigFile,
|
|
289
290
|
target: "es6",
|
|
290
291
|
loader: {
|
|
@@ -370,7 +371,8 @@ var cli_default = function() {
|
|
|
370
371
|
tools: {
|
|
371
372
|
htmlPlugin: function(options, entry) {
|
|
372
373
|
var hackParameters = typeof (options === null || options === void 0 ? void 0 : options.templateParameters) === "function" ? options === null || options === void 0 ? void 0 : options.templateParameters({}, {}, {}, {}) : _objectSpread({}, options === null || options === void 0 ? void 0 : options.templateParameters);
|
|
373
|
-
var templateContent = documentEntry(entry.entryName,
|
|
374
|
+
var templateContent = documentEntry(entry.entryName, // options,
|
|
375
|
+
hackParameters);
|
|
374
376
|
var documentHtmlOptions = templateContent ? {
|
|
375
377
|
templateContent: templateContent,
|
|
376
378
|
inject: false
|