-
-
Notifications
You must be signed in to change notification settings - Fork 746
chore: remove logic of parallelCodeSplitting #12424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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 removes the deprecated experiments.parallelCodeSplitting feature from Rspack. The feature was deprecated in version 1.6.2 due to severe performance regressions in edge cases with large numbers of cyclic chunks. The removal includes all associated code, configuration options, documentation, and tests.
Key Changes
- Removed the
parallelCodeSplittingconfiguration option from all language bindings (TypeScript, Rust) - Deleted the entire alternative code splitting implementation (~1,856 lines in
new_code_splitter.rs) - Deleted the associated
available_modules.rsmodule (~205 lines) - Simplified the build chunk graph logic to always use the legacy code splitter
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| website/docs/en/config/experiments.mdx | Removed English documentation for the deprecated option |
| website/docs/zh/config/experiments.mdx | Removed Chinese documentation for the deprecated option |
| packages/rspack/src/config/types.ts | Removed TypeScript type definition for parallelCodeSplitting |
| packages/rspack/src/config/normalization.ts | Removed normalization and deprecation warning logic |
| packages/rspack/src/config/defaults.ts | Removed default value assignment |
| packages/rspack/etc/core.api.md | Removed from API documentation |
| crates/rspack_core/src/options/experiments/mod.rs | Removed field from Rust Experiments struct |
| crates/rspack_core/src/compilation/mod.rs | Removed conditional logic and unused imports |
| crates/rspack_core/src/compilation/build_chunk_graph/new_code_splitter.rs | Deleted entire alternative implementation file |
| crates/rspack_core/src/compilation/build_chunk_graph/available_modules.rs | Deleted supporting module file |
| crates/rspack_core/src/compilation/build_chunk_graph/mod.rs | Removed build_chunk_graph_new function and module declarations |
| crates/rspack_core/src/compilation/build_chunk_graph/artifact.rs | Removed NewCodeSplitter from cache, removed can_skip_rebuilding_new method |
| crates/rspack_binding_api/src/raw_options/raw_experiments/mod.rs | Removed from Node.js binding |
| crates/rspack/src/builder/mod.rs | Removed builder method for the option |
| crates/node_binding/napi-binding.d.ts | Removed from TypeScript type definitions |
| tests/rspack-test/watchCases/build-chunk-graph/runtime-chunk-recover-error/rspack.config.js | Updated test to no longer test both code splitting variants |
| tests/rspack-test/defaultsCases/default/base.js | Updated defaults test expectation |
| crates/rspack/tests/snapshots/defaults__default_options.snap | Updated snapshot |
| xtask/benchmark/benches/groups/build_chunk_graph.rs | Removed benchmark for parallel code splitting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| module.exports = [true, false].map((parallelCodeSplitting, index) => | ||
| config(index, parallelCodeSplitting) | ||
| ); | ||
| module.exports = [0, 1].map(index => config(index)); |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test now exports two identical configurations since parallelCodeSplitting was removed. This appears redundant - consider exporting a single configuration instead of duplicating it, or removing this test if it was specifically designed to test the parallelCodeSplitting feature difference.
| module.exports = [0, 1].map(index => config(index)); | |
| module.exports = config(0); |
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 258.38KB from 48.21MB to 47.96MB (⬇️0.52%) |
CodSpeed Performance ReportMerging #12424 will not alter performanceComparing Summary
Footnotes
|
|
@cursor remove the needless second config, just export one config as the |
|
Changed the watch-case config to export a single build variant now that module.exports = config(0);No other files touched; let me know if you’d like this scenario parameterized differently. Learn more about Cursor Agents |
Co-authored-by: 1114550440 <1114550440@qq.com>
|
|
|
Cursor Agent can help with this pull request. Just |
|
@cursor remove extra config definition as well, use |
module.exports = {
entry: {
entry1: "./entry1.js",
entry2: "./entry2.js"
},
output: {
filename: "[name].js"
},
optimization: {
runtimeChunk: "single"
},
experiments: {
incremental: {
buildChunkGraph: true
}
}
};Ready for another pass if more cleanup is desired. Learn more about Cursor Agents |
Co-authored-by: 1114550440 <1114550440@qq.com>
| }, | ||
| output: { | ||
| filename: `[name].${index}.js` | ||
| filename: "[name].js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 name.0.js
|
@cursor fix the review comment above |
1 similar comment
|
@cursor fix the review comment above |
|
Updated the watch-case config so the emitted files end with output: {
filename: "[name].0.js"
},Config is still exported directly with a single build variant. Let me know if you need further tweaks. Learn more about Cursor Agents |
Co-authored-by: 1114550440 <1114550440@qq.com>
|
@cursor remove 2 extra error in runtime-chunk-recover-error/1/error.js |
|
Trimmed module.exports = [
/Module parse failed/,
/JavaScript parse error: Expression expected/,
];Let me know if there are other fixtures that still reference the removed parallel splitter. Learn more about Cursor Agents |
Co-authored-by: 1114550440 <1114550440@qq.com>
Summary
Remove deprecated parallelCodeSplitting.
Related links
Checklist
Note
Removes the deprecated
experiments.parallelCodeSplittingoption and deletes the parallel code-splitting implementation, consolidating chunk graph building to a single path.new_code_splitter.rs, related helpers) and unifybuild_chunk_graphto the legacy path.parallel_code_splittingfromExperiments/builders and simplify code-splitting cache logic.parallelCodeSplittingfrom TypeScript bindings (napi-binding.d.ts) and public API (core.api.md).experiments.parallelCodeSplittingfrom defaults, normalization, and types.experiments.parallelCodeSplitting(EN/ZN).Written by Cursor Bugbot for commit ecc27b0. This will update automatically on new commits. Configure here.