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

Consider using superagent instead of axios for better JSON API support #4

Open
spleshka opened this issue Jun 28, 2017 · 3 comments
Open

Comments

@spleshka
Copy link
Member

spleshka commented Jun 28, 2017

I've noticed that devs at Lullabot use axios library for API calls to the backend. However, what we've found during the development for our clients, there is a great library which has awesome support for JSON API standard:

The last mentioned library provides really great DX for data processing which comes from D8 JSON API module:

  • Much less nested response structure
  • All attached data is being wrapped in magic fields which make them accessible as it was added straight to data (for example, you don't have to search for image data in the attachment, you can get image url as it was a usual node title)
  • Many more
@yann-yinn
Copy link

Interesting, for https://github.com/contentacms/contenta_vue_nuxt we used a combination of waterwheel + jsonapi-parse + axios. Maybe this could have been reduced to Waterwheel + SuperAgent-jsonapify ?

@justafish
Copy link
Member

We can use the normal fetch API instead of either Axios or SuperAgent, with a polyfill for node https://www.npmjs.com/package/isomorphic-fetch

@andrewfandrew
Copy link

andrewfandrew commented Nov 25, 2018

@justafish I am trying to develop this repo using the isomorphic-fetch method you recommend. I have today seen that spelshka (Evgeniy) has built a fully-fledged react demo app in a separate repo. But I want to continue development of your demo app. That is: based on create-react-app and isomorphic-fetch. I and my colleague are hoping to develop our React skills along the way. Please advise me on the best way i can contribute to this repo.

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

No branches or pull requests

4 participants