netlify / gh-release-fetch

MIT License
9 stars 10 forks source link

Replace node-fetch with got #367

Closed XhmikosR closed 1 year ago

XhmikosR commented 1 year ago

The exact version depends right now. You should go with the same version of got https://github.com/XhmikosR/download is using so that deps are deduplicated.

There's https://github.com/XhmikosR/download/pull/1 pending, I'm currently trying to restore Node.js 14 compatibility and still update got. Only issue is the defaults package, let me know if you guys have any suggestions.

The savings will be huge pretty significant for gh-release-fetch and subsequently for netlify-cli, regardless. It's just that they will be even bigger after https://github.com/XhmikosR/download/pull/1 has landed and we have a new version.

XhmikosR commented 1 year ago

Actually, I now read the code, it might not be so simple, but it does feel it's an extraneous package since got is already included in your deps tree.

Feel free to close the issue if you think it's not worth it.

danez commented 1 year ago

The strategy we are going for is to remove got everywhere and only rely on fetch if possible so that in the future we won't need any package, because it will be supported in Node.js out of the box.

XhmikosR commented 1 year ago

Cool, that sounds good to me. Then maybe it'd be worth switching download to fetch sooner than later. If you make a PR, happy to review it.

PS. I'm not 100% sure we won't miss any got features but if there are no huge breaking changes, we should be safe.