Skip to content

Commit ec64cf0

Browse files
sommeeeerconico974
andauthored
chore: upgrade examples to next 15 and fix e2e test (#588)
* upgrade examples, examples/shared and example to next 15 (w/ react19) * add tsignore for type errors in open-next * fix e2e * revert changelog * fix typing issue * update cdk * fix linting --------- Co-authored-by: Dorseuil Nicolas <[email protected]>
1 parent 5f661b5 commit ec64cf0

File tree

35 files changed

+4134
-6277
lines changed

35 files changed

+4134
-6277
lines changed

example/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,27 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "sst bind next dev",
6+
"dev": "sst bind next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
99
"deploy": "sst deploy"
1010
},
1111
"dependencies": {
1212
"dayjs": "^1.11.9",
1313
"gray-matter": "^4.0.3",
14-
"next": "13.4.12",
14+
"next": "15.0.1",
1515
"next-auth": "^4.22.1",
16-
"react": "18.2.0",
17-
"react-dom": "18.2.0",
16+
"react": "19.0.0-rc-69d4b800-20241021",
17+
"react-dom": "19.0.0-rc-69d4b800-20241021",
1818
"remark": "^13.0.0",
1919
"remark-html": "^13.0.2",
2020
"swr": "^1.0.1"
2121
},
2222
"devDependencies": {
2323
"aws-cdk-lib": "2.84.0",
2424
"constructs": "10.1.156",
25-
"sst": "2.16.3"
25+
"sst": "2.16.3",
26+
"@types/react": "npm:[email protected]",
27+
"@types/react-dom": "npm:[email protected]"
2628
}
2729
}

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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
export default function RewriteDestination({
2-
searchParams,
3-
}: {
4-
searchParams: { a: string };
1+
export default async function RewriteDestination(props: {
2+
searchParams: Promise<{ a: string }>;
53
}) {
4+
const searchParams = await props.searchParams;
65
return (
76
<div>
87
<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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"openbuild": "node ../../packages/open-next/dist/index.js build --build-command \"npx turbo build\"",
7-
"dev": "next dev --port 3003",
7+
"dev": "next dev --turbopack --port 3003",
88
"build": "next build",
99
"start": "next start --port 3003",
1010
"lint": "next lint",
@@ -13,15 +13,15 @@
1313
"dependencies": {
1414
"@example/shared": "workspace:*",
1515
"@open-next/utils": "workspace:*",
16-
"next": "^14.0.3",
16+
"next": "15.0.1",
1717
"@opennextjs/aws": "workspace:*",
18-
"react": "latest",
19-
"react-dom": "latest"
18+
"react": "19.0.0-rc-69d4b800-20241021",
19+
"react-dom": "19.0.0-rc-69d4b800-20241021"
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": "npm:[email protected]",
24+
"@types/react-dom": "npm:[email protected]",
2525
"autoprefixer": "10.4.15",
2626
"postcss": "8.4.27",
2727
"tailwindcss": "3.3.3",

examples/app-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
}

0 commit comments

Comments
 (0)