Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Documents the behavior change from #12096 where global entries (entries with name: undefined) are now injected into async entrypoints (Web Workers) in addition to regular entrypoints.

Changes

Added documentation to website/docs/en/plugins/webpack/entry-plugin.mdx and website/docs/zh/plugins/webpack/entry-plugin.mdx:

  • Global Entry section: Explains that name: undefined creates a global entry whose dependencies are injected into both regular and async entrypoints
  • Use cases: webpack-dev-server HMR runtime, ModuleFederationPlugin initialization, custom plugins requiring cross-context availability
  • Example: Demonstrates global entry creation and injection behavior
// Global entries are now available in Workers
new rspack.EntryPlugin(
  context,
  './global-runtime.js',
  { name: undefined }
);

// This entry will be injected into:
// - Regular entry chunks
// - Worker entry chunks created with new Worker()

This ensures users understand that global dependencies now work correctly in Web Worker contexts.

Original prompt

submit a PR to document the new behavior in #12096, adding docs to:

website/docs/en/plugins/webpack/entry-plugin.mdx
website/docs/zh/plugins/webpack/entry-plugin.mdx


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 224a36f
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69104b484b77fa0008cc67b4
😎 Deploy Preview https://deploy-preview-12105--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.

@CLAassistant
Copy link

CLAassistant commented Nov 6, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ chenjiahan
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Add documentation for global entry behavior (when name is undefined):
- Global entries are now injected into both regular and async entrypoints
- Includes use cases for webpack-dev-server and ModuleFederationPlugin
- Added examples showing how global entries work with Workers

Related to PR #12096

Co-authored-by: chenjiahan <7237365+chenjiahan@users.noreply.github.com>
Copilot AI changed the title [WIP] Document new behavior for entry plugin docs: document global entry behavior in EntryPlugin Nov 6, 2025
Copilot AI requested a review from chenjiahan November 6, 2025 08:24
Copilot finished work on behalf of chenjiahan November 6, 2025 08:24
@chenjiahan chenjiahan marked this pull request as ready for review November 9, 2025 08:05
Copilot AI review requested due to automatic review settings November 9, 2025 08:05
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 adds documentation for the "global entry" feature of the EntryPlugin, explaining how setting the name option to undefined allows entries to be automatically injected into all entry chunks and asynchronous entries. The documentation is added in both English and Chinese versions.

  • Added new "Global entry" section explaining the behavior when name is undefined
  • Included code example demonstrating global entry usage
  • Minor text refinement in English version ("Please refer to" → "Refer to")

Reviewed Changes

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

File Description
website/docs/en/plugins/webpack/entry-plugin.mdx Added "Global entry" section with description and code example; minor wording adjustment
website/docs/zh/plugins/webpack/entry-plugin.mdx Added Chinese version of "全局入口" section with description and code example

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

@chenjiahan chenjiahan merged commit 5cba000 into main Nov 10, 2025
30 of 31 checks passed
@chenjiahan chenjiahan deleted the copilot/add-docs-entry-plugin-behavior branch November 10, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants