Skip to content

Commit 66fa764

Browse files
committed
upgrade app-pages-router to next 15
1 parent 2bf8da0 commit 66fa764

File tree

9 files changed

+41
-39
lines changed

9 files changed

+41
-39
lines changed

examples/app-pages-router/app/albums/@modal/(.)[album]/[song]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { getSong } from "@example/shared/api";
22
import Modal from "@example/shared/components/Modal";
33

44
type Props = {
5-
params: {
5+
params: Promise<{
66
album: string;
77
song: string;
8-
};
8+
}>;
99
};
10-
export default async function SongPage({ params }: Props) {
10+
export default async function SongPage(props: Props) {
11+
const params = await props.params;
1112
const song = await getSong(params.album, params.song);
1213
return (
1314
<Modal>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import Modal from "@example/shared/components/Modal";
22

33
type Props = {
4-
params: {
4+
params: Promise<{
55
artist: string;
6-
};
6+
}>;
77
};
8-
export default function ArtistPage({ params }: Props) {
8+
export default async function ArtistPage(props: Props) {
9+
const params = await props.params;
910
return <Modal>Artists {params.artist}</Modal>;
1011
}

examples/app-pages-router/app/albums/[album]/[song]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { getSong } from "@example/shared/api";
22

33
type Props = {
4-
params: {
4+
params: Promise<{
55
album: string;
66
song: string;
7-
};
7+
}>;
88
};
9-
export default async function Song({ params }: Props) {
9+
export default async function Song(props: Props) {
10+
const params = await props.params;
1011
const song = await getSong(params.album, params.song);
1112

1213
return (

examples/app-pages-router/app/rewrite-destination/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
export default function RewriteDestination({
2-
searchParams,
3-
}: {
4-
searchParams: { a: string };
5-
}) {
1+
export default async function RewriteDestination(
2+
props: {
3+
searchParams: Promise<{ a: string }>;
4+
}
5+
) {
6+
const searchParams = await props.searchParams;
67
return (
78
<div>
89
<div>Rewritten Destination</div>

examples/app-pages-router/app/ssr/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async function getTime() {
1313

1414
export default async function SSR() {
1515
const time = await getTime();
16-
const headerList = headers();
16+
const headerList = await headers();
1717
return (
1818
<div>
1919
<h1>Time: {time}</h1>
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
34
poweredByHeader: false,
45
cleanDistDir: true,
56
transpilePackages: ["@example/shared"],
67
output: "standalone",
7-
outputFileTracing: "../sst",
8-
experimental: {
9-
serverActions: true,
10-
},
8+
outputFileTracingRoot: "../sst",
119
eslint: {
1210
ignoreDuringBuilds: true,
1311
},
1412
trailingSlash: true,
1513
skipTrailingSlashRedirect: true,
1614
};
1715

18-
module.exports = nextConfig;
16+
export default nextConfig;

examples/app-pages-router/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"dependencies": {
1414
"@example/shared": "workspace:*",
1515
"@open-next/utils": "workspace:*",
16-
"next": "^14.0.3",
16+
"next": "15.0.0",
1717
"@opennextjs/aws": "workspace:*",
18-
"react": "latest",
19-
"react-dom": "latest"
18+
"react": "19.0.0-rc-65a56d0e-20241020",
19+
"react-dom": "19.0.0-rc-65a56d0e-20241020"
2020
},
2121
"devDependencies": {
2222
"@types/node": "20.5.0",
23-
"@types/react": "18.2.20",
24-
"@types/react-dom": "18.2.7",
23+
"@types/react": "^18.0.0",
24+
"@types/react-dom": "^18.0.0",
2525
"autoprefixer": "10.4.15",
2626
"postcss": "8.4.27",
2727
"tailwindcss": "3.3.3",

examples/app-router/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"devDependencies": {
2222
"@types/node": "20.5.0",
23-
"@types/react": "^18",
24-
"@types/react-dom": "^18",
23+
"@types/react": "^18.0.0",
24+
"@types/react-dom": "^18.0.0",
2525
"autoprefixer": "10.4.15",
2626
"postcss": "8.4.27",
2727
"tailwindcss": "3.3.3",

pnpm-lock.yaml

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)