Skip to content

chore: remove logic of parallelCodeSplitting#12424

Merged
JSerFeng merged 2 commits intomainfrom
chore/remove-new-code-splitting
Dec 22, 2025
Merged

chore: remove logic of parallelCodeSplitting#12424
JSerFeng merged 2 commits intomainfrom
chore/remove-new-code-splitting

Conversation

@JSerFeng
Copy link
Copy Markdown
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
Copy Markdown

netlify bot commented Dec 11, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 2f8ed4e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6943e3326311d800089791ce
😎 Deploy Preview https://deploy-preview-12424--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@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
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 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 11, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📊 Quick Summary (Click to expand)
Project Total Size Change
react-10k 5.7 MB ➡️ 0 B (0.0%)
react-1k 823.4 KB ➡️ 0 B (0.0%)
react-5k 2.7 MB ➡️ 0 B (0.0%)
rome 984.3 KB ➡️ 0 B (0.0%)
ui-components 2.1 MB ➡️ 0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

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

📌 Baseline Commit: fb80ef1cf5 | PR: #12500

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-1k

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

📌 Baseline Commit: fb80ef1cf5 | PR: #12500

Metric Current Baseline Change
📊 Total Size 823.4 KB 823.4 KB 0 B (0.0%)
📄 JavaScript 823.4 KB 823.4 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

📁 react-5k

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

📌 Baseline Commit: fb80ef1cf5 | PR: #12500

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

📁 rome

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

📌 Baseline Commit: fb80ef1cf5 | PR: #12500

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

📁 ui-components

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

📌 Baseline Commit: fb80ef1cf5 | PR: #12500

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

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 11, 2025

📦 Binary Size-limit

Comparing 2f8ed4e to docs: enhance output.asyncChunks documentation and examples (#12500) by neverland

🎉 Size decreased by 256.88KB from 48.27MB to 48.02MB (⬇️0.52%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #12424 will not alter performance

Comparing chore/remove-new-code-splitting (2f8ed4e) with main (fb80ef1)

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
Copy Markdown
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
Copy Markdown

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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 11, 2025

CLA assistant check
All committers have signed the CLA.

@cursor
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@cursor
Copy link
Copy Markdown

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

@JSerFeng
Copy link
Copy Markdown
Contributor Author

JSerFeng commented Dec 12, 2025

@cursor fix the review comment above

1 similar comment
@JSerFeng
Copy link
Copy Markdown
Contributor Author

@cursor fix the review comment above

@cursor
Copy link
Copy Markdown

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

@JSerFeng
Copy link
Copy Markdown
Contributor Author

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

@cursor
Copy link
Copy Markdown

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

@JSerFeng JSerFeng force-pushed the chore/remove-new-code-splitting branch 2 times, most recently from bffbd37 to 6c4e99e Compare December 17, 2025 12:00
@JSerFeng JSerFeng marked this pull request as ready for review December 17, 2025 12:00
@JSerFeng JSerFeng force-pushed the chore/remove-new-code-splitting branch from 6c4e99e to 5d2e13e Compare December 18, 2025 06:14
@JSerFeng JSerFeng merged commit 744de43 into main Dec 22, 2025
76 of 78 checks passed
@JSerFeng JSerFeng deleted the chore/remove-new-code-splitting branch December 22, 2025 10:37
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