Skip to content

Node Releases Data SSR #5438

Closed
Closed
@HinataKah0

Description

@HinataKah0

TLDR

In this PR, we introduced new data flow for Node releases.

  1. In build time, generate a static JSON file containing all Node releases.
  2. In client side, fetch the generated static JSON file using useSWR hook.
  3. 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:

  1. 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>
  1. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    website redesignIssue/PR part of the Node.js Website Redesign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions