-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore(wsl): add notice #7758
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
Open
Vishal-K-988
wants to merge
6
commits into
nodejs:main
Choose a base branch
from
Vishal-K-988:WSL-Guidance-on-Download-Page2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
chore(wsl): add notice #7758
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
20150a0
refactor(download): extract constants to JSON and reorganize download…
Vishal-K-988 a314703
feat(download): show WSL info message when Windows(WIN) OS is selected
Vishal-K-988 686ee4b
:Merge branch 'WSL-Guidance-on-Download-Page2' of https://github.com/…
Vishal-K-988 6123fef
Removed all the changes made to different languages JSON file as Crow…
Vishal-K-988 b2cf976
removed all the <WSLMessage/> component from all the supported langua…
Vishal-K-988 3ec4be3
Update WindowsWSLMessage.tsx
Vishal-K-988 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use client'; | ||
|
||
import { useTranslations } from 'next-intl'; | ||
import type { FC } from 'react'; | ||
|
||
const WSLMessage: FC = () => { | ||
const t = useTranslations(); | ||
return ( | ||
<> | ||
<div className="mt-4 rounded-lg border border-blue-200 bg-blue-50 p-4 dark:border-blue-800 dark:bg-blue-900/20"> | ||
<h3 className="mb-2 text-lg font-semibold text-blue-800 dark:text-blue-200"> | ||
{t('layouts.download.wsl.title')} | ||
</h3> | ||
<p className="text-blue-700 dark:text-blue-300"> | ||
{t('layouts.download.wsl.description')} | ||
</p> | ||
<a | ||
href="https://docs.microsoft.com/en-us/windows/wsl/install" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="mt-2 inline-block text-blue-600 hover:underline dark:text-blue-400" | ||
> | ||
{t('layouts.download.wsl.learnMore')} | ||
</a> | ||
</div> | ||
</> | ||
); | ||
}; | ||
export default WSLMessage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client'; | ||
|
||
import { useContext } from 'react'; | ||
|
||
import { ReleaseContext } from '#site/providers/releaseProvider'; | ||
|
||
import WSLMessage from './WSLMessage'; | ||
|
||
const WindowsWSLMessage = () => { | ||
const { os } = useContext(ReleaseContext); | ||
// conditions to check if the operating system is selected as Windows or not | ||
if (os !== 'WIN') return null; | ||
return <WSLMessage />; | ||
}; | ||
|
||
export default WindowsWSLMessage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be part of the Layout, right?
And can't AlertBox be used instead of a new component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want
<WindowsWSLMessage />
component to appear on certain pages, so I added this todownload/index.mdx
, not to the layout. Adding it to the layout would make it appear on every page.At first, I considered using an alert box, but it creates a pop-up animation, which I think can be distracting and might negatively impact the user experience.
On the other hand, this new component feels like a natural part of the website and looks more integrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlertBox
doesn't make a popup, I think you are thinking ofModal
. If you select a community option for Download (rather than a Recommended), you'll see an alert box that says "Installation methods that involve community software are supported by the teams maintaining that software.", we can add one above for WSL.It can say something like:
"These instructions are meant to be ran in a PowerShell terminal. If you are using [Windows Subsystem for Linux](link to ms docs), please refer to the Linux instructions"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I couldn't find the "Community Installation" method / option at nodejs website!
can you please guide me through url or something so that I can get a rough idea about AlertBox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vishal-K-988 If you select 'Windows' and 'Chocolatey' you should see the AlertBox component (it's the blue info box).