-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
perf(module-runner): add client-side builtin module check #20924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
perf(module-runner): add client-side builtin module check #20924
Conversation
@sapphi-red Thank you for your feedback. The requested modifications have been implemented. The builtins option is now optional and will be automatically fetched from the server upon first use. We have also verified that the tests related to the modified runner.ts file are functioning correctly. |
Would you add a test to |
Sure! I'll add a test to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've pushed minor changes while resolving the conflict.
Description
Fixes #20840
This PR moves the isBuiltin check from the server side to the module runner side to avoid unnecessary server round-trips when importing builtin modules (e.g.,
node:fs
,node:path
).Module runner checks builtin modules client-side first. The server-side check remains as a fallback for custom runner implementations.
Changes
builtins
option to ModuleRunnerOptions interfacebuiltins
config to runner