From e90a6ee209601927d192b7db891db91146fd6304 Mon Sep 17 00:00:00 2001 From: josh <144584931+dancer@users.noreply.github.com> Date: Sat, 29 Nov 2025 13:21:34 +0000 Subject: [PATCH] upgrade to next.js 16 (#1334) --- app/(auth)/login/page.tsx | 2 +- app/(auth)/register/page.tsx | 2 +- app/(chat)/chat/[id]/page.tsx | 14 +- app/(chat)/layout.tsx | 31 +-- app/(chat)/page.tsx | 11 +- next-env.d.ts | 1 + next.config.ts | 4 +- package.json | 2 +- pnpm-lock.yaml | 447 +++++++++++++++++----------------- middleware.ts => proxy.ts | 2 +- tsconfig.json | 3 +- 11 files changed, 272 insertions(+), 247 deletions(-) rename middleware.ts => proxy.ts (96%) diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index c9fb3f1..666feee 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -25,6 +25,7 @@ export default function Page() { const { update: updateSession } = useSession(); + // biome-ignore lint/correctness/useExhaustiveDependencies: router and updateSession are stable refs useEffect(() => { if (state.status === "failed") { toast({ @@ -41,7 +42,6 @@ export default function Page() { updateSession(); router.refresh(); } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.status]); const handleSubmit = (formData: FormData) => { diff --git a/app/(auth)/register/page.tsx b/app/(auth)/register/page.tsx index 7af8161..ff2f1e8 100644 --- a/app/(auth)/register/page.tsx +++ b/app/(auth)/register/page.tsx @@ -24,6 +24,7 @@ export default function Page() { const { update: updateSession } = useSession(); + // biome-ignore lint/correctness/useExhaustiveDependencies: router and updateSession are stable refs useEffect(() => { if (state.status === "user_exists") { toast({ type: "error", description: "Account already exists!" }); @@ -41,7 +42,6 @@ export default function Page() { updateSession(); router.refresh(); } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.status]); const handleSubmit = (formData: FormData) => { diff --git a/app/(chat)/chat/[id]/page.tsx b/app/(chat)/chat/[id]/page.tsx index f208fac..e5c270d 100644 --- a/app/(chat)/chat/[id]/page.tsx +++ b/app/(chat)/chat/[id]/page.tsx @@ -1,5 +1,6 @@ import { cookies } from "next/headers"; import { notFound, redirect } from "next/navigation"; +import { Suspense } from "react"; import { auth } from "@/app/(auth)/auth"; import { Chat } from "@/components/chat"; @@ -8,9 +9,16 @@ import { DEFAULT_CHAT_MODEL } from "@/lib/ai/models"; import { getChatById, getMessagesByChatId } from "@/lib/db/queries"; import { convertToUIMessages } from "@/lib/utils"; -export default async function Page(props: { params: Promise<{ id: string }> }) { - const params = await props.params; - const { id } = params; +export default function Page(props: { params: Promise<{ id: string }> }) { + return ( + }> + + + ); +} + +async function ChatPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = await params; const chat = await getChatById({ id }); if (!chat) { diff --git a/app/(chat)/layout.tsx b/app/(chat)/layout.tsx index c5e44e5..f6d4f5f 100644 --- a/app/(chat)/layout.tsx +++ b/app/(chat)/layout.tsx @@ -1,20 +1,12 @@ import { cookies } from "next/headers"; import Script from "next/script"; +import { Suspense } from "react"; import { AppSidebar } from "@/components/app-sidebar"; import { DataStreamProvider } from "@/components/data-stream-provider"; import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"; import { auth } from "../(auth)/auth"; -export const experimental_ppr = true; - -export default async function Layout({ - children, -}: { - children: React.ReactNode; -}) { - const [session, cookieStore] = await Promise.all([auth(), cookies()]); - const isCollapsed = cookieStore.get("sidebar_state")?.value !== "true"; - +export default function Layout({ children }: { children: React.ReactNode }) { return ( <>