spotify-web-api-node icon indicating copy to clipboard operation
spotify-web-api-node copied to clipboard

Replace superagent with `fetch` library wide

Open eligundry opened this issue 1 year ago • 2 comments

Changes

  • Completely replaces superagent with Node's/the browser's fetch function.
    • This is a major version change, IMHO, as the application using this will now need to be in an environment that has the fetch function or has a fetch polyfill installed.
  • All responses return a Headers object instead of a plain object, matching the behavior of the underlying fetch calls.
  • Updates all test mocking to use jest-fetch-mock.
  • Formats all files with the correct prettier config.
  • Cleans up unneeded development dependencies.

Note to reviewer

@thelinmichael I know that this is a big pull request and it seems that you have stepped away from this project, but I would encourage you to take this seriously. I am heavily invested in the Spotify API and would love to step up and help maintain this library, as Spotify links to this library in their documentation. If you truly are not interested in maintaining this project and are going to ignore this, I am going to merge this into its own namespace (probably spotify-web-api-fetch) and just keep running with this. Just please let us know what the status of this project is.

Closes #491

eligundry avatar Jul 01 '23 19:07 eligundry

Thank you for making this and setting it up as its package! Totally necessary for getting this working with Cloudflare

spncrf avatar Sep 10 '23 20:09 spncrf

Recently, I began the transition to spotify-web-api-ts-sdk, as I encountered issues where requests would hang indefinitely without any timeouts being triggered. However, I quickly realized that the repository was still in the early stages of development. Imagine my delight upon discovering this Pull Request!

A heartfelt thank you to @eligundry for your invaluable contributions. Your spotify-web-api-fetch republication has saved me a lot of time. 🙏

boedy avatar Mar 09 '24 22:03 boedy