refactor(split_chunks_new): asyncify prepare_module_group_map
#2975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue (if exists)
Summary
name
function provided by the JS side🤖 Generated by Copilot at ceb67d6
This pull request adds async and parallel processing to the
rspack_plugin_split_chunks_new
crate, which implements a plugin for splitting modules into chunks based on cache groups. It also updates the cache group and module group structs to use functions for generating chunk names instead of fixed strings, and handles unnamed and dynamic chunk names in the plugin logic. It adds new dependencies and imports to support these features.Walkthrough
🤖 Generated by Copilot at ceb67d6
futures-util
crate as a dependency for working with async code (link, link)async-scoped
andtokio
crates as dependencies for enabling async and parallel processing of modules and cache groups inrspack_plugin_split_chunks_new
crate (link, link)ChunkNameGetter
type and function for dynamically generating chunk names based on modules incommon.rs
(link)CacheGroup
struct to useChunkNameGetter
instead ofString
forname
field inraw_split_chunks.rs
andcache_group.rs
(link, link)ModuleGroup
struct to useOption<String>
instead ofString
forchunk_name
field inmodule_group.rs
(link)SplitChunksPlugin
struct to use async functions and tasks for processing modules and cache groups inplugin.rs
(link, link, link, link, link)create_chunk
method ofSplitChunksPlugin
to handle module groups without chunk names inplugin.rs
(link)ChunkNameGetter
and related types and functions fromcommon
module incache_group.rs
andlib.rs
(link, link, link)TokioScope
fromasync_scoped
crate inplugin.rs
(link)