Skip to content

fix: Bitness type in dropdown #6614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

canerakdas
Copy link
Member

Description

When the default bitness information was excluded and non-excluded bitness existed, we were assigning bitness information as a string by default. With this PR, it was possible to assign numbers such as 86 ,64 or strings such as "arm64" or "armv7l" depending on the type of bitness selected.

With this PR, we aim to create the correct link even when the default bitness is disabled from the getNodeDownloadUrl method. I will check if we can prepare test cases to check these links 👀

Validation

In the preview, download links should be correct

Related Issues

Fixes #6613

Check List

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

@canerakdas canerakdas requested a review from a team as a code owner April 3, 2024 20:52
Copy link

vercel bot commented Apr 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Apr 3, 2024 8:54pm

@ovflowd
Copy link
Member

ovflowd commented Apr 3, 2024

Just a quick headsup. On Firefox Bitness information comes as number when it is x64/x86 (as 64 and 86). Whilst on Chrome it comes as a string x64, x86...

So just, let's please ensure this works both on firefox and chrome 😅

@canerakdas
Copy link
Member Author

canerakdas commented Apr 4, 2024

Thanks for the information @ovflowd , as far as I checked, all the links on the preview match each other in Chrome/Firefox and I checked that they are downloadable. There seems to be no problem, below are the download links in the "Prebuilt Installer", and "Prebuilt Binaries" tabs for both browsers;

Prebuilt Installer

macOS

x64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1.pkg
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1.pkg

macOS

ARM64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1.pkg
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1.pkg


Windows

x64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-x64.msi
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-x64.msi

Windows

x86

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-x86.msi
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-x86.msi

Windows

ARM64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-arm64.msi
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-arm64.msi

Prebuilt Binaries

macOS

x64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-darwin-x64.tar.gz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-darwin-x64.tar.gz

macOS

ARM64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-darwin-arm64.tar.gz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-darwin-arm64.tar.gz


Windows

x64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-x64.zip
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-x64.zip

Windows

x86

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-x86.zip
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-x86.zip

Windows

ARM64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-arm64.zip
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-arm64.zip


Linux

x64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-x64.tar.xz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-x64.tar.xz

Linux

ARMv7

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-armv7l.tar.xz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-armv7l.tar.xz

Linux

ARM64

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-arm64.tar.xz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-arm64.tar.xz

Linux

POWER LE

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-ppc64le.tar.xz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-ppc64le.tar.xz

Linux

System Z

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-s390x.tar.xz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-linux-s390x.tar.xz


AIX

Power

Chrome : https://nodejs.org/dist/v20.12.1/node-v20.12.1-aix-ppc64.tar.gz
Firefox: https://nodejs.org/dist/v20.12.1/node-v20.12.1-aix-ppc64.tar.gz

It will take some time to clear my download folder 😂

Copy link
Contributor

github-actions bot commented Apr 4, 2024

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 97 🟢 96 🟢 100 🟢 91 🔗
/en/about 🟢 99 🟢 96 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 95 🟢 100 🟢 92 🔗
/en/download 🟢 99 🟢 95 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 96 🟢 100 🟢 92 🔗

Copy link
Contributor

github-actions bot commented Apr 4, 2024

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 91%
89.96% (574/638) 76.1% (172/226) 91.4% (117/128)

Unit Test Report

Tests Skipped Failures Errors Time
120 0 💤 0 ❌ 0 🔥 5.69s ⏱️

if (currentBitnessExcluded && nonExcludedBitness) {
// We set it as a Number for cases where it is 64 or 86 otherwise we are
// setting it as a string (ARMv7, ARMv6, etc.)
if (Number.isNaN(Number(nonExcludedBitness)) === false) {
Copy link
Member

Choose a reason for hiding this comment

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

Could this be transformed into:

const numericBitness = Number(nonExcludedBitness);

setBitness(
  numericBitness.toString() === nonExcludedBitness
    ? numericBitness
    : nonExcludedBitness
);

I'm not sure if the value actually needs to be a number? If not:

const numericBitness = Number(nonExcludedBitness).toString();

setBitness(
  numericBitness === nonExcludedBitness
    ? numericBitness
    : nonExcludedBitness
);

Copy link
Member

Choose a reason for hiding this comment

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

This comment was marked as spam.

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.

Awesome stuff! Just left a comment but we can proceed with this :D

@ovflowd ovflowd enabled auto-merge April 10, 2024 10:23
@ovflowd ovflowd added this pull request to the merge queue Apr 10, 2024
@ovflowd ovflowd disabled auto-merge April 10, 2024 10:23
@ovflowd ovflowd removed this pull request from the merge queue due to a manual request Apr 10, 2024
@ovflowd
Copy link
Member

ovflowd commented Apr 12, 2024

FYI @canerakdas is OOO for a few days I'll merge the PR as it is, and then @canerakdas can iterate on my feedback afterwards.

@ovflowd ovflowd merged commit 875dae2 into nodejs:main Apr 12, 2024
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.

Pre-built binary download link for Linux X64 is incorrect on official site
5 participants