question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decide which SSR Data Fetching Library to use

See original GitHub issue

List of Libraries that has been discussed till date:

  • isomorphic-fetch
  • isomorphic-unfetch
  • axios
  • cross-fetch
  • node-fetch
  • whatwg-fetch

Last two libraries, if used, should be used together, as they are not isomorphic in nature.

@Zeko369 suggested, respective to PR https://github.com/freeCodeCamp/chapter/pull/140, we are already using isomorphic-fetch

@Sonicrida suggested axios is not maintained for a while and has some security vulnerabilities. @Shub1427 concluded that isomorphic-fetch, isomorphic-unfetch and axios hasn’t been maintained for a long period, though recently from September axios has a new core developer helping to resolve issues as fast as he could.

Regarding security vulnerability for axios, it was a false alarm as per this.

@nik-john suggested to use cross-fetch which seems a viable option, as it’s being actively maintained, and is a wrapper around node-fetch and whatwg-fetch (which I was trying to do by myself in PR https://github.com/freeCodeCamp/chapter/pull/166).

This discussion needs to be concluded, as the PR https://github.com/freeCodeCamp/chapter/pull/166 is been on hold for a long time now due to this and acts as a blocker to the same.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
nik-johncommented, Nov 25, 2019

Ok closing this as cross-fetch seems to be the consensus

@Shub1427 Hopefully this unblocks you

1reaction
nik-johncommented, Nov 26, 2019

@bernhard-hofmann It’s pretty straight forward - because we’re going to use this library extensively on Chapter (in no particular order):

  • It needs to be a robust library with no glaring open issues
  • It needs to perform all functions of an HTTP library
  • It has to be actively maintained
  • It needs to work seamlessly on the server as well as the client
  • It should have a hassle-free integration with NextJS
Read more comments on GitHub >

github_iconTop Results From Across the Web

NextJS / React SSR: 21 Universal Data Fetching Patterns ...
First, we take the client that's being injected through the React.Context. We then calculate a cache key for the query and the arguments....
Read more >
Component-level data fetching in Next.js (with SSR) - Medium
Enough Talk Let's Build It · 1. Start by creating a new next application. · 2. Install the use-sse package. · 3. Create...
Read more >
Understanding Next.js Data Fetching (CSR, SSR, SSG, ISR)
SSR - Server-Side Rendering, will run a special function to fetch data from API every page request on the server-side (before the page...
Read more >
Next.js CSR, SSR, SSG, and ISR: How to Select a Data ...
In this post, you will get detailed metrics on how to select a Next.js data fetching method that will best suit your use...
Read more >
Client-Side VS Server-Side Rendering - YouTube
Next.js is a hybrid React framework allowing you to choose your data fetching strategy on a per-page basis. In this talk, you'll learn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found