Replies: 3 comments 4 replies
-
This falls outside of the scope of wintercg as this is a node specific API. Node.js is the standard on this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for opening the public discussion dear @vicb. Currently, the list of 68 built-ins in unenv is exactly identical to the one included in #2636 so at least workerd, Node.js, and unenv are consistent with each other. I do agree that also other runtimes (Deno/Bun) should not be used as a reference and they might be simply lagging behind from the latest Node.js behavior (or have some very specific reasons to not enlist some builtins) (...about unenv...) In unenv, we do provide polyfills that tend to mimic the closest-possible Node.js runtime behavior regardless of runtime that the code is bundled for either Bun, Deno, Node.js, or workerd (with node_compat flag enabled or not) We adjust the behavior of unenv polyfills always based on real-world scenarios (known dependencies that are made for Node.js and end up in the user's bundle should work as intended). The reason I have asked to keep the explicit list in unenv for
This is a valid point 👍🏼 but also as you also pointed out @vicb in our private discussion, one thing can break another. Today consistent (...one idea as middle ground...) I believe current #2636 behavior is best for best compatibility but as another middle ground, workerd might (same as other new hybrid natives like |
Beta Was this translation helpful? Give feedback.
-
Honestly, it's not exactly clear what the "right" solution is or even if there is one. I think that maybe, however, given the questions here, #2636 should probably just drop the |
Beta Was this translation helpful? Give feedback.
-
We have discussed with @jasnell and @pi0 about what the behavior of
module.isBuiltin
andmodule.builtinModules
should be.Different runtimes have different behaviors.
People have different opinions:
Probably the best way to move forward would be to rely on a standard.
As such the different runtimes could rely on that standard and the library could also rely on that standard.
Maybe WinterCG could help here?
Thoughts?
/cc @IgorMinar
Ref:
Beta Was this translation helpful? Give feedback.
All reactions