Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG-1919] experimental app router updates to next 15 and react 19 #1994

Open
wants to merge 11 commits into
base: canary
Choose a base branch
from

Conversation

CesarBenavides777
Copy link

@CesarBenavides777 CesarBenavides777 commented Nov 26, 2024

Tasks

  • [] I have signed a Contributor License Agreement (CLA) with WP Engine.
    • I have not received the email yet
  • If a code change, I have written testing instructions that the whole team & outside contributors can understand.
  • I have written and included a comprehensive changeset to properly document the changes I've made.

Description


'@faustwp/experimental-app-router': minor

Update @faustwp/experimental-app-router to account for next 15 changes to cookies and update NextResponse import

Notable changes:

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
  • Added use server to logout action

  • Files changed:

    • packages/experimental-app-router/src/server-actions/logoutAction.ts
  • Updated Next App Router example to use latest next version and React 19 RC.

  • Updated Example Login form using React 19s useActionState

  • Files Changed:

    • examples/next/app-router/app/login/page.tsx
    • examples/next/app-router/package.json

Related Issue(s):

Testing

Built and linked the local package to the updated example repo and it works as expected.
repo: https://github.com/CesarBenavides777/1919-fix-reproduction.git
Used bun and latest react and next versions just to see if it would work.
Built locally using vercel build --prod and vercel --prebuilt --prod to deploy it linked with the updated package.

https://1919-fix-reproduction.vercel.app/login
https://1919-fix-reproduction.vercel.app/my-account

Deployed on vercel
Subscriber User Credentials:
Username: TEST
Password: qk!TJAlsUC*dqRBy2z(u6(rQ

Screenshots

image

Documentation Changes

None

Dependant PRs

@CesarBenavides777 CesarBenavides777 requested a review from a team as a code owner November 26, 2024 18:27

Currently, we do not support the creation of preview deployments based on changes coming from forked repositories.
Learn more about preview environments in our documentation.

Copy link

changeset-bot bot commented Nov 26, 2024

🦋 Changeset detected

Latest commit: 1acee20

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@faustwp/experimental-app-router Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@theodesp
Copy link
Member

Hey @CesarBenavides777 There is a conflicting peer dependency with next 15. maybe we can reduce that to be next 13 and onwards.

https://github.com/wpengine/faustjs/blob/08a54c61714e005c49cf9a7000f1a65bd85ff6d1/packages/experimental-app-router/package.json#L54C4-L54C24

@CesarBenavides777
Copy link
Author

@theodesp do you want me to revert the changes I made to the example repo? That's using the latest next and react as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants