Skip to content

Commit daed1fe

Browse files
committed
fix(static): fix static rendering
1 parent 411449c commit daed1fe

File tree

17 files changed

+50
-44
lines changed

17 files changed

+50
-44
lines changed

apps/site/app/[locale]/download/archive/[version]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export const generateMetadata = basePage.generateMetadata;
2424
// - If `ENABLE_STATIC_EXPORT_LOCALE` is true, generates paths for all available locales
2525
// - Otherwise, generates paths only for the default locale
2626
// @see https://nextjs.org/docs/app/api-reference/functions/generate-static-params
27-
export const generateStaticParams = async () => {
27+
export const generateStaticParams = () => {
2828
// Return an empty array if static export is disabled
2929
if (!ENABLE_STATIC_EXPORT) {
3030
return [];
3131
}
3232

33-
const versions = await provideReleaseVersions();
33+
const versions = provideReleaseVersions();
3434

3535
return versions.map(version => ({
3636
locale: defaultLocale.code,
@@ -49,14 +49,14 @@ const getPage: FC<PageParams> = async props => {
4949
const [locale, pathname] = basePage.getLocaleAndPath(version, routeLocale);
5050

5151
if (version === 'current') {
52-
const releaseData = await provideReleaseData();
52+
const releaseData = provideReleaseData();
5353

5454
const release = releaseData.find(release => release.status === 'Current');
5555

5656
redirect(`/${locale}/download/archive/${release?.versionWithPrefix}`);
5757
}
5858

59-
const versions = await provideReleaseVersions();
59+
const versions = provideReleaseVersions();
6060

6161
// Verifies if the current route is a dynamic route
6262
const isDynamicRoute = versions.some(r => r.includes(pathname));

apps/site/app/[locale]/not-found.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use server';
2-
31
import { getTranslations } from 'next-intl/server';
42

53
import Button from '#site/components/Common/Button';

apps/site/components/EOL/EOLReleaseTable/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import EOLReleaseTableBody from './TableBody';
1212
import styles from './index.module.css';
1313

1414
const EOLReleaseTable: FC = async () => {
15-
const releaseData = await provideReleaseData();
16-
const vulnerabilities = await provideVulnerabilities();
15+
const releaseData = provideReleaseData();
16+
const vulnerabilities = provideVulnerabilities();
1717

1818
const eolReleases = releaseData.filter(
1919
release => release.status === EOL_VERSION_IDENTIFIER

apps/site/components/Releases/PreviousReleasesTable/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { FC } from 'react';
77
import PreviousReleasesTableBody from './TableBody';
88

99
const PreviousReleasesTable: FC = async () => {
10-
const releaseData = await provideReleaseData();
10+
const releaseData = provideReleaseData();
1111

1212
const t = await getTranslations();
1313

apps/site/components/withDownloadArchive.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type WithDownloadArchiveProps = {
1919
* Higher-order component that extracts version from pathname,
2020
* fetches release data, and provides download artifacts to child component
2121
*/
22-
const WithDownloadArchive: FC<WithDownloadArchiveProps> = async ({
22+
const WithDownloadArchive: FC<WithDownloadArchiveProps> = ({
2323
children: Component,
2424
}) => {
2525
const { pathname } = getClientContext();
@@ -28,7 +28,7 @@ const WithDownloadArchive: FC<WithDownloadArchiveProps> = async ({
2828
const version = extractVersionFromPath(pathname);
2929

3030
// Find the release data for the given version
31-
const releaseData = await provideReleaseData();
31+
const releaseData = provideReleaseData();
3232
const release = releaseData.find(release =>
3333
// Match major version only (e.g., v22.x.x for release.major v22)
3434
version.startsWith(`v${release.major}`)

apps/site/components/withDownloadSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
2222
}) => {
2323
const locale = await getLocale();
2424

25-
const snippets = await provideDownloadSnippets(locale);
25+
const snippets = provideDownloadSnippets(locale);
2626

2727
// By default the translated languages do not contain all the download snippets
2828
// Hence we always merge any translated snippet with the fallbacks for missing snippets
29-
const fallbackSnippets = await provideDownloadSnippets(defaultLocale.code);
29+
const fallbackSnippets = provideDownloadSnippets(defaultLocale.code);
3030

3131
const { pathname } = getClientContext();
3232

apps/site/components/withNodeRelease.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use server';
2-
31
import provideReleaseData from '#site/next-data/providers/releaseData';
42

53
import type { NodeRelease, NodeReleaseStatus } from '#site/types';
@@ -10,14 +8,13 @@ type WithNodeReleaseProps = {
108
children: FC<{ release: NodeRelease }>;
119
};
1210

13-
// This is a React Async Server Component
14-
// Note that Hooks cannot be used in a RSC async component
15-
// Async Components do not get re-rendered at all.
16-
const WithNodeRelease: FC<WithNodeReleaseProps> = async ({
11+
// This is a React Server Component
12+
// Note that Hooks cannot be used in a React Server Component
13+
const WithNodeRelease: FC<WithNodeReleaseProps> = ({
1714
status: statuses,
1815
children: Component,
1916
}) => {
20-
const releases = await provideReleaseData();
17+
const releases = provideReleaseData();
2118

2219
const matchingRelease = [statuses]
2320
.flat()

apps/site/components/withReleaseSelect.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use server';
2-
31
import StatelessSelect from '@node-core/ui-components/Common/Select/StatelessSelect';
42

53
import Link from '#site/components/Link';
@@ -43,8 +41,8 @@ type WithReleaseSelectProps = Omit<
4341
'values' | 'as'
4442
>;
4543

46-
const WithReleaseSelect: FC<WithReleaseSelectProps> = async ({ ...props }) => {
47-
const releaseData = await provideReleaseData();
44+
const WithReleaseSelect: FC<WithReleaseSelectProps> = ({ ...props }) => {
45+
const releaseData = provideReleaseData();
4846
const navigation = groupReleasesByStatus(releaseData);
4947

5048
return (

apps/site/components/withSupporters.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
'use server';
2-
31
import provideSupporters from '#site/next-data/providers/supportersData';
42

53
import type { FC, PropsWithChildren } from 'react';
64

75
import SupportersList from './Common/Supporters';
86

9-
const WithSupporters: FC<PropsWithChildren> = async () => {
10-
const supporters = await provideSupporters();
7+
const WithSupporters: FC<PropsWithChildren> = () => {
8+
const supporters = provideSupporters();
119

1210
return (
1311
<div className="flex max-w-full flex-wrap items-center gap-1">

apps/site/layouts/Download.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import type { FC, PropsWithChildren } from 'react';
88

99
import styles from './layouts.module.css';
1010

11-
const DownloadLayout: FC<PropsWithChildren> = async ({ children }) => {
11+
const DownloadLayout: FC<PropsWithChildren> = ({ children }) => {
1212
const { frontmatter } = getClientContext();
1313

14-
const releases = await provideReleaseData();
14+
const releases = provideReleaseData();
1515

1616
return (
1717
<>

0 commit comments

Comments
 (0)