Skip to content

Commit 79dbd42

Browse files
committed
meta: upgrade to next.js 16
1 parent 089e65c commit 79dbd42

File tree

13 files changed

+607
-536
lines changed

13 files changed

+607
-536
lines changed

apps/site/app/[locale]/error.tsx

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

3-
import { ArrowRightIcon } from '@heroicons/react/24/solid';
43
import { useTranslations } from 'next-intl';
54
import type { FC } from 'react';
65

@@ -12,17 +11,17 @@ const ErrorPage: FC<{ error: Error }> = () => {
1211

1312
return (
1413
<GlowingBackdropLayout kind="default">
15-
500
14+
<span>500</span>
15+
1616
<h1 className="special -mt-4 text-center">
1717
{t('layouts.error.internalServerError.title')}
1818
</h1>
19+
1920
<p className="-mt-4 max-w-sm text-center text-lg">
2021
{t('layouts.error.internalServerError.description')}
2122
</p>
22-
<Button href="/">
23-
{t('layouts.error.backToHome')}
24-
<ArrowRightIcon />
25-
</Button>
23+
24+
<Button href="/">{t('layouts.error.backToHome')}</Button>
2625
</GlowingBackdropLayout>
2726
);
2827
};

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
'use client';
2-
3-
import { ArrowRightIcon } from '@heroicons/react/24/solid';
4-
import { useTranslations } from 'next-intl';
1+
import { getTranslations } from 'next-intl/server';
52
import type { FC } from 'react';
63

74
import Button from '#site/components/Common/Button';
85
import Turtle from '#site/components/Common/Turtle';
96
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
107

