Skip to content

feat(nextjs): Support async headers() - #4278

Merged
jacekradko merged 17 commits into
feat/nextjs-15-compatfrom
jacek/async-headers
Oct 21, 2024
Merged

feat(nextjs): Support async headers()#4278
jacekradko merged 17 commits into
feat/nextjs-15-compatfrom
jacek/async-headers

Conversation

@jacekradko

@jacekradko jacekradko commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

Description

Related #4245

Tested the codemod in dashboard: https://github.com/clerk/dashboard/pull/3886

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Oct 3, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee76c39

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

This PR includes changesets to release 2 packages
Name Type
@clerk/nextjs Major
@clerk/upgrade 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

Comment thread packages/nextjs/tsconfig.declarations.json
Comment thread packages/nextjs/src/server/clerkMiddleware.ts Outdated
@jacekradko
jacekradko force-pushed the jacek/async-headers branch from 4f0263d to 6c0eaa7 Compare October 4, 2024 14:42
@jacekradko jacekradko changed the title feat: async headers feat(nextjs): async headers Oct 4, 2024
@jacekradko jacekradko changed the title feat(nextjs): async headers feat(nextjs): support async headers() Oct 4, 2024
Comment thread .changeset/grumpy-hairs-remember.md Outdated
@jacekradko jacekradko changed the title feat(nextjs): support async headers() feat(nextjs): Support async headers() Oct 4, 2024
Comment thread integration/templates/next-app-router/src/middleware.ts Outdated
Comment thread .changeset/grumpy-hairs-remember.md Outdated
Comment thread packages/nextjs/src/server/clerkClient.ts
@jacekradko

Copy link
Copy Markdown
Contributor Author

!snapshot

@jacekradko

Copy link
Copy Markdown
Contributor Author

!snapshot

@clerk-cookie

Copy link
Copy Markdown
Collaborator

Hey @jacekradko - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 1.3.17-snapshot.vb87a27f
@clerk/backend 1.14.2-snapshot.vb87a27f
@clerk/chrome-extension 1.3.21-snapshot.vb87a27f
@clerk/clerk-js 5.28.0-snapshot.vb87a27f
@clerk/elements 0.17.0-snapshot.vb87a27f
@clerk/clerk-expo 2.2.27-snapshot.vb87a27f
@clerk/express 1.3.2-snapshot.vb87a27f
@clerk/fastify 2.0.4-snapshot.vb87a27f
@clerk/localizations 3.3.1-snapshot.vb87a27f
@clerk/nextjs 6.0.0-snapshot.vb87a27f
@clerk/clerk-react 5.12.1-snapshot.vb87a27f
@clerk/remix 4.2.40-snapshot.vb87a27f
@clerk/clerk-sdk-node 5.0.53-snapshot.vb87a27f
@clerk/shared 2.10.0-snapshot.vb87a27f
@clerk/tanstack-start 0.4.16-snapshot.vb87a27f
@clerk/testing 1.3.14-snapshot.vb87a27f
@clerk/themes 2.1.38-snapshot.vb87a27f
@clerk/types 4.27.0-snapshot.vb87a27f
@clerk/upgrade 1.1.0-snapshot.vb87a27f

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@1.3.17-snapshot.vb87a27f --save-exact

@clerk/backend

npm i @clerk/backend@1.14.2-snapshot.vb87a27f --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.3.21-snapshot.vb87a27f --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.28.0-snapshot.vb87a27f --save-exact

@clerk/elements

npm i @clerk/elements@0.17.0-snapshot.vb87a27f --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.2.27-snapshot.vb87a27f --save-exact

@clerk/express

npm i @clerk/express@1.3.2-snapshot.vb87a27f --save-exact

@clerk/fastify

npm i @clerk/fastify@2.0.4-snapshot.vb87a27f --save-exact

@clerk/localizations

npm i @clerk/localizations@3.3.1-snapshot.vb87a27f --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.0.0-snapshot.vb87a27f --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.12.1-snapshot.vb87a27f --save-exact

@clerk/remix

