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

Swap superagent for a fetch API based request library #317

Open
1 task
srallen opened this issue Dec 5, 2018 · 3 comments
Open
1 task

Swap superagent for a fetch API based request library #317

srallen opened this issue Dec 5, 2018 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@srallen
Copy link
Contributor

srallen commented Dec 5, 2018

Package lib-panoptes-js

Feature or Issue Description
The panoptes.js library currently uses superagent for http request. Superagent is a mature and robust library that handles common security concerns and uses XHR for full browser support. However, we have decided to not support IE11 and all other modern browsers support the the Fetch API: https://caniuse.com/#search=fetch

Since we do not need to support XHR anymore and because we're starting to use service workers (SWs do not support XHR either), perhaps we should switch to a Fetch API based request library. frisbee looks promising.

(There's no rush to do this either)

To Dos

  • Example
@srallen srallen added enhancement New feature or request question Further information is requested labels Dec 5, 2018
@rogerhutchings
Copy link
Contributor

There's also the option of using a Relay client as more GraphQL resources get added, which I would prefer since we over/underfetch a fair bit.

@srallen
Copy link
Contributor Author

srallen commented Dec 18, 2018

I'd add that as an addition, perhaps as a set of pre-written helpers like I've done already, not as a replacement of fetch since fetch is native and I don't think the RESTful endpoints are going away anytime soon?

@goplayoutside3
Copy link
Contributor

We plan to continue using Next.js in app-root and app-project for the foreseeable future, and he Next.js app router expects data-fetching to use fetch (if fetching data serverside). I've added this Issue to the FEM planning spreadsheet and Maintenance board with the goal of replacing superagent with native fetch in lib-panoptes-js. This work is also linked to #5995 because PJC uses superagent, and we also want to remove legacy PJC from FEM in favor of lib-panoptes-js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
Status: To do
Development

No branches or pull requests

3 participants