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

chore(deps): migrate to node-fetch-native #8157

Closed
wants to merge 3 commits into from
Closed

Conversation

antfu
Copy link
Member

@antfu antfu commented May 13, 2022

See https://github.com/unjs/node-fetch-native for reason. We were blocked by ESM only of node-fetch v3.

@bluwy
Copy link
Member

bluwy commented May 13, 2022

Correct me if I'm wrong, but we were blocked by node-fetch v3 because Jest doesn't work with ESM-only package, and with Vitest it should be fine now. Or is there more behind this?

@antfu
Copy link
Member Author

antfu commented May 13, 2022

Oh yeah, that's a good point. We could probably just upgrade it. I am just thinking to be able to use the native fetch in Node v18 is a good thing to have. It's not a big deal and I am fine with either way.

patak-dev
patak-dev previously approved these changes May 13, 2022
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

I think being able to use native fetch is good enough to justify this change 👍🏼

@bluwy
Copy link
Member

bluwy commented May 13, 2022

If we want to emulate node 18 native fetch, should we do import 'node-fetch-native/polyfill' instead in this PR? If we want to stick to importing from the module, I think upgrading node-fetch to v3 would suffice too.

@benmccann benmccann mentioned this pull request May 16, 2022
11 tasks
@sodatea
Copy link
Member

sodatea commented May 17, 2022

If we are going to use the native fetch eventually, we can replace node-fetch with undici https://undici.nodejs.org/#/

Node.js fetch uses this library underlyingly nodejs/node#41749

@antfu
Copy link
Member Author

antfu commented May 17, 2022

This reverts commit 79c8fb0.
@antfu antfu closed this Aug 23, 2022
@antfu antfu deleted the chore/node-fetch-native branch March 8, 2023 10:51
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.

None yet

4 participants