Skip to content

fix: generate stable extract css runtime by sorting css chunks#12246

Merged
LingyuCoder merged 3 commits intomainfrom
fix/stable-extract-css-runtime
Nov 20, 2025
Merged

fix: generate stable extract css runtime by sorting css chunks#12246
LingyuCoder merged 3 commits intomainfrom
fix/stable-extract-css-runtime

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Nov 20, 2025

Summary

Should sort css chunks when generating css extract runtime modules.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 20, 2025 03:18
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 886f488
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691ea8e8f53335000815c119

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Nov 20, 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 fixes non-deterministic CSS runtime generation by sorting CSS chunks before they are included in the output, ensuring stable and reproducible builds.

  • Adds sorting to CSS chunk entries in the runtime module using sorted_unstable() from itertools
  • Follows the same pattern used elsewhere in the rspack codebase for ensuring deterministic output
  • Adds itertools as a dependency to the extract_css plugin

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
crates/rspack_plugin_extract_css/src/runtime.rs Added .sorted_unstable() call to ensure CSS chunks are sorted before being collected into the runtime output
crates/rspack_plugin_extract_css/Cargo.toml Added itertools dependency to support the sorting functionality
Cargo.lock Updated lock file to reflect the new itertools dependency for rspack_plugin_extract_css

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

📦 Binary Size-limit

Comparing 886f488 to chore: disable Rslint warnings (#12243) by neverland

❌ Size increased by 256bytes from 47.62MB to 47.62MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 20, 2025

CodSpeed Performance Report

Merging #12246 will not alter performance

Comparing fix/stable-extract-css-runtime (886f488) with main (1f482b5)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder requested a review from JSerFeng November 20, 2025 06:41
@LingyuCoder
Copy link
Contributor Author

passed rstackjs/rspack-plugin-ci#11

@LingyuCoder LingyuCoder merged commit 5cf12ec into main Nov 20, 2025
47 checks passed
@LingyuCoder LingyuCoder deleted the fix/stable-extract-css-runtime branch November 20, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) 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