fix: should inject prefetch startup in entry chunk instead of runtime chunk#12233
Merged
LingyuCoder merged 1 commit intomainfrom Nov 19, 2025
Merged
fix: should inject prefetch startup in entry chunk instead of runtime chunk#12233LingyuCoder merged 1 commit intomainfrom
LingyuCoder merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where prefetch startup runtime was incorrectly being injected into runtime chunks instead of entry chunks. The fix separates the concerns by:
- Using
additional_chunk_runtime_requirementshook for startup prefetch (entry chunks only) - Keeping
additional_tree_runtime_requirementshook for on-demand prefetch/preload triggers
Reviewed Changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_runtime/src/chunk_prefetch_preload.rs | Adds new hook handler for entry chunk runtime requirements and refactors existing logic |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/rspack.config.js | Test configuration with runtime chunk enabled and assertions |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/test.config.js | Test bundle configuration specifying both runtime and main chunks |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/index.js | Test case verifying prefetch behavior with runtime chunks |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/chunk1.js | Test chunk with prefetch/preload imports |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/chunk2.js | Test chunk with prefetch/preload imports |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/chunk1-a.js | Empty test chunk file |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/chunk1-b.js | Empty test chunk file |
| tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/chunk1-c.js | Empty test chunk file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/configCases/web/prefetch-preload-runtime-chunk/index.js
Show resolved
Hide resolved
Contributor
📦 Binary Size-limit
❌ Size increased by 2.25KB from 47.47MB to 47.48MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12233 will not alter performanceComparing Summary
|
22c5f82 to
f9ec681
Compare
stormslowly
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix #12227
Related links
Checklist