Skip to content

WSL guidance on download page #7757

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

Closed

Conversation

Vishal-K-988
Copy link
Contributor

Description

This PR introduces a new feature to the download page:
When a user selects "Windows" as their operating system in any of the OS dropdowns, a WSL (Windows Subsystem for Linux) informational message is displayed directly below the "Download Node.js®" title.
The message provides users with helpful information about WSL and a link to learn more, improving the experience for Windows users interested in running Node.js in a Linux environment.

Key changes:

  • Added WSLMessage and WindowsWSLMessage components.
  • Registered these components in the MDX configuration for use in MDX files.
  • Refactored context usage to allow independent OS selection in each dropdown.
  • Ensured the WSL message appears only once, in a consistent and user-friendly location.

Validation

  • Manually tested the download page.
  • When "Windows" is selected in any OS dropdown, the WSL message appears below the main title.
  • The message disappears when another OS is selected.
  • Both OS dropdowns can now be used independently.
  • The UI remains clean and consistent.
  • Working Video
    Working video Drive Link

Related Issues

Addresses #7651

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.

… utils

Moved downloadConstants.json and downloadUtils.tsx into a dedicated subdirectory.
Removed redundant UserOs array and now infer it dynamically from OperatingSystemLabel keys.

Fixes: nodejs#7561
Signed-off-by: vishal <[email protected]>
… utils

Moved constants.json and index.tsx into a dedicated subdirectory.
Reorganized constants such as PLATFORMS into constants.json using object destructuring.
Refactored INSTALL_METHODS to use object destructuring and removed explicit any types.
Similarly for OS_NOT_SUPPORTING_INSTALLERS, OperatingSystems

Fixes: nodejs#7561
Signed-off-by: vishal <[email protected]>
- Move package managers configuration to constants.json
- Refactor icon handling to use dynamic component mapping
- Remove redundant installMethodIconsMap
- Standardize icon handling across OS, package managers, and install methods
- Clean up imports and destructuring from constants.json

This change improves code maintainability by:
- Centralizing configuration in constants.json
- Using consistent patterns for icon handling
- Reducing code duplication
- Making it easier to add new items in the future

Signed-off-by: vishal <[email protected]>
- Add WSLMessage component to display information about Windows Subsystem for Linux (WSL)
- Show WSLMessage only once, directly below the `Download Node.js®`  title, when Windows(WIN) is selected in any OS dropdown
- Refactor context usage to allow independent OS selection in each dropdown
- Register WSLMessage and WindowsWSLMessage in MDX components for use in MDX files
- Improve user experience by providing relevant WSL info at the right place and time
- Enhanced both for Dark and Light Theme with Blue background and border and glowing theme perfectly matching the ui theme of the website !
Issue nodejs#7651

Signed-off-by: vishal <[email protected]>
@Vishal-K-988 Vishal-K-988 requested a review from a team as a code owner May 18, 2025 05:38
Copy link

vercel bot commented May 18, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 18, 2025 5:44am

Copy link
Contributor

Note

Your Pull Request seems to be updating Translations of the Node.js Website.

Whilst we appreciate your intent; Any Translation update should be done through our Crowdin Project.
We recommend giving a read on our Translation Guidelines.

Thank you!

@Vishal-K-988
Copy link
Contributor Author

Hey @avivkeller
Can you look into this pull request!

I have attached the working video of this feature, any error or features are required please let me know !

@Vishal-K-988
Copy link
Contributor Author

While working on this feature, I discovered another issue I’d like to bring to your attention:

The recent website banner announcing the "May Security Release is available" currently appears only in English and does not support translation into the other 10 languages offered by the site. As a result, users browsing the site in their native languages are unable to read this important notification.

image

I believe it’s important that all users receive this notification in their preferred language.

If you agree, I’d be happy to open a new issue to request this feature!

@avivkeller @bjohansebas

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

It's hard to what you've added, as this PR changes a lot of unrelated files

@avivkeller
Copy link
Member

Also, please avoid tagging specific individuals without a valid reason—just because someone reviewed a previous PR doesn’t mean they’re currently available.

@Vishal-K-988
Copy link
Contributor Author

It's hard to what you've added, as this PR changes a lot of unrelated files

I totally not understood how .pre-commit-config.yaml gets committed and changes everytime as during the staging proccess it doesn't show mw the yaml file has changed!

If you know please guide me!

And here are the changes what I have done :
Added WSLMessage and WindowsWSLMessage components.
Registered these components in the MDX configuration for use in MDX files.

Can you please suggest / pin a specific file so that I can clearly understood

@avivkeller
Copy link
Member

avivkeller commented May 18, 2025

It looks like your IDE is formatting unrelated files automatically. Try using the terminal to "git add"the files you want to change.

You can start by "git reset"-ing the changes to remove unrelated ones.

Make sure that the pre commit hooks are running as well.

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2025

Codecov Report

Attention: Patch coverage is 97.60479% with 8 lines in your changes missing coverage. Please review.

Project coverage is 75.18%. Comparing base (663fad9) to head (9e1e2af).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/util/downloadUtils/index.tsx 94.87% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7757      +/-   ##
==========================================
+ Coverage   75.09%   75.18%   +0.09%     
==========================================
  Files          98       98              
  Lines        7914     7979      +65     
  Branches      196      206      +10     
==========================================
+ Hits         5943     5999      +56     
- Misses       1970     1979       +9     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants