unjs / ofetch

😱 A better fetch API. Works on node, browser and workers.
MIT License
4.1k stars 128 forks source link

http2 support tracker #420

Open pi0 opened 3 months ago

pi0 commented 3 months ago

there is not a direct thing we can do with ofetch to support http2 since ofetch depends on native runtime fetch as a wrapper but here are trackers:

iiAku commented 3 months ago

Do you have any idea how complicated would be to replace undici vs native fetch in ofetch ?

h2 support was added in undici at version 5.24.0 here: https://github.com/nodejs/undici/releases/tag/v5.24.0 We are now 6.19.3 if I'm not mistaken native fetch leverage undici behind

Your first checkbox Node.js - undici would definitely solve everything ofetch wise though without having to change anything.

pi0 commented 3 months ago

We are already partially pre bundling undici (via node-fetch-native) for proxy support and in next major it is gonna be merged. Honestly i prefer to avoid doing this and wait for Node.js stable releases bundle a known stable version of undici (for proxy and h2 aupport) but lets see how long it takes.