Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Sep 29, 2025

Summary

When bundle page with Web Workers, the entry mode is not applicable to Web Workers because the Web Workers thread is isolated from the main thread (page), and the usage mode can be used at this time.

export default {
  output: {
    polyfill: 'usage',
  },
};

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings September 29, 2025 07:15
@netlify
Copy link

netlify bot commented Sep 29, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 2f72db9
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68da45f724beee0008579bdf
😎 Deploy Preview https://deploy-preview-6282--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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 about browser compatibility considerations when using Web Workers with polyfills. It explains that the entry polyfill mode doesn't work with Web Workers due to thread isolation, and recommends using the usage mode instead.

  • Adds browser compatibility sections to both English and Chinese Web Workers documentation
  • Includes tip boxes in polyfill configuration documentation explaining the Web Workers limitation
  • Provides code examples showing how to configure the usage polyfill mode

Reviewed Changes

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

File Description
website/docs/zh/guide/basic/web-workers.mdx Adds Chinese browser compatibility section with explanation and config example
website/docs/en/guide/basic/web-workers.mdx Adds English browser compatibility section with explanation and config example
website/docs/zh/config/output/polyfill.mdx Adds Chinese tip about Web Workers polyfill limitation
website/docs/en/config/output/polyfill.mdx Adds English tip about Web Workers polyfill limitation

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

@9aoy 9aoy requested a review from chenjiahan September 29, 2025 08:31
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chenjiahan chenjiahan enabled auto-merge (squash) September 29, 2025 08:41
@chenjiahan chenjiahan merged commit edc82dc into main Sep 29, 2025
11 checks passed
@chenjiahan chenjiahan deleted the web-workers-compatibility branch September 29, 2025 08:46
@chenjiahan chenjiahan mentioned this pull request Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants