diff --git a/starters/graphql-starter/app/[...slug]/page.tsx b/starters/graphql-starter/app/[...slug]/page.tsx index 9fb1921b..b017d169 100644 --- a/starters/graphql-starter/app/[...slug]/page.tsx +++ b/starters/graphql-starter/app/[...slug]/page.tsx @@ -1,6 +1,5 @@ import { draftMode } from "next/headers" import { notFound } from "next/navigation" -import { getDraftData } from "next-drupal/draft" import { Article } from "@/components/drupal/Article" import { BasicPage } from "@/components/drupal/BasicPage" import { drupal } from "@/lib/drupal" @@ -77,7 +76,7 @@ type NodePageProps = { export async function generateMetadata( { params: { slug } }: NodePageProps, - parent: ResolvingMetadata + _: ResolvingMetadata ): Promise { let node try { @@ -119,11 +118,9 @@ export async function generateStaticParams(): Promise { ].map(({ path }) => ({ slug: path.split("/").filter(Boolean) })) } -export default async function Page({ - params: { slug }, - searchParams, -}: NodePageProps) { - const isDraftMode = draftMode().isEnabled +export default async function Page({ params: { slug } }: NodePageProps) { + const draftModeStore = await draftMode() + const isDraftMode = draftModeStore.isEnabled let node try { diff --git a/starters/graphql-starter/app/api/disable-draft/route.ts b/starters/graphql-starter/app/api/disable-draft/route.ts index 81900948..bedfa6f6 100644 --- a/starters/graphql-starter/app/api/disable-draft/route.ts +++ b/starters/graphql-starter/app/api/disable-draft/route.ts @@ -1,6 +1,6 @@ import { disableDraftMode } from "next-drupal/draft" import type { NextRequest } from "next/server" -export async function GET(request: NextRequest) { - return disableDraftMode() +export async function GET(_: NextRequest) { + return await disableDraftMode() } diff --git a/starters/graphql-starter/app/api/draft/route.ts b/starters/graphql-starter/app/api/draft/route.ts index b8757e2a..1716639f 100644 --- a/starters/graphql-starter/app/api/draft/route.ts +++ b/starters/graphql-starter/app/api/draft/route.ts @@ -3,5 +3,5 @@ import { enableDraftMode } from "next-drupal/draft" import type { NextRequest } from "next/server" export async function GET(request: NextRequest): Promise { - return enableDraftMode(request, drupal) + return await enableDraftMode(request, drupal) } diff --git a/starters/graphql-starter/components/misc/DraftAlert/index.tsx b/starters/graphql-starter/components/misc/DraftAlert/index.tsx index a07f0d67..b66828e0 100644 --- a/starters/graphql-starter/components/misc/DraftAlert/index.tsx +++ b/starters/graphql-starter/components/misc/DraftAlert/index.tsx @@ -2,8 +2,9 @@ import { Suspense } from "react" import { draftMode } from "next/headers" import { DraftAlertClient } from "./Client" -export function DraftAlert() { - const isDraftEnabled = draftMode().isEnabled +export async function DraftAlert() { + const draftModeStore = await draftMode() + const isDraftEnabled = draftModeStore.isEnabled return ( diff --git a/starters/graphql-starter/package.json b/starters/graphql-starter/package.json index de37fd56..c7d90f5d 100644 --- a/starters/graphql-starter/package.json +++ b/starters/graphql-starter/package.json @@ -1,10 +1,10 @@ { "name": "graphql-starter", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "private": true, "license": "MIT", "scripts": { - "dev": "next dev", + "dev": "next dev --turbopack", "build": "next build", "start": "next start", "preview": "next build && next start", @@ -13,19 +13,19 @@ "format:check": "prettier --check ." }, "dependencies": { - "next": "^14.2.2", - "next-drupal": "^2.0.0-beta.0", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "next": "^15.0.4", + "next-drupal": "^2.0.0-beta.1", + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "devDependencies": { "@tailwindcss/typography": "^0.5.12", "@types/node": "^20.12.7", - "@types/react": "^18.2.79", - "@types/react-dom": "^18.2.25", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", "autoprefixer": "^10.4.19", "eslint": "^8.57.0", - "eslint-config-next": "^14.2.2", + "eslint-config-next": "^15.0.4", "postcss": "^8.4.38", "prettier": "^3.2.5", "tailwindcss": "^3.4.3",