TLDR
In this PR, we introduced new data flow for Node releases.
- In build time, generate a static JSON file containing all Node releases.
- In client side, fetch the generated static JSON file using
useSWR hook.
- See the PR's description for implementation details...
Now, we are considering to enable SSR / Pre-rendering with data. So, we can harness the powerful useSWR alongside the benefits of Server Side Rendering.
See https://swr.vercel.app/docs/with-nextjs#pre-rendering-with-default-data
TLDR ends :)
Things to consider:
- Maybe we are aiming to do something like this
<NodeReleasesContext.Provider value={releases}>
<SWRConfig value={{ fallback }}> -> fallback if releases is null (it happens during Server Side Rendering)
{children}
</SWRConfig>
</NodeReleasesContext.Provider>
- Maybe we can consider fetching only once, store it inside memory/RAM rather than reading from the JSON file for every requests made. This will greatly improve performance.
Currently I am also not sure how to do this so it requires exploring the options, and trials & errors.
References:
TLDR
In this PR, we introduced new data flow for Node releases.
useSWRhook.Now, we are considering to enable SSR / Pre-rendering with data. So, we can harness the powerful
useSWRalongside the benefits of Server Side Rendering.See https://swr.vercel.app/docs/with-nextjs#pre-rendering-with-default-data
TLDR ends :)
Things to consider:
Currently I am also not sure how to do this so it requires exploring the options, and trials & errors.
References: