Skip to content
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

Allow overriding Node's internal fetch #3078

Open
matthieusieben opened this issue Apr 9, 2024 · 1 comment
Open

Allow overriding Node's internal fetch #3078

matthieusieben opened this issue Apr 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@matthieusieben
Copy link
Contributor

matthieusieben commented Apr 9, 2024

This would solve...

As Node's release cycles are significantly longer than those of undici, it would be nice to be able to benefit from new features & fixes faster.

The implementation should look like...

node -r undici/overrideGlobals index.js

and/or (as suggested by @mcollina)

undici.__overrideGlobals()

I have also considered...

Writing an additional/external npm package to do the same. This would require to maintain the version of that package in sync with undici, which migh be annoying.

Additional context

Mixing Requests from Node with Requests from undici can result in unexpected behaviors. This would mitigate that by allowing to mix those, at least for the specific version of undici that gets imported.

@matthieusieben matthieusieben added the enhancement New feature or request label Apr 9, 2024
@mcollina
Copy link
Member

mcollina commented Apr 9, 2024

I'm +1 to this approrach.

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

No branches or pull requests

2 participants