@modern-js/render 3.0.4 → 3.1.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.
|
@@ -32,6 +32,7 @@ __export(ssr_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(ssr_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_constants = require("@modern-js/utils/universal/constants");
|
|
35
36
|
var import_server = require("react-dom/server.edge");
|
|
36
37
|
var import_client = require("../../client/index");
|
|
37
38
|
function CSSLinks({ cssFiles }) {
|
|
@@ -62,7 +63,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
62
63
|
const entryCssFiles = (__rspack_rsc_manifest__3 = __rspack_rsc_manifest__) === null || __rspack_rsc_manifest__3 === void 0 ? void 0 : __rspack_rsc_manifest__3.entryCssFiles;
|
|
63
64
|
const hasRoutes = Boolean(routes && routes.length > 0);
|
|
64
65
|
if (!clientManifest || !serverConsumerModuleMap) {
|
|
65
|
-
return (0, import_server.renderToReadableStream)(children,
|
|
66
|
+
return (0, import_server.renderToReadableStream)(children, {
|
|
67
|
+
...options,
|
|
68
|
+
identifierPrefix: import_constants.SSR_HYDRATION_ID_PREFIX
|
|
69
|
+
});
|
|
66
70
|
}
|
|
67
71
|
try {
|
|
68
72
|
const [{ renderRsc }, { createFromReadableStream }, { injectRSCPayload }] = await Promise.all([
|
|
@@ -87,7 +91,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
87
91
|
}),
|
|
88
92
|
children
|
|
89
93
|
]
|
|
90
|
-
}),
|
|
94
|
+
}), {
|
|
95
|
+
...options,
|
|
96
|
+
identifierPrefix: import_constants.SSR_HYDRATION_ID_PREFIX
|
|
97
|
+
});
|
|
91
98
|
const stream = htmlStream.pipeThrough(injectRSCPayload(rscPayloadStream, {
|
|
92
99
|
injectClosingTags: true
|
|
93
100
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { SSR_HYDRATION_ID_PREFIX } from "@modern-js/utils/universal/constants";
|
|
2
3
|
import { renderToReadableStream } from "react-dom/server.edge";
|
|
3
4
|
import { ServerElementsProvider } from "../../client/index";
|
|
4
5
|
function CSSLinks({ cssFiles }) {
|
|
@@ -29,7 +30,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
29
30
|
const entryCssFiles = (__rspack_rsc_manifest__3 = __rspack_rsc_manifest__) === null || __rspack_rsc_manifest__3 === void 0 ? void 0 : __rspack_rsc_manifest__3.entryCssFiles;
|
|
30
31
|
const hasRoutes = Boolean(routes && routes.length > 0);
|
|
31
32
|
if (!clientManifest || !serverConsumerModuleMap) {
|
|
32
|
-
return renderToReadableStream(children,
|
|
33
|
+
return renderToReadableStream(children, {
|
|
34
|
+
...options,
|
|
35
|
+
identifierPrefix: SSR_HYDRATION_ID_PREFIX
|
|
36
|
+
});
|
|
33
37
|
}
|
|
34
38
|
try {
|
|
35
39
|
const [{ renderRsc }, { createFromReadableStream }, { injectRSCPayload }] = await Promise.all([
|
|
@@ -54,7 +58,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
54
58
|
}),
|
|
55
59
|
children
|
|
56
60
|
]
|
|
57
|
-
}),
|
|
61
|
+
}), {
|
|
62
|
+
...options,
|
|
63
|
+
identifierPrefix: SSR_HYDRATION_ID_PREFIX
|
|
64
|
+
});
|
|
58
65
|
const stream = htmlStream.pipeThrough(injectRSCPayload(rscPayloadStream, {
|
|
59
66
|
injectClosingTags: true
|
|
60
67
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { SSR_HYDRATION_ID_PREFIX } from "@modern-js/utils/universal/constants";
|
|
2
3
|
import { renderToReadableStream } from "react-dom/server.edge";
|
|
3
4
|
import { ServerElementsProvider } from "../../client/index.mjs";
|
|
4
5
|
function CSSLinks({ cssFiles }) {
|
|
@@ -29,7 +30,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
29
30
|
const entryCssFiles = (__rspack_rsc_manifest__3 = __rspack_rsc_manifest__) === null || __rspack_rsc_manifest__3 === void 0 ? void 0 : __rspack_rsc_manifest__3.entryCssFiles;
|
|
30
31
|
const hasRoutes = Boolean(routes && routes.length > 0);
|
|
31
32
|
if (!clientManifest || !serverConsumerModuleMap) {
|
|
32
|
-
return renderToReadableStream(children,
|
|
33
|
+
return renderToReadableStream(children, {
|
|
34
|
+
...options,
|
|
35
|
+
identifierPrefix: SSR_HYDRATION_ID_PREFIX
|
|
36
|
+
});
|
|
33
37
|
}
|
|
34
38
|
try {
|
|
35
39
|
const [{ renderRsc }, { createFromReadableStream }, { injectRSCPayload }] = await Promise.all([
|
|
@@ -54,7 +58,10 @@ const renderSSRStream = async (children, options) => {
|
|
|
54
58
|
}),
|
|
55
59
|
children
|
|
56
60
|
]
|
|
57
|
-
}),
|
|
61
|
+
}), {
|
|
62
|
+
...options,
|
|
63
|
+
identifierPrefix: SSR_HYDRATION_ID_PREFIX
|
|
64
|
+
});
|
|
58
65
|
const stream = htmlStream.pipeThrough(injectRSCPayload(rscPayloadStream, {
|
|
59
66
|
injectClosingTags: true
|
|
60
67
|
}));
|
package/package.json
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.0
|
|
18
|
+
"version": "3.1.0",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
21
|
"hook.d.ts"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@swc/helpers": "^0.5.17",
|
|
25
|
-
"@modern-js/types": "3.0
|
|
26
|
-
"@modern-js/utils": "3.0
|
|
25
|
+
"@modern-js/types": "3.1.0",
|
|
26
|
+
"@modern-js/utils": "3.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@rslib/core": "0.19.6",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"react-server-dom-rspack": "0.0.1-beta.1",
|
|
35
35
|
"typescript": "^5",
|
|
36
36
|
"@modern-js/rslib": "2.68.10",
|
|
37
|
-
"@modern-js/server-core": "3.0
|
|
38
|
-
"@scripts/
|
|
39
|
-
"@scripts/
|
|
37
|
+
"@modern-js/server-core": "3.1.0",
|
|
38
|
+
"@scripts/rstest-config": "2.66.0",
|
|
39
|
+
"@scripts/build": "2.66.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": ">=17.0.2",
|