Skip to content

Commit 0c3a3fc

Browse files
committed
Revert "feat: redesigned home page with esp and updated downloads page (#7875)"
This reverts commit 8d29e0f.
1 parent 70cbf5f commit 0c3a3fc

File tree

19 files changed

+1509
-77
lines changed

19 files changed

+1509
-77
lines changed

apps/site/components/Downloads/Release/ReleaseCodeBox.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const parseSnippet = (s: string, releaseContext: ReleaseContextType) => {
3838

3939
const ReleaseCodeBox: FC = () => {
4040
const { snippets } = useContext(ReleasesContext);
41-
4241
const { installMethod, os, packageManager, release } =
4342
useContext(ReleaseContext);
4443

@@ -127,18 +126,6 @@ const ReleaseCodeBox: FC = () => {
127126
</AlertBox>
128127
)}
129128

130-
{release.status === 'LTS' && (
131-
<AlertBox
132-
title={t('components.common.alertBox.info')}
133-
level="info"
134-
size="small"
135-
>
136-
{t.rich('layouts.download.codeBox.ltsVersionFeaturesNotice', {
137-
link: text => <Link href="/download/current">{text}</Link>,
138-
})}
139-
</AlertBox>
140-
)}
141-
142129
{!currentPlatform || currentPlatform.recommended || (
143130
<AlertBox
144131
title={t('components.common.alertBox.info')}

apps/site/components/Downloads/Release/VersionDropdown.tsx

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
'use client';
22

33
import Select from '@node-core/ui-components/Common/Select';
4-
import { useLocale, useTranslations } from 'next-intl';
4+
import { useTranslations } from 'next-intl';
55
import type { FC } from 'react';
66
import { useContext } from 'react';
77

8-
import { redirect, usePathname } from '#site/navigation';
98
import {
109
ReleaseContext,
1110
ReleasesContext,
@@ -27,28 +26,6 @@ const VersionDropdown: FC = () => {
2726
const { releases } = useContext(ReleasesContext);
2827
const { release, setVersion } = useContext(ReleaseContext);
2928
const t = useTranslations();
30-
const locale = useLocale();
31-
const pathname = usePathname();
32-
33-
// Allows us to keep the route semantically correct to what the user should expect
34-
// from the /current and non /current routes.
35-
const setVersionOrNavigate = (version: string) => {
36-
const release = releases.find(
37-
({ versionWithPrefix }) => versionWithPrefix === version
38-
);
39-
40-
if (release?.status === 'LTS' && pathname.includes('current')) {
41-
redirect({ href: '/download', locale });
42-
return;
43-
}
44-
45-
if (release?.status === 'Current' && !pathname.includes('current')) {
46-
redirect({ href: '/download/current', locale });
47-
return;
48-
}
49-
50-
setVersion(version);
51-
};
5229

5330
return (
5431
<Select
@@ -58,7 +35,7 @@ const VersionDropdown: FC = () => {
5835
label: getDropDownStatus(versionWithPrefix, status),
5936
}))}
6037
defaultValue={release.versionWithPrefix}
61-
onChange={setVersionOrNavigate}
38+
onChange={setVersion}
6239
className="min-w-36"
6340
inline={true}
6441
/>

apps/site/components/Downloads/ReleaseModal/index.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { FC } from 'react';
55

66
import { MinorReleasesTable } from '#site/components/Downloads/MinorReleasesTable';
77
import { ReleaseOverview } from '#site/components/Downloads/ReleaseOverview';
8-
import Link from '#site/components/Link';
98
import LinkWithArrow from '#site/components/LinkWithArrow';
109
import type { NodeRelease } from '#site/types';
1110

@@ -39,21 +38,7 @@ const ReleaseModal: FC<ReleaseModalProps> = ({
3938
level="warning"
4039
size="small"
4140
>
42-
{t.rich('components.releaseModal.unsupportedVersionWarning', {
43-
link: text => <Link href="/about/previous-releases/">{text}</Link>,
44-
})}
45-
</AlertBox>
46-
)}
47-
48-
{release.status === 'LTS' && (
49-
<AlertBox
50-
title={t('components.common.alertBox.info')}
51-
level="info"
52-
size="small"
53-
>
54-
{t.rich('components.releaseModal.ltsVersionFeaturesNotice', {
55-
link: text => <Link href="/download/current">{text}</Link>,
56-
})}
41+
{t('components.releaseModal.unsupportedVersionWarning')}
5742
</AlertBox>
5843
)}
5944

apps/site/layouts/GlowingBackdrop.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const GlowingBackdropLayout: FC<
1616
> = ({ kind = 'home', children }) => (
1717
<>
1818
<WithNavBar />
19-
2019
<div className={styles.centeredLayout}>
2120
<GlowingBackdrop />
2221

apps/site/layouts/layouts.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
section {
3737
&:nth-of-type(1) {
3838
@apply flex
39-
max-w-[400px]
39+
max-w-[500px]
4040
flex-[1_0]
4141
flex-col
4242
gap-8;
@@ -56,7 +56,7 @@
5656
@apply max-xs:text-xs
5757
text-center
5858
text-sm
59-
text-neutral-600
59+
text-neutral-800
6060
dark:text-neutral-400;
6161

6262
sup {

apps/site/pages/en/index.mdx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,29 @@ layout: home
1414

1515
</div>
1616

17-
<div className="flex gap-4">
18-
19-
<div className="flex flex-col gap-2">
20-
<Button kind="special" className="!hidden dark:!block" href="/download">Install Node.js</Button>
21-
22-
<Button kind="primary" className="!block dark:!hidden" href="/download">Install Node.js</Button>
23-
24-
<Button kind="secondary" className="!block" href="https://www.herodevs.com/support/node-nes">
25-
<span>Get security support</span>
26-
<br />
27-
<small className="!text-xs">for Node.js 18 and below</small>
28-
</Button>
29-
</div>
17+
<div>
18+
<WithNodeRelease status={['LTS']}>
19+
{({ release }) => (
20+
<>
21+
<DownloadButton release={release}>Download Node.js (LTS)</DownloadButton>
22+
<small>
23+
Downloads Node.js <b>{release.versionWithPrefix}</b>
24+
<sup title="Downloads a Node.js installer for your current platform">1</sup> with long-term support.
25+
Node.js can also be installed via <Link href="/download">version managers</Link>.
26+
</small>
27+
</>
28+
)}
29+
</WithNodeRelease>
30+
31+
<WithNodeRelease status={['Current']}>
32+
{({ release }) => (
33+
<small>
34+
Want new features sooner?
35+
Get <b>Node.js <DownloadLink release={release}>{release.versionWithPrefix}</DownloadLink></b>
36+
<sup title="Downloads a Node.js installer for your current platform">1</sup> instead.
37+
</small>
38+
)}
39+
</WithNodeRelease>
3040

3141
</div>
3242
</section>

apps/site/pages/es/index.mdx

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Ejecuta JavaScript en cualquier parte
3+
layout: home
4+
---
5+
6+
<section>
7+
<WithBadgeGroup section="index" />
8+
9+
<div>
10+
<h1 className="special">Ejecuta JavaScript en cualquier parte</h1>
11+
12+
Node.js® es un entorno de ejecución de JavaScript multiplataforma,
13+
de código abierto y gratuito que permite a los desarrolladores crear servidores,
14+
aplicaciones web, herramientas de línea de comando y scripts.
15+
16+
</div>
17+
18+
<div>
19+
<WithNodeRelease status={['LTS']}>
20+
{({ release }) => (
21+
<>
22+
<DownloadButton release={release}>Descargar Node.js (LTS)</DownloadButton>
23+
<small>
24+
Descarga Node.js <b>{release.versionWithPrefix}</b>
25+
<sup title="Descarga un instalador de Node.js para tu plataforma">1</sup> con soporte a largo plazo.
26+
Node.js también puede ser instalado a través de <Link href="/download">gestores de versiones</Link>.
27+
</small>
28+
</>
29+
)}
30+
</WithNodeRelease>
31+
32+
<WithNodeRelease status={['Current']}>
33+
{({ release }) => (
34+
<small>
35+
¿Quieres nuevas funciones más pronto?
36+
Consigue<b>Node.js <DownloadLink release={release}>{release.versionWithPrefix}</DownloadLink></b>
37+
<sup title="Downloads a Node.js installer for your current platform">1</sup> en vez.
38+
</small>
39+
)}
40+
</WithNodeRelease>
41+
42+
</div>
43+
</section>
44+
45+
<section>
46+
<div>
47+
```js displayName="Create an HTTP Server"
48+
// server.mjs
49+
import { createServer } from 'node:http';
50+
51+
const server = createServer((req, res) => {
52+
res.writeHead(200, { 'Content-Type': 'text/plain' });
53+
res.end('Hello World!\n');
54+
});
55+
56+
// starts a simple http server locally on port 3000
57+
server.listen(3000, '127.0.0.1', () => {
58+
console.log('Listening on 127.0.0.1:3000');
59+
});
60+
61+
// run with `node server.mjs`
62+
```
63+
64+
```js displayName="Write Tests"
65+
// tests.mjs
66+
import assert from 'node:assert';
67+
import test from 'node:test';
68+
69+
test('that 1 is equal 1', () => {
70+
assert.strictEqual(1, 1);
71+
});
72+
73+
test('that throws as 1 is not equal 2', () => {
74+
// throws an exception because 1 != 2
75+
assert.strictEqual(1, 2);
76+
});
77+
78+
// run with `node tests.mjs`
79+
```
80+
81+
```js displayName="Read and Hash a File"
82+
// crypto.mjs
83+
import { createHash } from 'node:crypto';
84+
import { readFile } from 'node:fs/promises';
85+
86+
const hasher = createHash('sha1');
87+
88+
hasher.setEncoding('hex');
89+
// ensure you have a `package.json` file for this test!
90+
hasher.write(await readFile('package.json'));
91+
hasher.end();
92+
93+
const fileHash = hasher.read();
94+
95+
// run with `node crypto.mjs`
96+
```
97+
98+
```js displayName="Streams Pipeline"
99+
// streams.mjs
100+
import { createReadStream, createWriteStream } from 'node:fs';
101+
import { pipeline } from 'node:stream/promises';
102+
import { createGzip } from 'node:zlib';
103+
104+
// ensure you have a `package.json` file for this test!
105+
await pipeline(
106+
createReadStream('package.json'),
107+
createGzip(),
108+
createWriteStream('package.json.gz')
109+
);
110+
111+
// run with `node streams.mjs`
112+
```
113+
114+
```js displayName="Work with Threads"
115+
// threads.mjs
116+
import { Worker, isMainThread,
117+
workerData, parentPort } from 'node:worker_threads';
118+
119+
if (isMainThread) {
120+
const data = 'some data';
121+
const worker = new Worker(import.meta.filename, { workerData: data });
122+
worker.on('message', msg => console.log('Reply from Thread:', msg));
123+
} else {
124+
const source = workerData;
125+
parentPort.postMessage(btoa(source.toUpperCase()));
126+
}
127+
128+
// run with `node threads.mjs`
129+
```
130+
131+
</div>
132+
133+
Aprenda más sobre lo que Node.js puede ofrecer con nuestros [Materiales de aprendizaje](/learn).
134+
135+
</section>

0 commit comments

Comments
 (0)