@@ -41,18 +41,10 @@ const createSSRManifest = async (
41
41
loadJsonFile ( reactClientManifestFileName ) as Promise < Record < string , { id : string } > > ,
42
42
] ) ;
43
43
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 > = { } ;
53
45
Object . entries ( reactClientManifest ) . forEach ( ( [ aboluteFileUrl , clientFileBundlingInfo ] ) => {
54
46
const { id, chunks } = reactServerManifest [ aboluteFileUrl ] ;
55
- ssrManifest . moduleMap [ clientFileBundlingInfo . id ] = {
47
+ moduleMap [ clientFileBundlingInfo . id ] = {
56
48
'*' : {
57
49
id,
58
50
chunks,
@@ -61,6 +53,15 @@ const createSSRManifest = async (
61
53
} ;
62
54
} ) ;
63
55
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
+
64
65
return ssrManifest ;
65
66
} ;
66
67
@@ -106,8 +107,8 @@ const RSCServerRoot: RenderFunction = async (
106
107
const resolvedServerComponent = use ( serverComponentElement ) ;
107
108
return (
108
109
< >
109
- < React . Fragment key = "serverComponentElement" > { resolvedServerComponent } </ React . Fragment >
110
- < RSCPayloadContainer RSCPayloadStream = { rscPayloadStream2 } key = "rscPayloadContainer" />
110
+ { resolvedServerComponent }
111
+ < RSCPayloadContainer RSCPayloadStream = { rscPayloadStream2 } />
111
112
</ >
112
113
) ;
113
114
} ;
0 commit comments