Skip to content

refactor: rename rspack_futures to rspack_parallel#13547

Merged
jerrykingxyz merged 5 commits intomainfrom
jerry/refactor
Mar 31, 2026
Merged

refactor: rename rspack_futures to rspack_parallel#13547
jerrykingxyz merged 5 commits intomainfrom
jerry/refactor

Conversation

@jerrykingxyz
Copy link
Copy Markdown
Contributor

@jerrykingxyz jerrykingxyz commented Mar 31, 2026

Summary

  • rename rspack_futures crate to rspack_parallel
  • move rspack_core::utils::iterator_consumer to rspack_parallel
  • Add spawn_in_context to rspack_tasks to proxy it when the context exists. This method is compatible with unit tests.
  • remove RayonFutureConsumer

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@jerrykingxyz jerrykingxyz requested a review from JSerFeng as a code owner March 31, 2026 06:56
Copilot AI review requested due to automatic review settings March 31, 2026 06:56
@github-actions github-actions Bot added release: refactor team The issue/pr is created by the member of Rspack. labels Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::scope usages with rspack_parallel::scope across rspack_core and multiple plugins.
  • Introduce/expand rspack_parallel crate packaging (workspace dep, Cargo.lock entry) and remove rspack_futures crate metadata.
  • Move/re-export iterator consumer utilities via rspack_parallel (and re-export them from rspack_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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

📦 Binary Size-limit

Comparing 09b9ba4 to chore(security): use rspack scoped mocked react (#13551) by pshu

❌ Size increased by 7.16KB from 49.06MB to 49.07MB (⬆️0.01%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 31, 2026

Merging this PR will not alter performance

🎉 Hooray! codspeed-node just leveled up to 5.2.0!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

✅ 9 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing jerry/refactor (09b9ba4) with main (24f3816)

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (24f3816d8d) does not have baseline artifacts. Using commit b3b66a3c37 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 826.3 KB 0
react-5k 2.7 MB 0
rome 984.2 KB 0
ui-components 2.3 MB 0

Generated by Rsdoctor GitHub Action

@jerrykingxyz jerrykingxyz merged commit 094d714 into main Mar 31, 2026
72 of 78 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/refactor branch March 31, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants