@@ -41,18 +41,10 @@ const createSSRManifest = async (
4141 loadJsonFile(reactClientManifestFileName) as Promise<Record<string, { id: string }>>,
4242 ]);
4343
44- const ssrManifest = {
45- // The `moduleLoading` property is utilized by the React runtime to load JavaScript modules.
46- // It can accept options such as `prefix` and `crossOrigin` to specify the path and crossorigin attribute for the modules.
47- // In our case, since the server code is bundled into a single bundle, there is no need to load additional JavaScript modules.
48- // As a result, we set this property to an empty object because it will not be used.
49- moduleLoading: {},
50- moduleMap: {} as Record<string, unknown>,
51- };
52-
44+ const moduleMap: Record<string, unknown> = {};
5345 Object.entries(reactClientManifest).forEach(([aboluteFileUrl, clientFileBundlingInfo]) => {
5446 const { id, chunks } = reactServerManifest[aboluteFileUrl];
55- ssrManifest. moduleMap[clientFileBundlingInfo.id] = {
47+ moduleMap[clientFileBundlingInfo.id] = {
5648 '*': {
5749 id,
5850 chunks,
@@ -61,6 +53,15 @@ const createSSRManifest = async (
6153 };
6254 });
6355
56+ const ssrManifest = {
57+ // The `moduleLoading` property is utilized by the React runtime to load JavaScript modules.
58+ // It can accept options such as `prefix` and `crossOrigin` to specify the path and crossorigin attribute for the modules.
59+ // In our case, since the server code is bundled into a single bundle, there is no need to load additional JavaScript modules.
60+ // As a result, we set this property to an empty object because it will not be used.
61+ moduleLoading: {},
62+ moduleMap,
63+ };
64+
6465 return ssrManifest;
6566};
6667
@@ -106,8 +107,8 @@ const RSCServerRoot: RenderFunction = async (
106107 const resolvedServerComponent = use(serverComponentElement);
107108 return (
108109 <>
109- <React.Fragment key="serverComponentElement"> {resolvedServerComponent}</React.Fragment>
110- <RSCPayloadContainer RSCPayloadStream={rscPayloadStream2} key="rscPayloadContainer" />
110+ {resolvedServerComponent}
111+ <RSCPayloadContainer RSCPayloadStream={rscPayloadStream2} />
111112 </>
112113 );
113114 };
0 commit comments