npm i @clerk/remix@4.2.40-snapshot.vb87a27f --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.53-snapshot.vb87a27f --save-exact

@clerk/shared

npm i @clerk/shared@2.10.0-snapshot.vb87a27f --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.4.16-snapshot.vb87a27f --save-exact

@clerk/testing

npm i @clerk/testing@1.3.14-snapshot.vb87a27f --save-exact

@clerk/themes

npm i @clerk/themes@2.1.38-snapshot.vb87a27f --save-exact

@clerk/types

npm i @clerk/types@4.27.0-snapshot.vb87a27f --save-exact

@clerk/upgrade

npm i @clerk/upgrade@1.1.0-snapshot.vb87a27f --save-exact

Comment thread packages/upgrade/src/constants/versions.js Outdated
@jacekradko

Copy link
Copy Markdown
Contributor Author

!snapshot

@clerk-cookie

Copy link
Copy Markdown
Collaborator

Hey @jacekradko - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 1.3.17-snapshot.v49b6f8d
@clerk/backend 1.14.2-snapshot.v49b6f8d
@clerk/chrome-extension 1.3.21-snapshot.v49b6f8d
@clerk/clerk-js 5.28.0-snapshot.v49b6f8d
@clerk/elements 0.17.0-snapshot.v49b6f8d
@clerk/clerk-expo 2.2.27-snapshot.v49b6f8d
@clerk/express 1.3.2-snapshot.v49b6f8d
@clerk/fastify 2.0.4-snapshot.v49b6f8d
@clerk/localizations 3.3.1-snapshot.v49b6f8d
@clerk/nextjs 6.0.0-snapshot.v49b6f8d
@clerk/clerk-react 5.12.1-snapshot.v49b6f8d
@clerk/remix 4.2.40-snapshot.v49b6f8d
@clerk/clerk-sdk-node 5.0.53-snapshot.v49b6f8d
@clerk/shared 2.10.0-snapshot.v49b6f8d
@clerk/tanstack-start 0.4.16-snapshot.v49b6f8d
@clerk/testing 1.3.14-snapshot.v49b6f8d
@clerk/themes 2.1.38-snapshot.v49b6f8d
@clerk/types 4.27.0-snapshot.v49b6f8d
@clerk/upgrade 1.1.0-snapshot.v49b6f8d

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@1.3.17-snapshot.v49b6f8d --save-exact

@clerk/backend

npm i @clerk/backend@1.14.2-snapshot.v49b6f8d --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.3.21-snapshot.v49b6f8d --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.28.0-snapshot.v49b6f8d --save-exact

@clerk/elements

npm i @clerk/elements@0.17.0-snapshot.v49b6f8d --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.2.27-snapshot.v49b6f8d --save-exact

@clerk/express

npm i @clerk/express@1.3.2-snapshot.v49b6f8d --save-exact

@clerk/fastify

npm i @clerk/fastify@2.0.4-snapshot.v49b6f8d --save-exact

@clerk/localizations

npm i @clerk/localizations@3.3.1-snapshot.v49b6f8d --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.0.0-snapshot.v49b6f8d --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.12.1-snapshot.v49b6f8d --save-exact

@clerk/remix

npm i @clerk/remix@4.2.40-snapshot.v49b6f8d --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.53-snapshot.v49b6f8d --save-exact

@clerk/shared

npm i @clerk/shared@2.10.0-snapshot.v49b6f8d --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.4.16-snapshot.v49b6f8d --save-exact

@clerk/testing

npm i @clerk/testing@1.3.14-snapshot.v49b6f8d --save-exact

@clerk/themes

npm i @clerk/themes@2.1.38-snapshot.v49b6f8d --save-exact

@clerk/types

npm i @clerk/types@4.27.0-snapshot.v49b6f8d --save-exact

@clerk/upgrade

npm i @clerk/upgrade@1.1.0-snapshot.v49b6f8d --save-exact

@jacekradko
jacekradko changed the base branch from main to feat/nextjs-15-compat October 18, 2024 17:00
@jacekradko
jacekradko marked this pull request as ready for review October 18, 2024 17:00
@jacekradko

