Skip to content

Commit d759ce9

Browse files
committed
Cleanup
1 parent 33cd33c commit d759ce9

File tree

4 files changed

+7
-260
lines changed

4 files changed

+7
-260
lines changed

crates/next-api/src/dynamic_imports.rs

-23
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,6 @@ pub(crate) async fn collect_next_dynamic_chunks(
6464
// containing the next/dynamic imports
6565
let availability_info = match chunking_availability {
6666
NextDynamicChunkAvailability::ClientReferences(client_reference_chunks) => {
67-
// println!(
68-
// "dynamic {:?} {:?}",
69-
// match &parent_client_reference.unwrap() {
70-
// ClientReferenceType::EcmascriptClientReference(v) =>
71-
// v.ident().to_string().await?,
72-
// ClientReferenceType::CssClientReference(v) =>
73-
// v.ident().to_string().await?,
74-
// },
75-
// match client_reference_chunks
76-
// .client_component_client_chunks
77-
// .get(&parent_client_reference.unwrap())
78-
// {
79-
// Some(v) => Some(
80-
// v.0.await?
81-
// .iter()
82-
// .map(|m| m.path().to_string())
83-
// .try_join()
84-
// .await?
85-
// ),
86-
// None => None,
87-
// }
88-
// );
89-
9067
client_reference_chunks
9168
.client_component_client_chunks
9269
.get(&parent_client_reference.unwrap())

crates/next-core/src/next_app/app_client_references_chunks.rs

-149
Original file line numberDiff line numberDiff line change
@@ -186,48 +186,6 @@ pub async fn get_app_client_references_chunks(
186186
let mut client_component_ssr_chunks = FxIndexMap::default();
187187
let mut client_component_client_chunks = FxIndexMap::default();
188188

189-
// let c = chunk_group_info.await?;
190-
// println!(
191-
// "chunk_groups {} {:#?}",
192-
// entry_chunk_group.debug_str(&c).await?,
193-
// c.chunk_groups
194-
// .iter()
195-
// .map(|g| g.debug_str(&c))
196-
// .try_join()
197-
// .await?
198-
// );
199-
// println!(
200-
// "merged_chunk_groups {:#?}",
201-
// c.merged_chunk_groups
202-
// .iter()
203-
// .map(async |((id, tag), groups)| Ok((
204-
// c.chunk_groups[id.0 as usize].debug_str(&c).await?,
205-
// tag,
206-
// groups
207-
// .iter()
208-
// .map(|g| c.chunk_groups[g.0 as usize].debug_str(&c))
209-
// .try_join()
210-
// .await?
211-
// )))
212-
// .try_join()
213-
// .await?
214-
// );
215-
// println!(
216-
// "chunk_group_children {:#?}",
217-
// c.chunk_group_children
218-
// .iter()
219-
// .map(async |(parent, groups)| Ok((
220-
// c.chunk_groups[parent.0 as usize].debug_str(&c).await?,
221-
// groups
222-
// .iter()
223-
// .map(|g| c.chunk_groups[g.0 as usize].debug_str(&c))
224-
// .try_join()
225-
// .await?
226-
// )))
227-
// .try_join()
228-
// .await?
229-
// );
230-
231189
let server_utils_chunk_group = chunk_group_info
232190
.get_merged_group(
233191
entry_chunk_group.clone(),
@@ -312,27 +270,6 @@ pub async fn get_app_client_references_chunks(
312270
)
313271
};
314272

315-
// println!(
316-
// "ssr_chunk_group: {:?} {:?}",
317-
// ssr_chunk_groups
318-
// .iter()
319-
// .map(|g| g.debug_str(&c))
320-
// .try_join()
321-
// .await?,
322-
// match x {
323-
// Some(x) => Some(
324-
// x.await?
325-
// .assets
326-
// .await?
327-
// .iter()
328-
// .map(|m| m.path().to_string())
329-
// .try_join()
330-
// .await?
331-
// ),
332-
// None => None,
333-
// }
334-
// );
335-
336273
let ssr_chunk_group = async {
337274
if let Some(ssr_chunking_context) = ssr_chunking_context {
338275
ssr_chunk_groups
@@ -406,41 +343,6 @@ pub async fn get_app_client_references_chunks(
406343
current_ssr_chunks = ssr_chunks;
407344
}
408345

409-
// println!(
410-
// "chunks {:#?} {:#?} {:#?}",
411-
// entries
412-
// .iter()
413-
// .map(async |entry| {
414-
// Ok((entry, entry.ident(), entry.ident().to_string().await?))
415-
// })
416-
// .try_join()
417-
// .await?,
418-
// entries
419-
// .iter()
420-
// .map(async |entry| {
421-
// Ok((
422-
// entry.ident().to_string().await?,
423-
// match client_to_ref_ty.get(entry) {
424-
// Some(ClientReferenceType::EcmascriptClientReference(x))
425-
// => {
426-
// Some(x.ident().to_string().await?) }
427-
// Some(ClientReferenceType::CssClientReference(x)) => {
428-
// Some(x.ident().to_string().await?)
429-
// }
430-
// None => None,
431-
// },
432-
// ))
433-
// })
434-
// .try_join()
435-
// .await?,
436-
// chunks_group_result
437-
// .assets
438-
// .await?
439-
// .iter()
440-
// .map(|m| m.path().to_string())
441-
// .try_join()
442-
// .await?
443-
// );
444346
for entry in &*entries {
445347
for client_reference_ty in client_to_ref_ty.get(entry).into_iter().flatten()
446348
{
@@ -496,57 +398,6 @@ pub async fn get_app_client_references_chunks(
496398
}
497399
}
498400

499-
// println!(
500-
// "client_component_ssr_chunks {:#?}",
501-
// client_component_ssr_chunks
502-
// .iter()
503-
// .map(async |(ty, (output, _))| {
504-
// Ok((
505-
// match ty {
506-
// ClientReferenceType::EcmascriptClientReference(x) => {
507-
// x.ident().to_string().await?
508-
// }
509-
// ClientReferenceType::CssClientReference(x) => {
510-
// x.ident().to_string().await?
511-
// }
512-
// },
513-
// output
514-
// .await?
515-
// .iter()
516-
// .map(|m| m.path().to_string())
517-
// .try_join()
518-
// .await?,
519-
// ))
520-
// })
521-
// .try_join()
522-
// .await?
523-
// );
524-
// println!(
525-
// "client_component_client_chunks {:#?}",
526-
// client_component_client_chunks
527-
// .iter()
528-
// .map(async |(ty, (output, _))| {
529-
// Ok((
530-
// match ty {
531-
// ClientReferenceType::EcmascriptClientReference(x) => {
532-
// x.ident().to_string().await?
533-
// }
534-
// ClientReferenceType::CssClientReference(x) => {
535-
// x.ident().to_string().await?
536-
// }
537-
// },
538-
// output
539-
// .await?
540-
// .iter()
541-
// .map(|m| m.path().to_string())
542-
// .try_join()
543-
// .await?,
544-
// ))
545-
// })
546-
// .try_join()
547-
// .await?
548-
// );
549-
550401
Ok(ClientReferencesChunks {
551402
client_component_client_chunks,
552403
client_component_ssr_chunks,

crates/next-core/src/next_manifests/client_reference_manifest.rs

-16
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,6 @@ impl ClientReferenceManifest {
225225
client_component_ssr_chunks.get(&app_client_reference_ty)
226226
{
227227
let ssr_chunks = ssr_chunks.await?;
228-
// println!(
229-
// "output ssr_chunks: {:?} {:#?}",
230-
// match app_client_reference_ty {
231-
// ClientReferenceType::EcmascriptClientReference(x) => {
232-
// x.ident().to_string().await?
233-
// }
234-
// ClientReferenceType::CssClientReference(x) => {
235-
// x.ident().to_string().await?
236-
// }
237-
// },
238-
// ssr_chunks
239-
// .iter()
240-
// .map(|m| m.path().to_string())
241-
// .try_join()
242-
// .await?,
243-
// );
244228
references.extend(ssr_chunks.iter());
245229

246230
let ssr_chunks_paths = cached_chunk_paths(

turbopack/crates/turbopack-core/src/module_graph/chunk_group_info.rs

+7-72
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ impl ChunkGroupInfo {
154154
) -> Result<Vc<ChunkGroups>> {
155155
if let Some(parent_idx) = self.chunk_groups.get_index_of(&parent) {
156156
let mut result = RoaringBitmap::new();
157-
// let mut x = vec![];
158157
self.traverse_chunk_groups(ChunkGroupId(parent_idx as u32), |idx| {
159-
// x.push(idx);
160158
result.extend(
161159
self.merged_chunk_groups
162160
.get(&(idx, merge_tag.clone()))
@@ -165,21 +163,6 @@ impl ChunkGroupInfo {
165163
.map(|v| v.0),
166164
);
167165
});
168-
// println!(
169-
// "traverse map {:#?}",
170-
// x.into_iter()
171-
// .map(async |i| {
172-
// Ok((
173-
// self.chunk_groups[i.0 as usize]
174-
// .debug_str(self)
175-
// .await
176-
// .unwrap(),
177-
// self.merged_chunk_groups.get(&(i, merge_tag.clone())),
178-
// ))
179-
// })
180-
// .try_join()
181-
// .await?
182-
// );
183166
Ok(Vc::cell(
184167
result
185168
.iter()
@@ -217,13 +200,6 @@ impl ChunkGroupInfo {
217200
let mut visited = RoaringBitmap::from_sorted_iter(std::iter::once(entry.0)).unwrap();
218201
let mut queue = VecDeque::from(vec![entry]);
219202
while let Some(group) = queue.pop_front() {
220-
// println!(
221-
// "traverse {}",
222-
// self.chunk_groups[group.0 as usize]
223-
// .debug_str(self)
224-
// .await
225-
// .unwrap(),
226-
// );
227203
visit(group);
228204
if let Some(children) = self.chunk_group_children.get(&group) {
229205
for child in children {
@@ -803,54 +779,13 @@ pub async fn compute_chunk_group_info(graph: &ModuleGraph) -> Result<Vc<ChunkGro
803779
let mut merged_chunk_groups: FxIndexMap<_, Vec<_>> = FxIndexMap::default();
804780

805781
for (key, (id, merged_entries)) in &chunk_groups_map {
806-
match key {
807-
ChunkGroupKey::IsolatedMerged { parent, merge_tag }
808-
| ChunkGroupKey::SharedMerged { parent, merge_tag } => {
809-
// let parent_key = chunk_groups_map.get_index(parent.0 as usize).unwrap().0;
810-
// let parent_entries = match parent_key {
811-
// ChunkGroupKey::Entry(_) | ChunkGroupKey::Shared(_) => {
812-
// // This is the entry we want
813-
// Either::Right(std::iter::once(*parent))
814-
// }
815-
// _ => {
816-
// let parent_entry = match parent_key {
817-
// ChunkGroupKey::Entry(_) | ChunkGroupKey::Shared(_) => {
818-
// unreachable!()
819-
// }
820-
// ChunkGroupKey::Async(entry) | ChunkGroupKey::Isolated(entry) => {
821-
// entry
822-
// }
823-
// ChunkGroupKey::IsolatedMerged { .. }
824-
// | ChunkGroupKey::SharedMerged { .. } => {
825-
// // Is it correct to only look at the first contained entry?
826-
// merged_entries.first().unwrap()
827-
// }
828-
// };
829-
// // Find all the entries that this group is included in
830-
// Either::Left(
831-
// module_chunk_groups
832-
// .get(parent_entry)
833-
// .unwrap()
834-
// .iter()
835-
// // .filter(|id| {
836-
// // matches!(
837-
// // chunk_groups_map.get_index(*id as
838-
// usize).unwrap().0, //
839-
// ChunkGroupKey::Entry(_) | ChunkGroupKey::Shared(_)
840-
// // )
841-
// // })
842-
// .map(ChunkGroupId),
843-
// )
844-
// }
845-
// };
846-
// for parent in parent_entries {
847-
merged_chunk_groups
848-
.entry((*parent, merge_tag.clone()))
849-
.or_default()
850-
.push(*id);
851-
// }
852-
}
853-
_ => {}
782+
if let ChunkGroupKey::IsolatedMerged { parent, merge_tag }
783+
| ChunkGroupKey::SharedMerged { parent, merge_tag } = key
784+
{
785+
merged_chunk_groups
786+
.entry((*parent, merge_tag.clone()))
787+
.or_default()
788+
.push(*id);
854789
}
855790

856791
chunk_groups.insert(match key {

0 commit comments

Comments
 (0)