Description
What is the problem this feature would solve?
Bun's fetch and WebSocket have an issue with headers casing (they're not the same as the ones we give, see https://github.com/Vexcited/tcp-websocket#why-not-directly-use-undici- for an example)
Using undici completely fixes that since it uses node:net and node:tls to make the requests instead of builtins.
What is the feature you are proposing to solve the problem?
Today, Bun supports undici out of the box.
Removing this polyfill would allow us to not do forks of it or import tweaks to prevent Bun pollyfing the import (see https://github.com/Vexcited/tcp-websocket/blob/main/src/index.ts)
Also it would help to have a package that does requests with the exact same API and outputs the same thing on all runtimes (I tested Deno, Node.js and Bun and it always produces the same output!)
undici is pollyfilled in
- https://github.com/oven-sh/bun/tree/main/test/js/first_party/undici
- https://github.com/oven-sh/bun/blob/main/src/js/thirdparty/undici.js
- https://github.com/oven-sh/bun/blob/main/src/bun.js/bindings/Undici.h
- https://github.com/oven-sh/bun/blob/main/src/bun.js/bindings/Undici.cpp
What alternatives have you considered?
Writing my own package that tweaks the imports to make sure Bun does not polyfill it, https://github.com/Vexcited/tcp-websocket