ofetch icon indicating copy to clipboard operation
ofetch copied to clipboard

http2 support tracker

Open pi0 opened this issue 1 year ago • 3 comments

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:

  • [ ] Node.js - undici (https://github.com/nodejs/undici/issues/2750)
  • [ ] Bun (https://github.com/oven-sh/bun/issues/7194)
  • [ ] Deno (already enabled?!) (https://github.com/unjs/ofetch/issues/420)

pi0 avatar Jul 24 '24 20:07 pi0

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.

yoann-gendrey avatar Jul 24 '24 20:07 yoann-gendrey

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.

pi0 avatar Jul 25 '24 08:07 pi0

@pi0 Fyi, the mentioned issue in NodeJS https://github.com/nodejs/undici/issues/2750 has been closed (it's no longer experimental but only used as default under certain conditions)

jelmerdemaat avatar Feb 06 '25 02:02 jelmerdemaat