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

chore: support next.js 15 #4387

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

siddhsuresh
Copy link
Member

@siddhsuresh siddhsuresh commented Oct 26, 2024

Closes: #4385 #4385

What are the changes and their implications?

Bug Checklist

  • Changeset added (run pnpm changeset in the root directory)
  • Integration test added (see test docs if needed)

Feature Checklist

Copy link

changeset-bot bot commented Oct 26, 2024

🦋 Changeset detected

Latest commit: 9219ec7

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

This PR includes changesets to release 8 packages
Name Type
@blitzjs/auth Major
@blitzjs/next Major
@blitzjs/rpc Major
blitz Minor
next-blitz-auth Patch
@blitzjs/codemod Major
@blitzjs/config Major
@blitzjs/generator Major

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

@siddhsuresh
Copy link
Member Author

!preview next-js-15

Copy link
Contributor

github-actions bot commented Nov 5, 2024

Snapshot Release next-js-15

@@ -289,8 +289,10 @@ const makeProxyToPublicData = <T extends SessionContextClass>(ctxClass: T): T =>
export async function getBlitzContext(): Promise<Ctx> {
try {
const {headers, cookies} = require("next/headers")
const reqHeader = Object.fromEntries(headers())
const csrfToken = cookies().get(COOKIE_CSRF_TOKEN())
const cookieStore = await cookies()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would wrap this in Promise.resolve to maintain backward compatibility with Next.js 14 and earlier versions.

const reqHeader = Object.fromEntries(headers())
const csrfToken = cookies().get(COOKIE_CSRF_TOKEN())
const cookieStore = await cookies()
const headersStore = await headers()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here offcourse

@siddhsuresh siddhsuresh marked this pull request as ready for review November 22, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Next 15 error when using getBlitzContext Blitz 2.1.2 doesn't work with Next 15 --turbo
3 participants