turbopack: Extract as_chunk into shared ChunkType trait (#56506)
### What? Step 3 in our chunking refactors extracts ChunkItem::as_chunk into a new ChunkType trait. This new trait isn't useful yet, but will eventually allow us to collect ChunkItems of a similar type into a lists, and perform chunking over all similar items at once. ### Why? In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization. ### How? https://github.com/vercel/turbo/pull/6123 Re: https://github.com/vercel/next.js/pull/56504 Closes WEB-1724 Co-authored-by:Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
This diff is collapsed.
Please
register
or
sign in
to comment