Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Remove redundant module.instantiate() calls in the module runners. module.instantiate has been removed since Node.js >= 13.0.0.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings August 2, 2025 07:50
@netlify
Copy link

netlify bot commented Aug 2, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 85f1a2b
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/688dc4580c699800088ed0a9
😎 Deploy Preview https://deploy-preview-5743--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: 77 (🟢 up 23 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 removes redundant module.instantiate() calls from the module runners, as this method was removed from Node.js starting with version 13.0.0. The changes clean up outdated code that is no longer needed.

  • Removes deprecated module.instantiate() calls from ESM and synthetic module runners
  • Improves variable naming in the asModule function for better clarity
  • Simplifies code structure by removing unnecessary conditional instantiate calls

Reviewed Changes

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

File Description
packages/core/src/server/runner/esm.ts Removes redundant esm.instantiate() call that is no longer needed
packages/core/src/server/runner/asModule.ts Removes m.instantiate() call and improves variable naming from m to syntheticModule
Comments suppressed due to low confidence (1)

packages/core/src/server/runner/asModule.ts:32

  • The removal of the instantiate() call should be covered by tests to ensure the module evaluation still works correctly without it, especially since this is a breaking change from older Node.js versions.
  await syntheticModule.evaluate();

@chenjiahan chenjiahan merged commit 0227d29 into main Aug 2, 2025
11 checks passed
@chenjiahan chenjiahan deleted the module_instantiate_0802 branch August 2, 2025 08:01
@chenjiahan chenjiahan mentioned this pull request Aug 3, 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.

2 participants