-
-
Notifications
You must be signed in to change notification settings - Fork 735
fix: should inject prefetch startup in entry chunk instead of runtime chunk #12233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 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
📦 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
Summary
fix #12227
Related links
Checklist