Skip to content

Conversation

LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Sep 28, 2025

Summary

try to fix #11082

We group chunks based on the parent-child relationship of chunk groups, so as to process the chunks in the child chunk group first and then those in the parent chunk group, thereby preventing to build the relation graph of chunks.

However, in the runtime chunk, it depends on other chunks in the same chunk group. This means that if it is processed first, the placeholders of normal chunks inside it will not be replaced. Therefore, runtime chunks need to be separated into another batch and processed after all the normal chunks in the same chunk group have been processed.

Related links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings September 28, 2025 10:55
Copy link

netlify bot commented Sep 28, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 3bc47cf
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68da1e698b09ae0008668a4a
😎 Deploy Preview https://deploy-preview-11778--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.

@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 Sep 28, 2025
Copy link
Contributor

@Copilot 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 the processing order of runtime chunks in the SRI (Subresource Integrity) plugin to ensure runtime chunks are processed after normal chunks within the same chunk group. The change aims to resolve issue #11082 by modifying the chunk processing logic.

  • Simplified module detection logic by removing module federation-specific checks
  • Changed chunk processing order to separate and prioritize runtime chunks appropriately
  • Removed unnecessary dependency on rspack_plugin_mf module

Reviewed Changes

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

File Description
crates/rspack_plugin_sri/src/runtime.rs Simplified module detection and removed module federation imports
crates/rspack_plugin_sri/src/asset.rs Modified chunk processing to separate runtime chunks from normal chunks
crates/rspack_plugin_sri/Cargo.toml Removed unused rspack_plugin_mf dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

github-actions bot commented Sep 28, 2025

📦 Binary Size-limit

Comparing 3bc47cf to chore(deps): update swc (#11747) by renovate[bot]

❌ Size increased by 640bytes from 47.89MB to 47.89MB (⬆️0.00%)

Copy link

codspeed-hq bot commented Sep 28, 2025

CodSpeed Performance Report

Merging #11778 will not alter performance

Comparing fix/sri-chunk-order (3bc47cf) with main (7b6e5c7)1

Summary

✅ 17 untouched

Footnotes

  1. No successful run was found on main (7259fca) during the generation of this report, so 7b6e5c7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LingyuCoder LingyuCoder changed the title fix: should process runtime chunk after normal chunks of in same chunk group fix: should process runtime chunk after normal chunks of same chunk group Sep 28, 2025
@LingyuCoder LingyuCoder enabled auto-merge (squash) September 29, 2025 06:36
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.

[Bug]: use splitChunks.chunks='all' and sri plugins Error:ERROR in × Asset XXX contains unresolved integrity placeholders
1 participant