Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,27 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "sst bind next dev",
"dev": "sst bind next dev --turbopack",
"build": "next build",
"start": "next start",
"deploy": "sst deploy"
},
"dependencies": {
"dayjs": "^1.11.9",
"gray-matter": "^4.0.3",
"next": "13.4.12",
"next": "15.0.1",
"next-auth": "^4.22.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"remark": "^13.0.0",
"remark-html": "^13.0.2",
"swr": "^1.0.1"
},
"devDependencies": {
"aws-cdk-lib": "2.84.0",
"constructs": "10.1.156",
"sst": "2.16.3"
"sst": "2.16.3",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { getSong } from "@example/shared/api";
import Modal from "@example/shared/components/Modal";

type Props = {
params: {
params: Promise<{
album: string;
song: string;
};
}>;
};
export default async function SongPage({ params }: Props) {
export default async function SongPage(props: Props) {
const params = await props.params;
const song = await getSong(params.album, params.song);
return (
<Modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Modal from "@example/shared/components/Modal";

type Props = {
params: {
params: Promise<{
artist: string;
};
}>;
};
export default function ArtistPage({ params }: Props) {
export default async function ArtistPage(props: Props) {
const params = await props.params;
return <Modal>Artists {params.artist}</Modal>;
}
7 changes: 4 additions & 3 deletions examples/app-pages-router/app/albums/[album]/[song]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { getSong } from "@example/shared/api";

type Props = {
params: {
params: Promise<{
album: string;
song: string;
};
}>;
};
export default async function Song({ params }: Props) {
export default async function Song(props: Props) {
const params = await props.params;
const song = await getSong(params.album, params.song);

return (
Expand Down
7 changes: 3 additions & 4 deletions examples/app-pages-router/app/rewrite-destination/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export default function RewriteDestination({
searchParams,
}: {
searchParams: { a: string };
export default async function RewriteDestination(props: {
searchParams: Promise<{ a: string }>;
}) {
const searchParams = await props.searchParams;
return (
<div>
<div>Rewritten Destination</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/app-pages-router/app/ssr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function getTime() {

export default async function SSR() {
const time = await getTime();
const headerList = headers();
const headerList = await headers();
return (
<div>
<h1>Time: {time}</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
poweredByHeader: false,
cleanDistDir: true,
transpilePackages: ["@example/shared"],
output: "standalone",
outputFileTracing: "../sst",
experimental: {
serverActions: true,
},
// outputFileTracingRoot: "../sst",
eslint: {
ignoreDuringBuilds: true,
},
trailingSlash: true,
skipTrailingSlashRedirect: true,
};

module.exports = nextConfig;
export default nextConfig;
12 changes: 6 additions & 6 deletions examples/app-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"openbuild": "node ../../packages/open-next/dist/index.js build --build-command \"npx turbo build\"",
"dev": "next dev --port 3003",
"dev": "next dev --turbopack --port 3003",
"build": "next build",
"start": "next start --port 3003",
"lint": "next lint",
Expand All @@ -13,15 +13,15 @@
"dependencies": {
"@example/shared": "workspace:*",
"@open-next/utils": "workspace:*",
"next": "^14.0.3",
"next": "15.0.1",
"@opennextjs/aws": "workspace:*",
"react": "latest",
"react-dom": "latest"
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021"
},
"devDependencies": {
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
"autoprefixer": "10.4.15",
"postcss": "8.4.27",
"tailwindcss": "3.3.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { getSong } from "@example/shared/api";
import Modal from "@example/shared/components/Modal";

type Props = {
params: {
params: Promise<{
album: string;
song: string;
};
}>;
};
export default async function SongPage({ params }: Props) {
export default async function SongPage(props: Props) {
const params = await props.params;
const song = await getSong(params.album, params.song);
return (
<Modal>
Expand Down
7 changes: 4 additions & 3 deletions examples/app-router/app/albums/@modal/(.)[album]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Modal from "@example/shared/components/Modal";

type Props = {
params: {
params: Promise<{
artist: string;
};
}>;
};
export default function ArtistPage({ params }: Props) {
export default async function ArtistPage(props: Props) {
const params = await props.params;
return <Modal>Artists {params.artist}</Modal>;
}
7 changes: 4 additions & 3 deletions examples/app-router/app/albums/[album]/[song]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { getSong } from "@example/shared/api";

type Props = {
params: {
params: Promise<{
album: string;
song: string;
};
}>;
};
export default async function Song({ params }: Props) {
export default async function Song(props: Props) {
const params = await props.params;
const song = await getSong(params.album, params.song);

return (
Expand Down
4 changes: 2 additions & 2 deletions examples/app-router/app/headers/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { headers } from "next/headers";

export default function Headers() {
const middlewareHeader = headers().get("request-header");
export default async function Headers() {
const middlewareHeader = (await headers()).get("request-header");
return (
<div>
<h1>Headers</h1>
Expand Down
8 changes: 4 additions & 4 deletions examples/app-router/app/revalidate-path/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default async function Page() {
const timeInParis = await fetch(
"http://worldtimeapi.org/api/timezone/Europe/Paris",
"https://www.timeapi.io/api/time/current/zone?timeZone=Europe%2FParis",
{
next: {
tags: ["path"],
Expand All @@ -9,12 +9,12 @@ export default async function Page() {
);
// This one doesn't have a tag
const timeInLondon = await fetch(
"http://worldtimeapi.org/api/timezone/Europe/London",
"https://www.timeapi.io/api/time/current/zone?timeZone=Europe%2FLondon",
);
const timeInParisJson = await timeInParis.json();
const parisTime = timeInParisJson.datetime;
const parisTime = timeInParisJson.dateTime;
const timeInLondonJson = await timeInLondon.json();
const londonTime = timeInLondonJson.datetime;
const londonTime = timeInLondonJson.dateTime;
return (
<div>
<h1>Time in Paris</h1>
Expand Down
9 changes: 4 additions & 5 deletions examples/app-router/app/search-query/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { headers } from "next/headers";

export default function SearchQuery({
searchParams: propsSearchParams,
}: {
searchParams: Record<string, string | string[]>;
export default async function SearchQuery(props: {
searchParams: Promise<Record<string, string | string[]>>;
}) {
const mwSearchParams = headers().get("search-params");
const propsSearchParams = await props.searchParams;
const mwSearchParams = (await headers()).get("search-params");
const multiValueParams = propsSearchParams["multi"];
const multiValueArray = Array.isArray(multiValueParams)
? multiValueParams
Expand Down
2 changes: 1 addition & 1 deletion examples/app-router/app/ssr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function getTime() {

export default async function SSR() {
const time = await getTime();
const headerList = headers();
const headerList = await headers();
return (
<div>
<h1>Time: {time}</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
poweredByHeader: false,
cleanDistDir: true,
transpilePackages: ["@example/shared"],
output: "standalone",
outputFileTracing: "../sst",
experimental: {
serverActions: true,
},
// outputFileTracingRoot: "../sst",
eslint: {
ignoreDuringBuilds: true,
},
Expand All @@ -19,7 +17,7 @@ const nextConfig = {
},
],
},
redirects: () => {
redirects: async () => {
return [
{
source: "/next-config-redirect-missing",
Expand Down Expand Up @@ -53,14 +51,14 @@ const nextConfig = {
},
{
source: "/next-config-redirect-without-locale-support",
destination: "https://open-next.js.org/",
destination: "https://opennext.js.org/",
permanent: false,
basePath: false,
locale: false,
},
];
},
headers() {
async headers() {
return [
{
source: "/(.*)",
Expand All @@ -75,4 +73,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
export default nextConfig;
12 changes: 6 additions & 6 deletions examples/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"openbuild": "node ../../packages/open-next/dist/index.js build --streaming --build-command \"npx turbo build\"",
"dev": "next dev --port 3001",
"dev": "next dev --turbopack --port 3001",
"build": "next build",
"start": "next start --port 3001",
"lint": "next lint",
Expand All @@ -13,15 +13,15 @@
"dependencies": {
"@example/shared": "workspace:*",
"@open-next/utils": "workspace:*",
"next": "^14.1.4",
"next": "15.0.1",
"@opennextjs/aws": "workspace:*",
"react": "latest",
"react-dom": "latest"
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021"
},
"devDependencies": {
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
"autoprefixer": "10.4.15",
"postcss": "8.4.27",
"tailwindcss": "3.3.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@example/shared"],
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
transpilePackages: ["@example/shared", "react", "react-dom"],
i18n: {
locales: ["en", "nl"],
defaultLocale: "en",
},
cleanDistDir: true,
reactStrictMode: true,
output: "standalone",
outputFileTracing: "../sst",
// outputFileTracingRoot: "../sst",
eslint: {
ignoreDuringBuilds: true,
},
headers: () => [
headers: async () => [
{
source: "/",
headers: [
Expand All @@ -23,7 +24,7 @@ const nextConfig = {
],
},
],
rewrites: () => [
rewrites: async () => [
{ source: "/rewrite", destination: "/", locale: false },
{
source: "/rewriteUsingQuery",
Expand All @@ -38,10 +39,10 @@ const nextConfig = {
],
},
],
redirects: () => [
redirects: async () => [
{
source: "/next-config-redirect-without-locale-support/",
destination: "https://open-next.js.org/",
destination: "https://opennext.js.org/",
permanent: false,
basePath: false,
locale: false,
Expand All @@ -56,4 +57,4 @@ const nextConfig = {
poweredByHeader: true,
};

module.exports = nextConfig;
export default nextConfig;
Loading