Skip to content

feat!: replace make-fetch-happen with globalThis.fetch #849

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aduh95
Copy link

@aduh95 aduh95 commented Feb 12, 2025

This would allow shaving 1.2 MiB in the bundle size. This also removes the retry mecanism, which doesn't exist in WHATWG Fetch, but IMO that's worth it.

Copy link
Collaborator

@bdehamer bdehamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely looking forward to removing the dependency on make-fetch-happen!

My primary reservation at this point is the stability of node's native fetch in our currently supported node versions (^18.17.0 || >=20.5.0). My understanding is that fetch didn't shed the "experimental" designation until node 21 so I'm a bit hesitant to rely on it as a critical component of this library without also bumping our minimum node requirement to v21.

That's a bit tricky given that the primary consumer of this library has been npm and we have kept our supported node versions in sync with those of the oldest supported version of npm.

Of course we could always publish a new major version with this change . . . we'd just need to think through the process of supporting fixes/releases to both the the 3.x line (for npm) and the new 4.x at the same time (certainly not insurmountable, but not something we've accounted for in this project til now).

Beyond the node version issue, I'll also want to ensure that we maintain parity with the features like retry and proxy support that we're currently getting with make-fetch-happen.

@GauBen
Copy link

GauBen commented Apr 8, 2025

As a side note, Node.js dropped the experimental warning for fetch in 18.13

This does not address the retry and proxy settings though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants