RFC: node_compat
next steps
#1975
Replies: 6 comments 2 replies
-
I would have to dive into both crypto libraries again, but I am reasonably sure that it will be extremely hard to polyfill the nodejs And I am also pretty sure that providing runtime support for polyfills is going to be a dependency nightmare.. Where we are instantly inheriting all the backwards compatibility challenges in Node. |
Beta Was this translation helpful? Give feedback.
-
There are inherent tradeoffs, and we're aware of them, but a best effort approach is better than not having anything at all for people who want to use libraries in the ecosystem. The consequence of not having a blessed solution is that people will try anyway. |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 Thanks for all the fantastic work on the project to all you guys. When can we expect a halfway working node |
Beta Was this translation helpful? Give feedback.
-
Crypto is in progress. No specific timeline other than soon. |
Beta Was this translation helpful? Give feedback.
-
Could someone explain the serious tradeoffs? |
Beta Was this translation helpful? Give feedback.
-
We've landed preliminary support for node.js compatibility in 2.0, powered by @esbuild-plugins/node-modules-polyfill/@esbuild-plugins/node-globals-polyfill. We can also auto detect usage of node built-ins, and suggest to the user to add
node_compat = true
to theirwrangler.toml
. This was a good start. Follow up items.http
are built on XMLHTTPRequest, which isn't available in Workers. We'd need to rebuild it withfetch
(if that's feasible)cc @jasnell who I bet would be interested.
Beta Was this translation helpful? Give feedback.
All reactions