-
Notifications
You must be signed in to change notification settings - Fork 232
Replace axios with native fetch #31
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
Conversation
All of our tests currently stub out Converting this PR to draft until we have some coverage to verify these changes. |
Wonderful, this is much better. What versions of node are you targeting? the ideal way to use fetch is to 1. accept it as an argument (for unit tests) but default to looking for a global fetch function, which is now available in node 18+ and all other JS envs |
We don't have a documented policy, but LTS (currently >=18)) seems sensible. |
Great, then there is no reason to use cross-fetch, as fetch is available globally in node 18+ without a flag |
This is great. Was going to fork this library to use inside a Cloudflare Worker. They don't support node (so axios does not work), but they do support a browser-like |
Now that we're mocking HTTP responses with nock (#38), this is now ready for review. |
🎉 cc @gr2m |
Related to #29 (comment)
This PR should do exactly that. I'm out of the loop about preferred
fetch
polyfill libraries and other packaging concerns, so if you have any strong opinions, please let me know!