11-
const NotFoundPage: FC = () => {
12-
const t = useTranslations();
8+
const NotFoundPage: FC = async () => {
9+
const t = await getTranslations();
1310

1411
return (
1512
<GlowingBackdropLayout kind="default">
@@ -27,10 +24,7 @@ const NotFoundPage: FC = () => {
2724
{t('layouts.error.notFound.description')}
2825
</p>
2926

30-
<Button href="/">
31-
{t('layouts.error.backToHome')}
32-
<ArrowRightIcon />
33-
</Button>
27+
<Button href="/">{t('layouts.error.backToHome')}</Button>
3428
</GlowingBackdropLayout>
3529
);
3630
};

apps/site/app/global-error.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import { ArrowRightIcon } from '@heroicons/react/24/solid';
43
import type { FC } from 'react';
54

65
import Button from '#site/components/Common/Button';
@@ -20,10 +19,7 @@ const GlobalErrorPage: FC<{ error: Error }> = () => (
2019
This page has thrown a non-recoverable error.
2120
</p>
2221

23-
<Button href="/">
24-
Back to Home
25-
<ArrowRightIcon />
26-
</Button>
22+
<Button href="/">Back to Home</Button>
2723
</GlowingBackdropLayout>
2824
</BaseLayout>
2925
</body>

apps/site/app/global-not-found.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { FC } from 'react';
2+
3+
import Button from '#site/components/Common/Button';
4+
import Turtle from '#site/components/Common/Turtle';
5+
import BaseLayout from '#site/layouts/Base';
6+
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
7+
8+
const NotFoundPage: FC = () => (
9+
<html>
10+
<body>
11+
<BaseLayout>
12+
<GlowingBackdropLayout kind="default">
13+
<span>404</span>
14+
15+
<h1 className="special -mt-4 text-center">Page could not be found</h1>
16+
17+
<div className="my-4 flex h-[150px] items-center justify-center md:h-[300px]">
18+
<Turtle />
19+
</div>
20+
21+
<p className="-mt-4 max-w-sm text-center text-lg">
22+
Sorry, we couldn't find the page you're after! Try starting again
23+
from the homepage.
24+
</p>
25+
26+
<Button href="/">Back to Home</Button>
27+
</GlowingBackdropLayout>
28+
</BaseLayout>
29+
</body>
30+
</html>
31+
);
32+
33+
export default NotFoundPage;

apps/site/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default baseConfig.concat([
1212

1313
react.configs.flat['jsx-runtime'],
1414
hooks.configs['recommended-latest'],
15-
next.flatConfig.coreWebVitals,
15+
next.configs['core-web-vitals'],
1616
mdx.flatCodeBlocks,
1717

1818
// Type-checking

apps/site/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
33
/// <reference types="next/navigation-types/compat/navigation" />
4-
/// <reference path="./.next/types/routes.d.ts" />
4+
import './.next/dev/types/routes.d.ts';
55

66
// NOTE: This file should not be edited
77
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/site/next.config.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { redirects, rewrites } from './next.rewrites.mjs';
66

77
/** @type {import('next').NextConfig} */
88
const nextConfig = {
9-
allowedDevOrigins: ['10.1.1.232'],
9+
// Full Support of React 18 SSR and Streaming
10+
reactCompiler: true,
1011
// We don't want to redirect with trailing slashes
1112
skipTrailingSlashRedirect: true,
1213
// We allow the BASE_PATH to be overridden in case that the Website
@@ -66,11 +67,10 @@ const nextConfig = {
6667
// Enable statically typed links
6768
// @see https://nextjs.org/docs/app/api-reference/config/typescript#statically-typed-links
6869
typedRoutes: true,
69-
// We don't want to run ESLint Checking on Production Builds
70-
// as we already check it on the CI within each Pull Request
71-
// we also configure ESLint to run its lint checking on all files
72-
eslint: { ignoreDuringBuilds: true },
70+
// Experimental Flags
7371
experimental: {
72+
// Enables global not-found without intl.
73+
globalNotFound: true,
7474
// Ensure that server-side code is also minified
7575
serverMinification: true,
7676
// Use Workers and Threads for webpack compilation
@@ -95,6 +95,8 @@ const nextConfig = {
9595
'tailwindcss',
9696
'shiki',
9797
],
98+
// Faster Development Servers with Turbopack
99+
turbopackFileSystemCacheForDev: true,
98100
},
99101
// If we're building for the Cloudflare deployment we want to set
100102
// an appropriate deploymentId (needed for skew protection)

apps/site/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"type": "module",
44
"scripts": {
55
"prebuild": "node --run build:blog-data",
6-
"build": "node --run build:default -- --turbo",
6+
"build": "node --run build:default -- --turbopack",
77
"build:blog-data": "cross-env NODE_NO_WARNINGS=1 node ./scripts/blog-data/generate.mjs",
88
"build:blog-data:watch": "node --watch --watch-path=pages/en/blog ./scripts/blog-data/generate.mjs",
99
"build:default": "cross-env NODE_NO_WARNINGS=1 next build",
1010
"cloudflare:build:worker": "OPEN_NEXT_CLOUDFLARE=true opennextjs-cloudflare build",
1111
"cloudflare:deploy": "opennextjs-cloudflare deploy",
1212
"cloudflare:preview": "wrangler dev",
1313
"predeploy": "node --run build:blog-data",
14-
"deploy": "cross-env NEXT_PUBLIC_STATIC_EXPORT=true node --run build:default -- --turbo",
14+
"deploy": "cross-env NEXT_PUBLIC_STATIC_EXPORT=true node --run build:default -- --turbopack",
1515
"predev": "node --run build:blog-data",
16-
"dev": "cross-env NODE_NO_WARNINGS=1 next dev --turbo",
16+
"dev": "cross-env NODE_NO_WARNINGS=1 next dev --turbopack",
1717
"lint": "node --run lint:js && node --run lint:css && node --run lint:md",
1818
"lint:fix": "node --run lint:js:fix && node --run lint:css:fix && node --run lint:md:fix",
1919
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
@@ -60,7 +60,7 @@
6060
"github-slugger": "~2.0.0",
6161
"gray-matter": "~4.0.3",
6262
"mdast-util-to-string": "^4.0.0",
63-
"next": "15.5.2",
63+
"next": "16.0.0-beta.0",
6464
"next-intl": "~4.3.5",
6565
"next-themes": "~0.4.6",
6666
"postcss-calc": "~10.1.1",
@@ -80,16 +80,17 @@
8080
},
8181
"devDependencies": {
8282
"@flarelabs-net/wrangler-build-time-fs-assets-polyfilling": "^0.0.1",
83-
"@next/eslint-plugin-next": "15.5.2",
83+
"@next/eslint-plugin-next": "16.0.0-beta.0",
8484
"@node-core/remark-lint": "workspace:*",
8585
"@opennextjs/cloudflare": "^1.6.4",
8686
"@playwright/test": "^1.54.1",
8787
"@testing-library/user-event": "~14.6.1",
8888
"@types/mdast": "^4.0.4",
8989
"@types/mdx": "^2.0.13",
9090
"@types/semver": "~7.7.1",
91+
"babel-plugin-react-compiler": "^1.0.0",
9192
"dedent": "^1.6.0",
92-
"eslint-config-next": "15.5.4",
93+
"eslint-config-next": "16.0.0-beta.0",
9394
"eslint-plugin-mdx": "~3.6.2",
9495
"eslint-plugin-react": "~7.37.5",
9596
"eslint-plugin-react-hooks": "^5.2.0",
File renamed without changes.

apps/site/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"moduleResolution": "Bundler",
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,
15-
"jsx": "preserve",
15+
"jsx": "react-jsx",
1616
"incremental": true,
1717
"plugins": [
1818
{
@@ -33,7 +33,8 @@
3333
"**/*.tsx",
3434
// Explicitly include since the globs won't match the `.`
3535
".stylelintrc.mjs",
36-
".next/types/**/*.ts"
36+
".next/types/**/*.ts",
37+
".next/dev/types/**/*.ts"
3738
],
3839
"exclude": ["node_modules", ".next"]
3940
}

0 commit comments

Comments
 (0)