refactor: rename rspack_futures to rspack_parallel#13547
Conversation
There was a problem hiding this comment.
Pull request overview
This PR renames the internal async/concurrency helper crate from rspack_futures to rspack_parallel, updates call sites to use rspack_parallel::scope, and wires the new crate through the workspace and affected plugins/core modules.
Changes:
- Replace
rspack_futures::scopeusages withrspack_parallel::scopeacrossrspack_coreand multiple plugins. - Introduce/expand
rspack_parallelcrate packaging (workspace dep, Cargo.lock entry) and removerspack_futurescrate metadata. - Move/re-export iterator consumer utilities via
rspack_parallel(and re-export them fromrspack_core::utils).
Reviewed changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_split_chunks/src/plugin/module_group.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_split_chunks/src/plugin/max_size.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_split_chunks/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_size_limits/src/lib.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_size_limits/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_real_content_hash/src/lib.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_real_content_hash/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_javascript/src/runtime.rs | Switch scoped concurrency helper to rspack_parallel::scope in runtime rendering paths. |
| crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_javascript/src/plugin/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope in module rendering. |
| crates/rspack_plugin_javascript/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_esm_library/src/split_chunks.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_esm_library/src/link.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_esm_library/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs | Update doc comment and switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_devtool/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_plugin_css/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| crates/rspack_parallel/src/scope.rs | Update docs/examples to reference rspack_parallel::scope. |
| crates/rspack_parallel/src/lib.rs | Add iterator consumer module and re-export consumer traits. |
| crates/rspack_parallel/src/iterator_consumer/mod.rs | Add module wiring for iterator consumer utilities. |
| crates/rspack_parallel/src/iterator_consumer/future.rs | Use spawn_in_compiler_context for spawned futures. |
| crates/rspack_parallel/src/iterator_consumer/rayon.rs | Add rayon iterator consumer helper. |
| crates/rspack_parallel/src/iterator_consumer/rayon_fut.rs | Use spawn_in_compiler_context for spawned futures from rayon iterators. |
| crates/rspack_parallel/Cargo.toml | Define new crate metadata/deps for rspack_parallel. |
| crates/rspack_parallel/LICENSE | Add MIT license file for the crate. |
| crates/rspack_futures/Cargo.toml | Remove old crate manifest. |
| crates/rspack_core/src/utils/mod.rs | Re-export iterator consumer traits from rspack_parallel and drop local module. |
| crates/rspack_core/src/concatenated_module.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/src/compiler/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/src/compilation/runtime_requirements/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/src/compilation/create_module_hashes/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/src/compilation/create_hash/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope in multiple phases. |
| crates/rspack_core/src/compilation/create_chunk_assets/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/src/compilation/code_generation/mod.rs | Switch scoped concurrency helper to rspack_parallel::scope. |
| crates/rspack_core/Cargo.toml | Replace rspack_futures dependency with rspack_parallel. |
| Cargo.toml | Swap workspace dependency entry from rspack_futures to rspack_parallel. |
| Cargo.lock | Remove rspack_futures package entry and add rspack_parallel. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 7.16KB from 49.06MB to 49.07MB (⬆️0.01%) |
Merging this PR will not alter performance🎉 Hooray!
|
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
f2cbde7 to
4b63029
Compare
Summary
spawn_in_contextto rspack_tasks to proxy it when the context exists. This method is compatible with unit tests.RayonFutureConsumerRelated links
Checklist