Skip to content

Conversation

@JSerFeng
Copy link
Contributor

@JSerFeng JSerFeng commented Dec 11, 2025

Summary

Remove deprecated parallelCodeSplitting.

Related links

Checklist

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

Note

Removes the deprecated experiments.parallelCodeSplitting option and deletes the parallel code-splitting implementation, consolidating chunk graph building to a single path.

  • Core:
    • Delete parallel code-splitting implementation (new_code_splitter.rs, related helpers) and unify build_chunk_graph to the legacy path.
    • Remove parallel_code_splitting from Experiments/builders and simplify code-splitting cache logic.
  • API/Bindings:
    • Drop parallelCodeSplitting from TypeScript bindings (napi-binding.d.ts) and public API (core.api.md).
  • Config:
    • Remove handling of experiments.parallelCodeSplitting from defaults, normalization, and types.
  • Docs:
    • Remove documentation for experiments.parallelCodeSplitting (EN/ZN).
  • Tests/Benchmarks:
    • Update snapshots and configs to exclude the option; remove parallel code-splitting benchmark and test variants.

Written by Cursor Bugbot for commit ecc27b0. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 11, 2025 09:52
@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 05ab715
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/693bba9f53d4970008dbd969

@JSerFeng JSerFeng marked this pull request as draft December 11, 2025 09:52
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Dec 11, 2025
Copy link
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 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 parallelCodeSplitting configuration 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.rs module (~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));
Copy link

Copilot AI Dec 11, 2025

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.

Suggested change
module.exports = [0, 1].map(index => config(index));
module.exports = config(0);

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 127d0af7b7 | PR: #12405

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB 0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-10k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 127d0af7b7 | PR: #12405

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-5k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: 127d0af7b7 | PR: #12405

Metric Current Baseline Change
📊 Total Size 823.6 KB 823.6 KB 0 B (0.0%)
📄 JavaScript 823.6 KB 823.6 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: 127d0af7b7 | PR: #12405

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: 127d0af7b7 | PR: #12405

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

📦 Binary Size-limit

Comparing 05ab715 to chore(ci): fix artifact discovery logic in Rsdoctor action (#12405) by yifancong

🎉 Size decreased by 258.38KB from 48.21MB to 47.96MB (⬇️0.52%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #12424 will not alter performance

Comparing chore/remove-new-code-splitting (05ab715) with main (127d0af)

Summary

✅ 16 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@JSerFeng
Copy link
Contributor Author

@cursor remove the needless second config, just export one config as the parallelCodeSplitting is removed tests/rspack-test/watchCases/build-chunk-graph/runtime-chunk-recover-error/rspack.config.js

@cursor
Copy link

cursor bot commented Dec 11, 2025

Changed the watch-case config to export a single build variant now that parallelCodeSplitting is gone; the redundant array mapping was removed so the test only runs once.

module.exports = config(0);

No other files touched; let me know if you’d like this scenario parameterized differently.


Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: 1114550440 <1114550440@qq.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ JSerFeng
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor
Copy link

cursor bot commented Dec 11, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@JSerFeng
Copy link
Contributor Author

@cursor remove extra config definition as well, use module.export = config

@cursor
Copy link

cursor bot commented Dec 11, 2025

  • Dropped the helper factory and now export the config object directly (module.exports = { ... }) per the review note.
  • Output filename no longer uses an index placeholder since only a single build variant remains.
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.


Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: 1114550440 <1114550440@qq.com>
},
output: {
filename: `[name].${index}.js`
filename: "[name].js"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

改成 name.0.js

@JSerFeng
Copy link
Contributor Author

JSerFeng commented Dec 12, 2025

@cursor fix the review comment above

1 similar comment
@JSerFeng
Copy link
Contributor Author

@cursor fix the review comment above

@cursor
Copy link

cursor bot commented Dec 12, 2025

Updated the watch-case config so the emitted files end with .0, per the review:

	output: {
		filename: "[name].0.js"
	},

Config is still exported directly with a single build variant. Let me know if you need further tweaks.


Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: 1114550440 <1114550440@qq.com>
@JSerFeng
Copy link
Contributor Author

@cursor remove 2 extra error in runtime-chunk-recover-error/1/error.js

@cursor
Copy link

cursor bot commented Dec 12, 2025

Trimmed runtime-chunk-recover-error/1/errors.js down to the two expected patterns so the watch test only asserts the unique errors:

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.


Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: 1114550440 <1114550440@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants