Commit 57381e7e authored by Luke Sandberg's avatar Luke Sandberg

Turbopack: Integrate merge_chunks into production.rs

Refactor production.rs to call merge_grouped_chunks() from merge.rs
instead of having its own copy of the merge algorithm. This eliminates
~500 lines of duplicated merge logic.

production.rs now:
1. Resolves Vc values and groups items by bitmap (unchanged)
2. Converts groups to GroupInput (size + bitmap + batch_group_id)
3. Calls merge_grouped_chunks() for the merge + absorption pass
4. Maps results back to make_chunk() calls

merge.rs now exposes two entry points:
- merge_grouped_chunks(): takes pre-grouped items (used by production.rs)
- merge_chunks(): groups items by bitmap first, then calls
  merge_grouped_chunks() (used by unit tests)

Test-only types (ChunkItemForMerging, MergedChunkInfo, merge_chunks,
hash_bitmap) are gated with #[cfg(test)].
parent a54b190f
...@@ -29,7 +29,6 @@ use crate::{ ...@@ -29,7 +29,6 @@ use crate::{
}; };
mod dev; mod dev;
#[allow(dead_code)]
pub(crate) mod merge; pub(crate) mod merge;
mod production; mod production;
mod style_production; mod style_production;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment