Commit 983df064 authored by Luke Sandberg's avatar Luke Sandberg

Make BatchingModuleInfo, BatchingResult, and compute_style_batches private

Tests are in a sub-module of the same file and can access private items
via super::.
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
parent ec86c8f1
...@@ -106,17 +106,17 @@ struct ChunkGroupState { ...@@ -106,17 +106,17 @@ struct ChunkGroupState {
/// Pure-data version of [`ModuleInfo`] for the batching algorithm. Free of Vc types so it can be /// Pure-data version of [`ModuleInfo`] for the batching algorithm. Free of Vc types so it can be
/// used in unit tests without a turbo-tasks runtime. /// used in unit tests without a turbo-tasks runtime.
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct BatchingModuleInfo { struct BatchingModuleInfo {
pub style_type: StyleType, style_type: StyleType,
pub ident: RcStr, ident: RcStr,
pub chunk_group_indices: FxIndexMap<usize, usize>, chunk_group_indices: FxIndexMap<usize, usize>,
pub size: usize, size: usize,
} }
/// Result of the pure batching algorithm. Each batch is a `Vec<usize>` of module keys that should /// Result of the pure batching algorithm. Each batch is a `Vec<usize>` of module keys that should
/// share a single CSS chunk. Only multi-module batches are included. /// share a single CSS chunk. Only multi-module batches are included.
pub(crate) struct BatchingResult { struct BatchingResult {
pub batches: Vec<Vec<usize>>, batches: Vec<Vec<usize>>,
} }
/// Pure algorithmic core of the style-groups batching algorithm. /// Pure algorithmic core of the style-groups batching algorithm.
...@@ -131,7 +131,7 @@ pub(crate) struct BatchingResult { ...@@ -131,7 +131,7 @@ pub(crate) struct BatchingResult {
/// - `chunk_group_styles`: For each chunk group, the ordered list of module keys in CSS cascade /// - `chunk_group_styles`: For each chunk group, the ordered list of module keys in CSS cascade
/// order (postorder DFS). /// order (postorder DFS).
/// - `max_chunk_size`: Maximum byte size for a single shared chunk. /// - `max_chunk_size`: Maximum byte size for a single shared chunk.
pub(crate) fn compute_style_batches( fn compute_style_batches(
module_info: &FxIndexMap<usize, BatchingModuleInfo>, module_info: &FxIndexMap<usize, BatchingModuleInfo>,
chunk_group_styles: &[FxIndexSet<usize>], chunk_group_styles: &[FxIndexSet<usize>],
max_chunk_size: usize, max_chunk_size: usize,
......
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