Skip to content

Conversation

canerakdas
Copy link
Member

@canerakdas canerakdas commented May 31, 2025

Description

This PR introduces a new statically generated page that displays simplified download options by major version:

image

Also includes a download table of other minor versions of the major version;
image

Since I included the minor versions as a table, the content became quite lengthy. To prevent this, I used the HTML details element. The main reason I didn't use Radix Primitive Accordion is that we want this page to be fully usable even for users who have JavaScript disabled

I am open to suggestions for to add / remove content 🙇

Validation

The links below are accessible in the preview;

  • /download/{major}
  • /download/archive

Related Issues

Addresses #7443

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 12:02
@canerakdas canerakdas requested a review from a team as a code owner May 31, 2025 12:02
Copy link

vercel bot commented May 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Aug 26, 2025 5:03pm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new simplified downloads page that’s fully server-rendered (no JS required) and provides major‐version download summaries, with expandable minor versions under <details>. It also centralizes download utilities and updates the download URL API to use an options object.

  • Introduce simplified.mdx and DownloadSimpleLayout for the new page
  • Update getNodeDownloadUrl signature and its callers to use an options object
  • Add DownloadsTable, Details, and WithSimplifiedDownload components

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
util/downloadUtils/index.tsx Exported DownloadDropdownItem type
util/downloadUtils/constants.json Added compatibility ranges for platforms
util/tests/getNodeDownloadUrl.test.mjs Updated tests for new getNodeDownloadUrl signature
types/layouts.ts Added 'download-simple' layout type
pages/en/download/simplified.mdx New MDX page with simplified download UI
next.mdx.use.mjs Registered new MDX components (WithSimplifiedDownload, etc.)
next.dynamic.constants.mjs Configured dynamic routing and exclusions for new page
layouts/DownloadSimple.tsx New layout wrapping simplified download content
components/withSimplifiedDownload.tsx HOC to provide download data and sidebar items
components/withProgressionSidebar.tsx Refactored to accept both navKey and explicit groups
components/withMetaBar.tsx Made items injectable for meta‐bar
components/withMarkdownContent.tsx New HOC to load MDX content at runtime
components/withLayout.tsx Added DownloadSimpleLayout to layout mapping
components/MDX/Details New <Details> component for collapsible sections
components/Downloads/Release/ReleaseCodeBox.tsx Updated “no-script” link to point at new simplified page
components/Downloads/Release/PrebuiltDownloadButtons.tsx Switched getNodeDownloadUrl calls to object syntax
components/Downloads/DownloadsTable New table for listing artifacts
components/Downloads/DownloadLink.tsx Updated to new getNodeDownloadUrl API
components/Downloads/DownloadButton Updated to new getNodeDownloadUrl API
Comments suppressed due to low confidence (1)

apps/site/components/Downloads/DownloadsTable/index.tsx:1

  • Consider adding unit tests for DownloadsTable to verify it renders rows correctly for different source inputs.
'use client';

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Caner Akdas <[email protected]>
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Aug 24, 2025
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty, I gave my last round of reviews. After this, let's get this merged! Thank you so much for all the work here!

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW i was little bit off website thing and I saw that. just awesome

if (version === 'current') {
const releaseData = provideReleaseData();

const release = releaseData.find(release => release.status === 'Current');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this will get the latest version, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as we discussed here, it refers to the latest version (not the LTS one)

// Extract version from pathname
const version = extractVersionFromPath(pathname);

if (version == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will a situation where users can reach on this Provider with this being null ever happen? I just worry that this isn't really needed. I think you can remove this null statement fully. Otherwise, let me know in which situation this happened 🤔

// Find the release data for the given version
const releaseData = provideReleaseData();
const release = releaseData.find(
release => semVer.major(version) === release.major
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to call semver here? semver is unfortunately expensive. Won't the version here actually already be a string that matches release.major?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In release data, we keep data for minor and major versions under the major version. Since we're creating a page for minor versions, we need to find the major version of the incoming version here.

As an alternative to the current usage, I could add a check like version.startsWith(v${release.major}), but that seems like too much of a manual check to me, WDYT?

@ovflowd
Copy link
Member

ovflowd commented Aug 27, 2025

@canerakdas I'll merge this now, feel free to do any further change onm follow-up PRs.

@ovflowd ovflowd merged commit 8bec046 into nodejs:main Aug 27, 2025
17 of 19 checks passed
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

Successfully merging this pull request may close these issues.

Simplified Downloads page for non-JS-enabled environments
6 participants