v1.2.0:1 — upgrade to Next.js 15 / React 19
Closes the remaining P1: move off Next 14 onto the CVE-patched Next 15 line (15.5.x), eliminating the framework's RSC DoS/source-exposure advisories and the middleware-auth-bypass class that applied to the 14.x auth gate. App Router on Next 15 requires React 19, so react/react-dom move to 19.x in lockstep; lucide-react and next-themes bump to their React-19-compatible releases. The code surface was the Next 15 async-request-API change: params and searchParams are now Promises. All [id] route handlers (10 files) and the four server pages that read them now await the resolved value, using a uniform re-derive idiom that leaves handler bodies untouched. cookies()/ headers() were already awaited, so no other request-API changes were needed; all routes stay dynamic, so the uncached-by-default change is a no-op. next.config.js (static CSP) and the middleware matcher are unchanged. No schema, no API contract change, no data migration. Verified: tsc + lint clean, 209 tests pass, next build succeeds with the standalone bundle tracing the Prisma engine.
This commit is contained in:
@@ -22,8 +22,9 @@ import { z } from "zod";
|
||||
*/
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
context: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const params = await context.params;
|
||||
try {
|
||||
const user = await getCurrentUser();
|
||||
if (!user) {
|
||||
@@ -100,8 +101,9 @@ const updateExerciseSchema = z.object({
|
||||
|
||||
export async function PATCH(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
context: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const params = await context.params;
|
||||
try {
|
||||
const user = await getCurrentUser();
|
||||
if (!user) {
|
||||
@@ -166,8 +168,9 @@ export async function PATCH(
|
||||
*/
|
||||
export async function DELETE(
|
||||
_request: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
context: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const params = await context.params;
|
||||
try {
|
||||
const user = await getCurrentUser();
|
||||
if (!user) {
|
||||
|
||||
Reference in New Issue
Block a user