Skip to content

Consolidate Node Releases Data Logic #5350

Closed

Description

@HinataKah0

Design:

  1. In Build time, generate a static JSON file containing all Node releases (filtered & destructured nodevu's outputs which will greatly reduced the generated JSON file size).
  2. In Client side, fetch the generated static JSON file using useSWR hook, do formatting & time sensitive logic (e.g. computing the release status).
  3. Then, the ready-to-consume data is passed through the component tree using Context & Provider.
  4. Implement WithNodeRelease component which acts as a guard (not to render a component if can't find a specific Node release, e.g. LTS or Current).

Legacy useNodeData hook will be removed and legacy usages in nodejs.org will be updated.

References:

Activity

  1. ovflowd commented on May 3, 2023

    @ovflowd
    Member

    @HinataKah0 I guess in this case we should not migrate, but simply outsource what we have on the download-releases layout on nodejs.org into a dedicated React Provider as I mentioned.. 🤔

  2. changed the title [-]Migrate `NodeReleaseData` Fetcher from nodejs.dev[/-] [+]Extract `DownloadReleasesLayout` `/dist/index.json` Fetcher Into Context + Provider[/+] on May 3, 2023
  3. added
    website redesign
    on May 4, 2023
  4. changed the title [-]Extract `DownloadReleasesLayout` `/dist/index.json` Fetcher Into Context + Provider[/-] [+]Consolidate Node Releases Data Logic[/+] on May 8, 2023
  5. HinataKah0 commented on Jun 17, 2023

    @HinataKah0
    ContributorAuthor

    Done! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    website redesign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions