Skip to content

Commit efe47d3

Browse files
committed
chore: upgrade to next 15
1 parent 90afad3 commit efe47d3

File tree

12 files changed

+557
-524
lines changed

12 files changed

+557
-524
lines changed

apps/site/app/[locale]/[[...path]]/page.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const generateViewport = async () => ({ ...PAGE_VIEWPORT });
2525

2626
// This generates each page's HTML Metadata
2727
// @see https://nextjs.org/docs/app/api-reference/functions/generate-metadata
28-
export const generateMetadata = async ({ params }: DynamicParams) => {
28+
export const generateMetadata = async (props: DynamicParams) => {
29+
const params = await props.params;
30+
2931
const { path = [], locale = defaultLocale.code } = params;
3032

3133
const pathname = dynamicRouter.getPathname(path);
@@ -64,7 +66,8 @@ export const generateStaticParams = async () => {
6466
// then it proceeds to retrieve the Markdown file and parse the MDX Content into a React Component
6567
// finally it returns (if the locale and route are valid) the React Component with the relevant context
6668
// and attached context providers for rendering the current page
67-
const getPage: FC<DynamicParams> = async ({ params }) => {
69+
const getPage: FC<DynamicParams> = async props => {
70+
const params = await props.params;
6871
const { path = [], locale = defaultLocale.code } = params;
6972

7073
if (!availableLocaleCodes.includes(locale)) {

apps/site/app/[locale]/feed/[feed]/route.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import { defaultLocale } from '@/next.locales.mjs';
88
// We only support fetching these pages from the /en/ locale code
99
const locale = defaultLocale.code;
1010

11-
type StaticParams = { params: { feed: string; locale: string } };
11+
type StaticParams = { params: Promise<{ feed: string; locale: string }> };
1212

1313
// This is the Route Handler for the `GET` method which handles the request
1414
// for the Node.js Website Blog Feeds (RSS)
1515
// @see https://nextjs.org/docs/app/building-your-application/routing/router-handlers
16-
export const GET = async (_: Request, { params }: StaticParams) => {
16+
export const GET = async (_: Request, props: StaticParams) => {
17+
const params = await props.params;
18+
1719
// Generate the Feed for the given feed type (blog, releases, etc)
1820
const websiteFeed = provideWebsiteFeeds(params.feed);
1921

apps/site/app/[locale]/next-data/blog-data/[category]/[page]/route.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ import { VERCEL_REVALIDATE } from '@/next.constants.mjs';
77
import { defaultLocale } from '@/next.locales.mjs';
88

99
type StaticParams = {
10-
params: { locale: string; category: string; page: string };
10+
params: Promise<{ locale: string; category: string; page: string }>;
1111
};
1212

1313
// This is the Route Handler for the `GET` method which handles the request
1414
// for providing Blog Posts for Blog Categories and Pagination Metadata
1515
// @see https://nextjs.org/docs/app/building-your-application/routing/router-handlers
16-
export const GET = async (_: Request, { params }: StaticParams) => {
16+
export const GET = async (_: Request, props: StaticParams) => {
17+
const params = await props.params;
18+
1719
const requestedPage = Number(params.page);
1820

1921
const data =

apps/site/app/[locale]/next-data/changelog-data/[version]/route.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { VERCEL_REVALIDATE } from '@/next.constants.mjs';
44
import { defaultLocale } from '@/next.locales.mjs';
55

66
type StaticParams = {
7-
params: { version: string };
7+
params: Promise<{ version: string }>;
88
};
99

1010
// This is the Route Handler for the `GET` method which handles the request
1111
// for generating static data related to the Node.js Changelog Data
1212
// @see https://nextjs.org/docs/app/building-your-application/routing/router-handlers
13-
export const GET = async (_: Request, { params }: StaticParams) => {
13+
export const GET = async (_: Request, props: StaticParams) => {
14+
const params = await props.params;
15+
1416
const changelogData = await provideChangelogData(params.version);
1517

1618
return Response.json(changelogData);

apps/site/components/Common/Tabs/__tests__/index.test.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
22
import { act, render, screen } from '@testing-library/react';
33
import userEvent from '@testing-library/user-event';
44

5+
import Link from '../../../Link';
56
import Tabs from '../index';
67

78
describe('Tabs', () => {
@@ -46,7 +47,7 @@ describe('Tabs', () => {
4647
});
4748

4849
it('should render the given addons', async () => {
49-
render(<Sut addons={<a href="/">addon</a>} />);
50+
render(<Sut addons={<Link href="/">addon</Link>} />);
5051

5152
expect(screen.getByRole('link', { name: 'addon' })).toBeInTheDocument();
5253
});

apps/site/hooks/react-client/useClickOutside.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { RefObject } from 'react';
22
import { useEffect } from 'react';
33

44
const useClickOutside = <T extends HTMLElement>(
5-
ref: RefObject<T>,
5+
ref: RefObject<T | null>,
66
fn: () => void
77
) => {
88
useEffect(() => {

apps/site/hooks/react-client/useNavigationState.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { debounce } from '@/util/debounce';
88

99
const useNavigationState = <T extends HTMLElement>(
1010
id: string,
11-
ref: RefObject<T>,
11+
ref: RefObject<T | null>,
1212
debounceTime = 300
1313
) => {
1414
const navigationState = useContext(NavigationStateContext);

apps/site/next.config.mjs

-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ const nextConfig = {
1919
// We intentionally disable Next.js's built-in i18n support
2020
// as we dom have our own i18n and internationalisation engine
2121
i18n: null,
22-
// We want to always enforce that SWC minifies the sources even during Development mode
23-
// so that bundles are minified on-the-go. SWF minifying is fast, and has almost no penalties
24-
swcMinify: true,
2522
// We don't use trailing slashes on URLs from the Node.js Website
2623
trailingSlash: false,
2724
// We don't want to redirect with trailing slashes
@@ -113,8 +110,6 @@ const nextConfig = {
113110
],
114111
// Removes the warning regarding the WebPack Build Worker
115112
webpackBuildWorker: true,
116-
// Enables Next.js's Instrumentation Hook
117-
instrumentationHook: true,
118113
},
119114
// To import ESM-only packages with next dev --turbo. Source: https://github.com/vercel/next.js/issues/63318#issuecomment-2079677098
120115
transpilePackages: ['shiki'],

apps/site/package.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"scripts": {
1919
"scripts:release-post": "cross-env NODE_NO_WARNINGS=1 node scripts/release-post/index.mjs",
20-
"dev": "cross-env SENTRY_SUPPRESS_TURBOPACK_WARNING=1 NODE_NO_WARNINGS=1 next dev --turbo",
20+
"dev": "cross-env SENTRY_SUPPRESS_TURBOPACK_WARNING=1 NODE_NO_WARNINGS=1 next dev --turbopack",
2121
"serve": "npm run dev",
2222
"build": "cross-env NODE_NO_WARNINGS=1 next build",
2323
"start": "cross-env NODE_NO_WARNINGS=1 next start",
@@ -37,28 +37,28 @@
3737
},
3838
"dependencies": {
3939
"@heroicons/react": "~2.1.5",
40-
"@mdx-js/mdx": "^3.0.1",
40+
"@mdx-js/mdx": "^3.1.0",
4141
"@node-core/website-i18n": "*",
4242
"@nodevu/core": "~0.1.0",
4343
"@orama/highlight": "^0.1.6",
44-
"@oramacloud/client": "^1.3.16",
44+
"@oramacloud/client": "^1.3.19",
4545
"@radix-ui/react-accessible-icon": "^1.1.0",
4646
"@radix-ui/react-avatar": "^1.1.1",
4747
"@radix-ui/react-dialog": "^1.1.2",
48-
"@radix-ui/react-dropdown-menu": "^2.1.1",
48+
"@radix-ui/react-dropdown-menu": "^2.1.2",
4949
"@radix-ui/react-label": "^2.1.0",
5050
"@radix-ui/react-scroll-area": "^1.2.0",
5151
"@radix-ui/react-select": "^2.1.2",
5252
"@radix-ui/react-slot": "^1.1.0",
53-
"@radix-ui/react-tabs": "^1.1.0",
53+
"@radix-ui/react-tabs": "^1.1.1",
5454
"@radix-ui/react-toast": "^1.2.2",
5555
"@savvywombat/tailwindcss-grid-areas": "~4.0.0",
56-
"@sentry/nextjs": "^8.33.1",
56+
"@sentry/nextjs": "^8.35.0",
5757
"@tailwindcss/container-queries": "~0.1.1",
5858
"@types/node": "20.16.5",
5959
"@vcarl/remark-headings": "~0.1.0",
60-
"@vercel/analytics": "~1.3.1",
61-
"@vercel/speed-insights": "~1.0.12",
60+
"@vercel/analytics": "~1.3.2",
61+
"@vercel/speed-insights": "~1.0.14",
6262
"autoprefixer": "~10.4.20",
6363
"classnames": "~2.5.1",
6464
"cross-env": "7.0.3",
@@ -67,8 +67,8 @@
6767
"github-slugger": "~2.0.0",
6868
"glob": "~11.0.0",
6969
"gray-matter": "~4.0.3",
70-
"next": "~14.2.14",
71-
"next-intl": "~3.21.1",
70+
"next": "15.0.2",
71+
"next-intl": "~3.23.5",
7272
"next-themes": "~0.3.0",
7373
"postcss": "~8.4.47",
7474
"postcss-calc": "~10.0.2",
@@ -82,41 +82,41 @@
8282
"remark-gfm": "~4.0.0",
8383
"remark-reading-time": "~2.0.1",
8484
"semver": "~7.6.3",
85-
"shiki": "~1.17.5",
86-
"tailwindcss": "^3.4.13",
85+
"shiki": "~1.22.2",
86+
"tailwindcss": "^3.4.14",
8787
"unist-util-visit": "~5.0.0",
8888
"vfile": "~6.0.3",
8989
"vfile-matter": "~5.0.0"
9090
},
9191
"devDependencies": {
92-
"@eslint/compat": "~1.2.0",
93-
"@next/eslint-plugin-next": "~14.2.14",
94-
"@storybook/addon-controls": "~8.3.5",
95-
"@storybook/addon-interactions": "~8.3.5",
96-
"@storybook/addon-themes": "~8.3.5",
97-
"@storybook/addon-viewport": "~8.3.5",
98-
"@storybook/nextjs": "~8.3.5",
99-
"@testing-library/jest-dom": "~6.5.0",
92+
"@eslint/compat": "~1.2.2",
93+
"@next/eslint-plugin-next": "15.0.2",
94+
"@storybook/addon-controls": "~8.3.6",
95+
"@storybook/addon-interactions": "~8.3.6",
96+
"@storybook/addon-themes": "~8.3.6",
97+
"@storybook/addon-viewport": "~8.3.6",
98+
"@storybook/nextjs": "~8.3.6",
99+
"@testing-library/jest-dom": "~6.6.2",
100100
"@testing-library/react": "~16.0.1",
101101
"@testing-library/user-event": "~14.5.2",
102-
"@types/jest": "29.5.13",
103-
"@types/react": "^18.3.11",
104-
"@types/react-dom": "^18.3.0",
102+
"@types/jest": "29.5.14",
103+
"@types/react": "^18.3.12",
104+
"@types/react-dom": "^18.3.1",
105105
"@types/semver": "~7.5.8",
106-
"eslint-config-next": "15.0.0-rc.1",
106+
"eslint-config-next": "15.0.2",
107107
"eslint-import-resolver-typescript": "~3.6.3",
108108
"eslint-plugin-mdx": "~3.1.5",
109-
"eslint-plugin-react": "~7.37.1",
109+
"eslint-plugin-react": "~7.37.2",
110110
"eslint-plugin-react-hooks": "5.0.0",
111-
"eslint-plugin-storybook": "0.10.0--canary.156.ce8985b.0",
111+
"eslint-plugin-storybook": "0.10.1",
112112
"handlebars": "4.7.8",
113113
"jest": "29.7.0",
114114
"jest-environment-jsdom": "29.7.0",
115115
"jest-junit": "16.0.0",
116116
"remark-frontmatter": "5.0.0",
117117
"remark-preset-lint-node": "5.1.2",
118-
"storybook": "~8.3.0",
119-
"stylelint": "16.9.0",
118+
"storybook": "~8.3.6",
119+
"stylelint": "16.10.0",
120120
"stylelint-config-standard": "36.0.1",
121121
"stylelint-order": "6.0.4",
122122
"stylelint-selector-bem-pattern": "4.0.1",

apps/site/util/downloadUtils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { JSX } from 'react';
2+
13
import type { PackageManager } from '@/types/release';
24
import type { UserOS } from '@/types/userOS';
35

0 commit comments

Comments
 (0)