Skip to content
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

Introduce --nodejs_compat_unleashed runtime flag #2133

Closed
IgorMinar opened this issue May 16, 2024 · 4 comments
Closed

Introduce --nodejs_compat_unleashed runtime flag #2133

IgorMinar opened this issue May 16, 2024 · 4 comments
Assignees
Labels
feature request Request for Workers team to add a feature nodejs compat

Comments

@IgorMinar
Copy link
Contributor

As we improve our node.js compat story, it would be great have a runtime flag that offers a more "aggressive" and compatible version of --nodejs_compat runtime flag. We could call this flag --node_compat_unleashed or similar.

This new flag should expose supported node builtin modules without the node: prefix, and should also expose globals like process, Buffer on globalThis.

We can then test with this flag, and at some point in the near future, this flag would be activated via a compat date as long as nodejs_compat is present (essentially making the existing nodejs_compat become nodejs_compat_unleashed once the compatibility date is reached or exceeded.

Originally proposed in https://chat.google.com/room/AAAAZwUYa48/4rD9Yjauj9w/yE5EU56IaRg?cls=10

@kentonv
Copy link
Member

kentonv commented May 20, 2024

Bikeshed comment: The name "unleashed" sounds a little, uh, silly to me. Maybe nodejs_compat_no_prefix or _no_namespace or something?

@IgorMinar
Copy link
Contributor Author

I'm not attached to the name. The flag should in addition to unprefixing modules also introduce node's globals, so no_prefix seems not comprehensive enough.

@jasnell
Copy link
Member

jasnell commented May 20, 2024

heh, yeah, I wasn't going to go with "unleashed" ;-) ... I'll be working on this in the coming couple of weeks, want to get the Request.cache stuff done first, then will do this next.

@jasnell
Copy link
Member

jasnell commented May 21, 2024

Initial draft implementation in #2147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for Workers team to add a feature nodejs compat
Projects
None yet
Development

No branches or pull requests

3 participants