-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nextjs): Improve top-level API surface and drop unsupported vers…
…ions (#2347) * feat(nextjs): Drop support for next@12, next<13.0.4, next<14.0.3 Drop support for NextJS v12: v12 was released on 26 Oct 2021 (~2 years ago). Security support ended on 21 Nov 2022 (~11 months ago) Drop support for NextJS <13.0.4: Many header-related bugs and breaking changes were introduced with the 12.1.0, 12.2.0, 13.0.1, 13.0.2, 13.0.3 releases. Vercel fixed all known related-bugs with version 13.0.4. In order to support every release in the range of 12 to 13.0.4 we had to resort to various workaround/compatibility layers (example https://github.com/clerk/javascript/blob/92727eec39566278263ffa118a085493f964eb94/packages/nextjs/src/server/utils.ts#L76). If we drop support for v12 and the other problematic versions, we can also remove all the extra logic from the @clerk/nextjs package Drop support for NextJS < 14.0.3 for the issues described here: #1436 * feat(nextjs): Deprecate `authMiddleware` in favor of `clerkMiddleware` * feat(nextjs): Move errors to /errors * feat(nextjs): Move server-related APIs to /server chore(repo): Add changesets chore(repo): Update changesets * chore(repo): Update playground apps
- Loading branch information
1 parent
9a637e4
commit e602d6c
Showing
53 changed files
with
74 additions
and
1,080 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,13 @@ | ||
--- | ||
'@clerk/nextjs': major | ||
--- | ||
|
||
Drop support for NextJS v12: v12 was released on 26 Oct 2021. Support for security updates stopped on 21 Nov 2022. | ||
|
||
Drop support for NextJS <13.0.4: Various header-related bugs were introduced with the 12.1.0, 12.2.0, 13.0.1, 13.0.2, 13.0.3 NextJS releases which are now fixed since next@^13.0.4. We will be dropping support for these problematic versions in order to greatly reduce complexity in our codebase. | ||
|
||
Drop support for NextJS < 14.0.3 because of the issues described here: https://github.com/clerk/javascript/issues/1436. | ||
|
||
Deprecate `authMiddleware` in favor of `clerkMiddleware`. For more information, see https://clerk.com/docs/upgrade-guides/v5-introduction | ||
|
||
Move the server-side APIs from `@clerk/nextjs` to the `@clerk/nextjs/server` module: `WebhookEventType`, `WebhookEvent`, `verifyToken`, `redirectToSignIn`, `auth`, `buildClerkProps`, `clerkClient`, `currentUser`, `getAuth`, `redirectToSignUp` and `authMiddleware`. For more information, see https://clerk.com/docs/upgrade-guides/v5-introduction |
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,5 @@ | ||
--- | ||
'@clerk/backend': major | ||
--- | ||
|
||
Drop unused SearchParams.AuthStatus constant |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"main": "../dist/cjs/errors.js", | ||
"module": "../dist/esm/errors.js", | ||
"types": "../dist/types/errors.d.ts" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from './client-boundary/hooks'; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ const clerkClient = createClerkClient({ | |
}); | ||
|
||
export { clerkClient }; | ||
export * from '@clerk/backend'; |
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,7 +1,15 @@ | ||
export * from './clerkClient'; | ||
/** | ||
* Generic exports | ||
*/ | ||
export { verifyToken, createClerkClient } from '@clerk/backend'; | ||
export type { WebhookEvent, WebhookEventType } from '@clerk/backend'; | ||
export { clerkClient } from './clerkClient'; | ||
|
||
/** | ||
* NextJS-specific exports | ||
*/ | ||
export { buildClerkProps, getAuth } from './getAuth'; | ||
export { redirectToSignIn, redirectToSignUp } from './redirect'; | ||
|
||
export { auth } from '../app-router/server/auth'; | ||
export { currentUser } from '../app-router/server/currentUser'; | ||
export { authMiddleware } from './authMiddleware'; |
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.