-
Notifications
You must be signed in to change notification settings - Fork 760
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
implement --polyfill-node
/ config.polyfill_node
#101
Comments
I had an interesting thought, not sure if this is useful or not. Workers APIs seem to follow much more closely to modern browser APIs than Node.js ones which got me thinking of Deno (which also does so) and how it would be nice if wrangler could have its own built-in runtime with said polyfills. Then I remembered the |
Wow. I'm so looking forward to having an open-sourced Workers runtime and trying it with wrangler2. Great job to everyone at Cloudflare and beyond who made that happen!! |
We landed initial support for this in 2.0 (as |
Lots of libraries in the ecosystem assume a node.js environment. Those modules just aren't available in Workers, but some can be polyfilled (e.g -
path
,url
, etc). I made an attempt at landing this in #72, but removed it in #100 because the polyfills are made for the browser, not Workers (eg - thehttp
polyfill assumes the presence ofXMLHTTPRequest
). Some polyfills just don't exist (eg -crypto
). It's all quite bad really, and it's not good enough even as a prototype.So this issue tracks the proper implementation of this feature. We'll have to implement some of them scratch, and have proper messaging around the ones that do get used.
The text was updated successfully, but these errors were encountered: