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

Replace superagent with fetch library wide #492

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eligundry
Copy link

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

This commit also does the following.

- 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`.
- Cleans up unneeded development dependencies.
@spncrf
Copy link

spncrf commented Sep 10, 2023

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

@boedy
Copy link

boedy commented Mar 9, 2024

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. 🙏

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.

Is there any interest in converting this library to using fetch?
3 participants