@@ -169,6 +169,8 @@ pub async fn get_app_client_references_chunks(
169
169
list. extend ( framework_reference_types) ;
170
170
}
171
171
172
+ let chunk_group_info = module_graph. chunk_group_info ( ) ;
173
+
172
174
let mut current_client_availability_info = client_availability_info. into_value ( ) ;
173
175
let mut current_client_chunks = OutputAssets :: empty ( ) . to_resolved ( ) . await ?;
174
176
let mut current_ssr_availability_info = AvailabilityInfo :: Root ;
@@ -181,6 +183,12 @@ pub async fn get_app_client_references_chunks(
181
183
for ( server_component, client_reference_types) in
182
184
client_references_by_server_component. into_iter ( )
183
185
{
186
+ let parent_chunk_group = * chunk_group_info
187
+ . get_index_of ( ChunkGroup :: Shared ( ResolvedVc :: upcast (
188
+ server_component. await ?. module ,
189
+ ) ) )
190
+ . await ?;
191
+
184
192
let base_ident = server_component. ident ( ) ;
185
193
186
194
let server_path = server_component. server_path ( ) ;
@@ -217,9 +225,8 @@ pub async fn get_app_client_references_chunks(
217
225
218
226
ssr_chunking_context. chunk_group (
219
227
base_ident. with_modifier ( ssr_modules_modifier ( ) ) ,
220
- // TODO use correct parameters here, and sort the modules?
221
228
ChunkGroup :: IsolatedMerged {
222
- parent : 0 ,
229
+ parent : parent_chunk_group ,
223
230
merge_tag : ECMASCRIPT_CLIENT_REFERENCE_MERGE_TAG_SSR . clone ( ) ,
224
231
entries : ssr_modules,
225
232
} ,
@@ -256,9 +263,8 @@ pub async fn get_app_client_references_chunks(
256
263
257
264
Some ( client_chunking_context. chunk_group (
258
265
base_ident. with_modifier ( client_modules_modifier ( ) ) ,
259
- // TODO use correct parameters here, and sort the modules?
260
266
ChunkGroup :: IsolatedMerged {
261
- parent : 0 ,
267
+ parent : parent_chunk_group ,
262
268
merge_tag : ECMASCRIPT_CLIENT_REFERENCE_MERGE_TAG_CLIENT . clone ( ) ,
263
269
entries : client_modules,
264
270
} ,
0 commit comments