Skip to content

Commit 8295b90

Browse files
committed
Migrate to Next.js 15
1 parent 41ac4fc commit 8295b90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+158
-2248
lines changed

.changeset/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"baseBranch": "canary",
99
"updateInternalDependencies": "patch",
1010
"ignore": [
11-
"@neshca/server",
1211
"@repo/backend",
1312
"@repo/cache-handler-docs",
1413
"@repo/cache-testing",

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ updates:
1010
open-pull-requests-limit: 20
1111
ignore:
1212
- dependency-name: 'lru-cache'
13-
versions: ['11.x.x']
13+
versions: ['>=11.0.0']
1414
groups:
1515
next-js:
1616
patterns:

apps/cache-testing/next.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ const nextConfig = {
1111
output: 'standalone',
1212
cacheHandler:
1313
process.env.NODE_ENV !== 'development' ? cacheHandler : undefined,
14+
// outputFileTracingRoot: path.join(import.meta.dirname, '../../'),
1415
cacheMaxMemorySize: 0, // disable default in-memory caching
1516
experimental: {
1617
// PPR should only be configured via the PPR_ENABLED env variable due to conditional logic in tests.
1718
ppr: process.env.PPR_ENABLED === 'true',
1819
largePageDataBytes: 1024 * 1024, // 1MB
19-
outputFileTracingRoot: path.join(import.meta.dirname, '../../'),
20-
instrumentationHook: true,
21-
},
22-
eslint: {
23-
ignoreDuringBuilds: true,
2420
},
2521
};
2622

apps/cache-testing/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@types/node": "22.13.5",
3131
"@types/react": "19.0.10",
3232
"@types/react-dom": "19.0.4",
33+
"dotenv-cli": "8.0.0",
3334
"eslint": "9.21.0",
3435
"fastify": "5.2.1",
3536
"pm2": "5.4.3",

apps/cache-testing/src/app/app/no-params/dynamic-false/[slug]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ export const dynamicParams = false;
77

88
export const revalidate = 5;
99

10-
type PageParams = { params: { slug: string } };
10+
type PageParams = { params: Promise<{ slug: string }> };
1111

1212
const getData = createGetData('app/no-params/dynamic-false');
1313

1414
export default async function Index({
1515
params,
16-
}: PageParams): Promise<JSX.Element> {
17-
const data = await getData(params.slug);
16+
}: PageParams): Promise<React.ReactNode> {
17+
const resolvedParams = await params;
18+
const data = await getData(resolvedParams.slug);
1819

1920
if (!data) {
2021
notFound();

apps/cache-testing/src/app/app/no-params/dynamic-true/[slug]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ export const dynamicParams = true;
77

88
export const revalidate = 5;
99

10-
type PageParams = { params: { slug: string } };
10+
type PageParams = { params: Promise<{ slug: string }> };
1111

1212
const getData = createGetData('app/no-params/dynamic-true');
1313

1414
export default async function Index({
1515
params,
16-
}: PageParams): Promise<JSX.Element> {
17-
const data = await getData(params.slug);
16+
}: PageParams): Promise<React.ReactNode> {
17+
const resolvedParams = await params;
18+
const data = await getData(resolvedParams.slug);
1819

1920
if (!data) {
2021
notFound();

apps/cache-testing/src/app/app/no-params/ssr/200/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createGetData } from 'cache-testing/utils/create-get-data';
55

66
const getData = createGetData('app/no-params/ssr', undefined, 'no-store');
77

8-
export default async function Index(): Promise<JSX.Element> {
8+
export default async function Index(): Promise<React.ReactNode> {
99
const data = await getData('200');
1010

1111
if (!data) {

apps/cache-testing/src/app/app/ppr/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Suspense } from 'react';
44
import { formatTime } from 'cache-testing/utils/format-time';
55
import type { TimeBackendApiResponseJson } from 'cache-testing/utils/types';
66

7-
async function ActualData(): Promise<JSX.Element> {
7+
async function ActualData(): Promise<React.ReactNode> {
88
noStore();
99

1010
const response = await fetch('http://localhost:8081/time', {
@@ -20,11 +20,11 @@ async function ActualData(): Promise<JSX.Element> {
2020
return <div data-pw="ppr-postponed">{formatTime(data.unixTimeMs)}</div>;
2121
}
2222

23-
function Skeleton(): JSX.Element {
23+
function Skeleton(): React.ReactNode {
2424
return <div data-pw="ppr-prerendered">Skeleton</div>;
2525
}
2626

27-
export default function Page(): JSX.Element {
27+
export default function Page(): React.ReactNode {
2828
return (
2929
<main>
3030
<h3>Partial Prerendering</h3>

apps/cache-testing/src/app/app/randomHex/[length]/page.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ import type { RandomHexPageProps } from 'cache-testing/utils/types';
77

88
const lengthSteps = new Array(5).fill(0).map((_, i) => 10 ** (i + 1));
99

10-
type PageParams = { params: { length: string } };
10+
type PageParams = { params: Promise<{ length: string }> };
1111

12-
export function generateStaticParams(): PageParams['params'][] {
12+
export async function generateStaticParams(): Promise<
13+
{
14+
length: string;
15+
}[]
16+
> {
1317
return lengthSteps.map((length) => ({ length: `${length}` }));
1418
}
1519

1620
export default async function Page({
17-
params: { length },
18-
}: PageParams): Promise<JSX.Element> {
21+
params,
22+
}: PageParams): Promise<React.ReactNode> {
23+
const resolvedParams = await params;
24+
const { length } = resolvedParams;
1925
const path = `/randomHex/app/${length}`;
2026

2127
const url = new URL(path, 'http://localhost:8081');

apps/cache-testing/src/app/app/with-params/dynamic-false/[slug]/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import { notFound } from 'next/navigation';
33
import { CommonAppPage } from 'cache-testing/utils/common-app-page';
44
import { createGetData } from 'cache-testing/utils/create-get-data';
55

6-
type PageParams = { params: { slug: string } };
6+
type PageParams = { params: Promise<{ slug: string }> };
77

88
export const dynamicParams = false;
99

1010
export const revalidate = 5;
1111

1212
const getData = createGetData('app/with-params/dynamic-false');
1313

14-
export function generateStaticParams(): Promise<PageParams['params'][]> {
14+
export function generateStaticParams(): Promise<
15+
{
16+
slug: string;
17+
}[]
18+
> {
1519
return Promise.resolve([
1620
{ slug: '200' },
1721
{ slug: '404' },
@@ -21,8 +25,9 @@ export function generateStaticParams(): Promise<PageParams['params'][]> {
2125

2226
export default async function Index({
2327
params,
24-
}: PageParams): Promise<JSX.Element> {
25-
const data = await getData(params.slug);
28+
}: PageParams): Promise<React.ReactNode> {
29+
const resolvedParams = await params;
30+
const data = await getData(resolvedParams.slug);
2631

2732
if (!data) {
2833
notFound();

0 commit comments

Comments
 (0)