gaxios
gaxios copied to clipboard
feat!: Upgrade to `node-fetch` v3
Fixes #429 Fixes #508
🦕
Warning: This pull request is touching the following templated files:
- README.md -
README.md
is managed bysynthtool
. However, a partials file can be used to update the README, e.g.: https://github.com/googleapis/nodejs-storage/blob/main/.readme-partials.yaml
We'll merge this once we're ready to drop Node 14/16 (which is WIP)
General question / comment I know that both fetch
and FormData
are marked experimental stability in Node 18 but does it make more sense to free ourselves from node-fetch
as opposed to upgrading? Edit: looks like it is marked stable as of Node 21.
General question / comment I know that both
fetch
andFormData
are marked experimental stability in Node 18 but does it make more sense to free ourselves fromnode-fetch
as opposed to upgrading? Edit: looks like it is marked stable as of Node 21.
I was a bit torn on this decision; technically it would be experimental, however the API surface hasn't really changed since its introduction. The catch is the experimental
warnings for customers below v18.13 (which we'd likely have to support given engines would be >=18.0.0
). However, I would be surprised if a lot of folks are actually using an old version of 18, without any security patches/minor features whatsoever - I would suspect those pre-LTS early adopters would've upgraded by now.
Outside from that, internally we would need to use a beta version of nock, which includes unidici support - it seems to work fine in testing.
Ah I hadn't even considered nock not supporting it. I wonder if by the time we are ready to move to Node 18 nock will be out of the beta phase.
Created a proof-of-concept for migrating to fetch
, along with current limitations:
- https://github.com/googleapis/gaxios/pull/618
Node 18 & 20 pass in this commit 👌🏽:
- https://github.com/googleapis/gaxios/pull/617/commits/35a73b1e35ffb2fd1b93ccac2b91fae93ad91d72