Skip to content

fix: only filter experimental warnings by default#845

Merged
9aoy merged 7 commits intomainfrom
filter-warning
Jan 9, 2026
Merged

fix: only filter experimental warnings by default#845
9aoy merged 7 commits intomainfrom
filter-warning

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Jan 8, 2026

Summary

only filter experimental warnings by default.

Related Links

Checklist

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

Currently, if we use some experimental features of Node.js, such as `fs/promises`, it will display `ExperimentalWarning`. This is very annoying, so we should filter it out by default.
Copilot AI review requested due to automatic review settings January 8, 2026 08:25
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 8, 2026

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 112fd38
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/695f97b4a8be9f000891449a
😎 Deploy Preview https://deploy-preview-845--rstest-dev.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.

Copy link
Copy Markdown
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 refines warning suppression in worker processes to only filter experimental warnings instead of suppressing all warnings. The previous implementation used --no-warnings flag which suppressed all Node.js warnings, while the new approach uses a custom require script to selectively filter only ExperimentalWarning types, allowing other important warnings to be displayed.

Key changes:

  • Created a new CommonJS module (rstestSuppressWarnings.cjs) that intercepts the process.emit method to filter out ExperimentalWarning types
  • Replaced --no-warnings flag with --require flag pointing to the new suppression script
  • Added test coverage to verify that non-experimental warnings (like MaxListenersExceededWarning) are still displayed while ExperimentalWarning is suppressed

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core/src/pool/rstestSuppressWarnings.cjs New module that selectively suppresses only ExperimentalWarning by intercepting process.emit
packages/core/src/pool/index.ts Replaces --no-warnings flag with --require pointing to the suppression script
packages/core/rslib.config.ts Adds copy configuration to include the new .cjs file in the build output
e2e/worker/index.test.ts Adds test to verify warnings are handled correctly
e2e/worker/fixtures/node.warning.test.ts Test fixture that triggers MaxListenersExceededWarning
e2e/worker/fixtures/worker.error.config.ts Config fixture (appears unused)

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

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@9aoy 9aoy merged commit eca3cab into main Jan 9, 2026
33 of 35 checks passed
@9aoy 9aoy deleted the filter-warning branch January 9, 2026 03:44
@9aoy 9aoy mentioned this pull request Jan 9, 2026
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.

2 participants