Extract pure batching algorithm for unit testing
Refactor compute_style_groups to extract the core batching logic into a
separate compute_style_batches function that operates on plain usize keys
instead of Vc types. This allows writing synchronous unit tests without
needing a turbo-tasks runtime.
Add 14 unit tests covering:
- Basic shared module batching
- Contiguity check preventing non-adjacent batching (with size limits)
- Global CSS isolation (no leaking into unrelated routes)
- Size budget enforcement
- Module dependents computation (universal predecessor, non-universal)
- Contiguity absorbing intervening modules
- Reverse-direction watermark handling
Co-Authored-By:
Claude <noreply@anthropic.com>
Showing
This diff is collapsed.
Please
register
or
sign in
to comment