Skip to content

Commit 8eabb2f

Browse files
committed
Turbopack: make graph traversal sync
1 parent 98f8a97 commit 8eabb2f

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

turbopack/crates/turbopack/src/global_module_ids.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,21 @@ pub async fn get_global_module_id_strategy(
3030

3131
// And additionally, all the modules that are inserted by chunking (i.e. async loaders)
3232
let mut async_idents = vec![];
33-
module_graph
34-
.traverse_all_edges_unordered(|parent, current| {
35-
if let (
36-
_,
37-
&RefData {
38-
chunking_type: ChunkingType::Async,
39-
..
40-
},
41-
) = parent
42-
{
43-
let module =
44-
ResolvedVc::try_sidecast::<Box<dyn ChunkableModule>>(current.module)
45-
.context("expected chunkable module for async reference")?;
46-
async_idents.push(AsyncLoaderModule::asset_ident_for(*module));
47-
}
48-
Ok(())
49-
})
50-
.await?;
33+
module_graph.traverse_all_edges_unordered(|parent, current| {
34+
if let (
35+
_,
36+
&RefData {
37+
chunking_type: ChunkingType::Async,
38+
..
39+
},
40+
) = parent
41+
{
42+
let module = ResolvedVc::try_sidecast::<Box<dyn ChunkableModule>>(current.module)
43+
.context("expected chunkable module for async reference")?;
44+
async_idents.push(AsyncLoaderModule::asset_ident_for(*module));
45+
}
46+
Ok(())
47+
})?;
5148

5249
let mut module_id_map = module_idents
5350
.chain(async_idents.into_iter())

0 commit comments

Comments
 (0)