Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

Summary

fix #12227

Related links

Checklist

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

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

netlify bot commented Nov 18, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit f9ec681
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691c468754ecb20008739d20
😎 Deploy Preview https://deploy-preview-12233--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 release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 18, 2025
Copilot finished reviewing on behalf of LingyuCoder November 18, 2025 09:14
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 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_requirements hook for startup prefetch (entry chunks only)
  • Keeping additional_tree_runtime_requirements hook 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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

📦 Binary Size-limit

Comparing f9ec681 to fix(types): use namespace imports for Node.js built-in modules (#12232) by Cong-Cong Pan

❌ Size increased by 2.25KB from 47.47MB to 47.48MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 18, 2025

CodSpeed Performance Report

Merging #12233 will not alter performance

Comparing fix/entry-chunk-prefetch-startup (f9ec681) with main (1a83ce4)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder force-pushed the fix/entry-chunk-prefetch-startup branch from 22c5f82 to f9ec681 Compare November 18, 2025 10:12
@LingyuCoder LingyuCoder enabled auto-merge (squash) November 18, 2025 10:25
@LingyuCoder LingyuCoder merged commit 0b8a3bb into main Nov 19, 2025
119 of 124 checks passed
@LingyuCoder LingyuCoder deleted the fix/entry-chunk-prefetch-startup branch November 19, 2025 02:42
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]: webpackPrefetch magic comment caused invalid requests since v1.5.0-beta.0

3 participants