-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG-1919] experimental app router updates to next 15 and react 19 (#…
…1994) * fix(experimental-app-router): Resolve onLogin issue on Vercel deployment (#1919) * fix(experimental-app-router): Resolve onLogin issue on Vercel deployment - adding one more eslint addition (#1919) * fix(experimental-app-router): Resolve onLogin issue on Vercel deployment - updating example repo (#1919) * adding changset * fix(experimental-app-router): Resolve onLogin issue on Vercel deployment - Adding use server on logout action(#1919) * Testing on example repo * Testing on example repo * (@faustwp/experimental-app-router) Updating example next 15 errors related to awaiting params (1919) * (@faustwp/experimental-app-router) Updating example next 15 errors related to awaiting params (1919) * (@faustwp/experimental-app-router) Updating changeset (1919) * [bug-1919-experimental-app-router] Bumping down next version on example
- Loading branch information
1 parent
dc2b753
commit 5457479
Showing
16 changed files
with
3,528 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
'@faustwp/experimental-app-router': minor | ||
--- | ||
|
||
--- | ||
|
||
## '@faustwp/experimental-app-router': minor | ||
|
||
Update @faustwp/experimental-app-router to account for next 15 changes to cookies and update NextResponse import | ||
|
||
Notable changes: | ||
|
||
- Adding await to all cookies requests as per Next documentation: https://nextjs.org/docs/app/api-reference/functions/cookies | ||
|
||
``` | ||
import { cookies } from 'next/headers' | ||
export default async function Page() { | ||
const cookieStore = await cookies() | ||
const theme = cookieStore.get('theme') | ||
return '...' | ||
} | ||
``` | ||
|
||
- Files changed: | ||
|
||
- packages/experimental-app-router/src/server-actions/logoutAction.ts | ||
- packages/experimental-app-router/src/server-actions/utils/setRefreshToken.ts | ||
- packages/experimental-app-router/src/server/auth/fetchTokens.ts | ||
- packages/experimental-app-router/src/server/routeHandler/tokenHandler.ts | ||
|
||
- Updated Next App Router example to use latest next version and React 19 RC. | ||
- Updated Example Login form using React 19s useActionState | ||
- Updated Awaiting of params for Next 15 | ||
- Files Changed: | ||
- examples/next/app-router/app/login/page.tsx | ||
- examples/next/app-router/package.json | ||
- examples/next/app-router/[slug]hasPreviewProps.ts (made async) | ||
- examples/next/app-router/[slug]page.tsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export function hasPreviewProps(props: any) { | ||
return props?.searchParams?.preview === 'true' && !!props?.searchParams?.p; | ||
export async function hasPreviewProps(props: any) { | ||
const { searchParams } = await props; | ||
const { preview, p } = await searchParams; | ||
|
||
return preview === 'true' && !!p; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.