Copy link
Copy Markdown
Contributor Author

!snapshot

@clerk-cookie

Copy link
Copy Markdown
Collaborator

Hey @jacekradko - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 1.4.0-snapshot.vfbd7c17
@clerk/backend 1.14.2-snapshot.vfbd7c17
@clerk/chrome-extension 1.3.21-snapshot.vfbd7c17
@clerk/clerk-js 5.28.0-snapshot.vfbd7c17
@clerk/elements 0.17.0-snapshot.vfbd7c17
@clerk/clerk-expo 2.2.27-snapshot.vfbd7c17
@clerk/express 1.3.2-snapshot.vfbd7c17
@clerk/fastify 2.0.4-snapshot.vfbd7c17
@clerk/localizations 3.3.1-snapshot.vfbd7c17
@clerk/nextjs 6.0.0-snapshot.vfbd7c17
@clerk/clerk-react 5.12.1-snapshot.vfbd7c17
@clerk/remix 4.2.40-snapshot.vfbd7c17
@clerk/clerk-sdk-node 5.0.53-snapshot.vfbd7c17
@clerk/shared 2.10.0-snapshot.vfbd7c17
@clerk/tanstack-start 0.4.16-snapshot.vfbd7c17
@clerk/testing 1.3.14-snapshot.vfbd7c17
@clerk/themes 2.1.38-snapshot.vfbd7c17
@clerk/types 4.27.0-snapshot.vfbd7c17
@clerk/upgrade 1.1.0-snapshot.vfbd7c17

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@1.4.0-snapshot.vfbd7c17 --save-exact

@clerk/backend

npm i @clerk/backend@1.14.2-snapshot.vfbd7c17 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.3.21-snapshot.vfbd7c17 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.28.0-snapshot.vfbd7c17 --save-exact

@clerk/elements

npm i @clerk/elements@0.17.0-snapshot.vfbd7c17 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.2.27-snapshot.vfbd7c17 --save-exact

@clerk/express

npm i @clerk/express@1.3.2-snapshot.vfbd7c17 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.0.4-snapshot.vfbd7c17 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.3.1-snapshot.vfbd7c17 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.0.0-snapshot.vfbd7c17 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.12.1-snapshot.vfbd7c17 --save-exact

@clerk/remix

npm i @clerk/remix@4.2.40-snapshot.vfbd7c17 --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.53-snapshot.vfbd7c17 --save-exact

@clerk/shared

npm i @clerk/shared@2.10.0-snapshot.vfbd7c17 --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.4.16-snapshot.vfbd7c17 --save-exact

@clerk/testing

npm i @clerk/testing@1.3.14-snapshot.vfbd7c17 --save-exact

@clerk/themes

npm i @clerk/themes@2.1.38-snapshot.vfbd7c17 --save-exact

@clerk/types

npm i @clerk/types@4.27.0-snapshot.vfbd7c17 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@1.1.0-snapshot.vfbd7c17 --save-exact

@t3dotgg

t3dotgg commented Oct 19, 2024

Copy link
Copy Markdown

👀

@brkalow brkalow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good! Left some minor comments. Let's get it merged into the 15 branch 🚢

Comment thread packages/upgrade/src/components/SDKWorkflow.js
Comment thread packages/upgrade/src/codemods/index.js Outdated

const __dirname = dirname(fileURLToPath(import.meta.url));

export async function runCodemod(transform = 'transform-async-request', glob, options) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] Do we need to make this the default value for transform? Feels a bit odd with the thought that we'll be adding more down the line.

import transformer from '../transform-async-request.cjs';
import { fixtures } from './__fixtures__/transform-async-request.fixtures';

describe('transform-async-request', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice 👏

Comment thread packages/nextjs/MIGRATION.md
Comment thread packages/upgrade/src/app.js Outdated
Comment thread packages/upgrade/src/app.js Outdated
@jacekradko
jacekradko merged commit 81e2d7f into feat/nextjs-15-compat Oct 21, 2024
@jacekradko
jacekradko deleted the jacek/async-headers branch October 21, 2024 17:43
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.

Next15 async headers method compat

4 participants