@clerk/upgrade 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
1
+ import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
2
2
  const version = 'core-2';
3
3
  const semverVersion = 'v5';
4
4
  const name = 'gatsby';
@@ -18,7 +18,7 @@ async function generate() {
18
18
  packageName
19
19
  }), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
20
20
  packageName: 'gatsby-plugin-clerk'
21
- }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
21
+ }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('aftersignxurl-changes'), markdown('orgs-claim'), markdownTemplate('path-routing', {
22
22
  packageName
23
23
  }), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping()]);
24
24
  }
@@ -1,4 +1,4 @@
1
- import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
1
+ import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
2
2
  const version = 'core-2';
3
3
  const semverVersion = 'v5';
4
4
  const name = 'js';
@@ -18,7 +18,7 @@ async function generate() {
18
18
  packageName
19
19
  }), markdownTemplate('update-version', {
20
20
  packageName
21
- }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
21
+ }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('aftersignxurl-changes'), markdown('orgs-claim'), markdownTemplate('path-routing', {
22
22
  packageName
23
23
  }), markdown('image-url'), accordionForCategory('image-url'), markdown('pagination-args'), accordionForCategory('pagination-args'), markdown('pagination-return'), accordionForCategory('pagination-return'),
24
24
  // createOrganization args?
@@ -1,4 +1,4 @@
1
- import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
1
+ import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
2
2
  const version = 'core-2';
3
3
  const semverVersion = 'v5';
4
4
  const name = 'nextjs';
@@ -18,7 +18,7 @@ async function generate() {
18
18
  packageName
19
19
  }), markdown('node-version'), markdown('react-version'), markdown('nextjs-version'), markdownTemplate('update-version', {
20
20
  packageName
21
- }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('middleware-changes'), markdown('import-changes'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
21
+ }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('middleware-changes'), markdown('import-changes'), markdown('after-sign-x-handling'), singleItem('aftersignxurl-changes'), markdown('orgs-claim'), markdownTemplate('path-routing', {
22
22
  packageName
23
23
  }), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
24
24
  }
@@ -2,54 +2,9 @@
2
2
 
3
3
  User and customer feedback about `authMiddleware()` has been clear in that Middleware logic was a often friction point. As such, in v5 you will find a completely new Middleware helper called [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) that should alleviate the issues folks had with `authMiddleware()`.
4
4
 
5
- Additionally, there are now new helpers that enable controlling auth on a _per-page and/or per-layout basis_ when using App Router. While you can still configure which routes are protected via Middleware, the page-based protection strategy is what is now recommended, as the co-location of auth protection configuration with the code for the pages themselves results in a superior developer experience that adds clarity as you navigate your codebase.
5
+ The primary change from the previous `authMiddleware()` is that `clerkMiddleware()` does not protect any routes by default, instead requiring the developer to add routes they would like to be protected by auth. This is a substantial contrast to the previous `authMiddleware()`, which protected all routes by default, requiring the developer to add exceptions. The API was also substantially simplified, and it has become easier to combine with other Middleware helpers smoothly as well.
6
6
 
7
- #### Per-route auth config
8
-
9
- Sometimes, code speaks louder than words. Let's get right into an example:
10
-
11
- <Tabs type="auth-protect-layout-page" items={["Layout", "Page"]}>
12
- <Tab>
13
- ```ts filename="app/src/dashboard/layout.tsx"
14
- import { auth } from '@clerk/nextjs/server'
15
-
16
- export default async function DashboardLayout({ children }) {
17
- auth().protect();
18
- // 👆 This one line is all it takes - the layout and all its children
19
- // will now redirect to your sign in page for un-authenticated users.
20
-
21
- return <>{children}</>
22
- }
23
- ```
24
-
25
- </Tab>
26
- <Tab>
27
- ```ts filename="app/src/dashboard/page.tsx"
28
- import { auth } from '@clerk/nextjs/server'
29
-
30
- export default async function DashboardPage() {
31
- auth().protect();
32
- // 👆 This one line is all it takes - the layout and all its children
33
- // will now redirect to your sign in page for un-authenticated users.
34
-
35
- return <p>This page is now protected!</p>
36
- }
37
- ```
38
-
39
- </Tab>
40
- </Tabs>
41
-
42
- In this example, you add [`auth().protect()`](/docs/references/nextjs/auth#protect) to a layout and that layout and all of it's children will be gated by auth. The same logic can be applied for pages.
43
-
44
- For more details on route protection, check out the [route protection guide](/references/nextjs/route-protection).
45
-
46
- If you are using the pages router, per-route gating won't work. Instead, configure your auth gating via Middleware as described in the next section.
47
-
48
- #### Middleware auth config
49
-
50
- If you prefer to define your auth logic within the Middleware, you can still do this using the new `clerkMiddleware`. The primary change from the previous `authMiddleware()` is that `clerkMiddleware()` does not protect any routes by default, instead requiring the developer to add routes they would like to be protected by auth. This is a substantial contrast to the previous `authMiddleware()`, which protected all routes by default, requiring the developer to add exceptions. The API was also substantially simplified, and it has become easier to combine with other Middleware helpers smoothly as well.
51
-
52
- Here's an example that replicates the auth protection scheme above, but entirely inside the Middleware:
7
+ Here's an example that demonstrates route protection based on both authentication and authorization:
53
8
 
54
9
  ```ts filename="middleware.ts"
55
10
  import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
@@ -74,7 +29,9 @@ A couple things to note here:
74
29
 
75
30
  - The `createRouteMatcher` helper makes it easy to define route groups that you can leverage inside the Middleware function and check in whichever order you'd like. Note that it can take an array of routes as well.
76
31
  - With `clerkMiddleware`, you're defining the routes you want **to be protected**, rather than the routes you don't want to be protected.
77
- - You are able to use the same `auth().protect()` helpers that you can use within layouts/pages here in the Middleware.
32
+ - The [`auth().protect()`](https://clerk.com/docs/references/nextjs/auth#protect) helper is utilized heavily here, check out its docs for more info.
33
+
34
+ See the [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) docs for more information and detailed usage examples.
78
35
 
79
36
  #### Migrating to `clerkMiddleware()`
80
37
 
@@ -94,9 +51,9 @@ The most basic migration will be updating the import and changing out the defaul
94
51
  }
95
52
  ```
96
53
 
97
- Of course, in most cases you'll have a more complicated setup than this. You can find some examples below for how to migrate a few common use cases. Be sure to review the [`clerkMiddleware()` documentation](/docs/references/nextjs/clerk-middleware) and [route protection guide](/docs/references/nextjs/route-protection) if your specific use case is not mentioned.
54
+ Of course, in most cases you'll have a more complicated setup than this. You can find some examples below for how to migrate a few common use cases. Be sure to review the [`clerkMiddleware()` documentation](/docs/references/nextjs/clerk-middleware) if your specific use case is not mentioned.
98
55
 
99
- <Accordion titles={["Protecting all routes except one or more public paths", "Protecting a single route path", "Combining with other Middlewares (like i18n)"]} heading="h4">
56
+ <Accordion titles={["Protecting all routes except one or more public paths", "Protecting a single route path", "Combining with other Middlewares (like i18n)", "Using the redirectToSignIn method"]} heading="h4">
100
57
  <AccordionPanel>
101
58
  By default, `clerkMiddleware()` treats all pages as public unless explicitly protected. If you prefer for it to operate the other way around (all pages are protected unless explicitly made public), you can reverse the middleware logic in this way:
102
59
 
@@ -226,4 +183,36 @@ Of course, in most cases you'll have a more complicated setup than this. You can
226
183
  ```
227
184
 
228
185
  </AccordionPanel>
186
+ <AccordionPanel>
187
+ You can now access `redirectToSignIn` from the `auth()` object, rather than importing at the top level.
188
+
189
+ Before:
190
+
191
+ ```ts filename="middleware.ts"
192
+ import { authMiddleware, redirectToSignIn } from "@clerk/nextjs"
193
+
194
+ export default authMiddleware({
195
+ if (someCondition) redirectToSignIn()
196
+ })
197
+
198
+ export const config = {
199
+ matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
200
+ }
201
+ ```
202
+
203
+ After:
204
+
205
+ ```ts filename="middleware.ts"
206
+ import { clerkMiddleware } from "@clerk/nextjs/server"
207
+
208
+ export default clerkMiddleware((auth, req) => {
209
+ if (someCondition) auth().redirectToSignIn()
210
+ })
211
+
212
+ export const config = {
213
+ matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
214
+ }
215
+ ```
216
+
217
+ </AccordionPanel>
229
218
  </Accordion>
@@ -18,7 +18,7 @@ async function generate() {
18
18
  version: semverVersion
19
19
  }), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
20
20
  packageName
21
- }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('navigate-to-routerpush-routerreplace'), markdown('orgs-claim'), markdownTemplate('path-routing', {
21
+ }), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('aftersignxurl-changes'), singleItem('navigate-to-routerpush-routerreplace'), markdown('orgs-claim'), markdownTemplate('path-routing', {
22
22
  packageName
23
23
  }), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
24
24
  }
@@ -18,7 +18,7 @@ async function generate() {
18
18
  packageName
19
19
  }), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
20
20
  packageName
21
- }), markdown('cli'), '## Breaking Changes', singleItem('clerkerrorboundary-removed'), markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
21
+ }), markdown('cli'), '## Breaking Changes', singleItem('clerkerrorboundary-removed'), markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('aftersignxurl-changes'), markdown('orgs-claim'), markdownTemplate('path-routing', {
22
22
  packageName
23
23
  }), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping()]);
24
24
  }
@@ -7,3 +7,5 @@ The new version ships with improved design and UX across all of Clerk's [UI comp
7
7
  </Callout>
8
8
 
9
9
  The sections below contain more info on each change made to the customization ids and localization keys for reference. Regardless of how thoroughly you have reviewed the following information, we still recommend that you ensure that you have taken some time to manually look through each of your views to ensure that everything looks good still.
10
+
11
+ Also worth noting - if you are using Clerk's account portal (hosted sign in page), and would like to enable the new design there, you can do so via the "customization" tab on the [account portal page](https://dashboard.clerk.com/last-active?path=account-portal) in your dashboard. Selecting "Core 2" from the "ClerkJS Components" dropdown will enable the new designs.
@@ -1,4 +1,4 @@
1
- ### After sign up/in/out URL handling
1
+ ### After sign up/in/out default value change
2
2
 
3
3
  Defining redirect URLs for after sign up, in, and/or out via the Clerk dashboard has been removed in Core 2. In your Clerk dashboard, under "paths", there is a section called "Component paths", where URLs could be defined that had a deprecation warning. In Core 2, this functionality has been removed, and specifying redirect paths via the dashboard will no longer work. If you need to pass a redirect URL for after sign in/up/out, there are [a few different ways this can be done](https://clerk.com/docs/account-portal/custom-redirects), from environment variables to middleware to supplying them directly to the relevant components.
4
4
 
@@ -21,7 +21,9 @@ export function assembleContent(options, content) {
21
21
  export function frontmatter(obj) {
22
22
  return `---
23
23
  ${Object.keys(obj).map(k => `${k}: "${obj[k]}"`).join('\n')}
24
- ---`;
24
+ ---
25
+
26
+ {/* WARNING: This is a generated file and should not be edited directly. To update its contents, see the "upgrade" package in the clerk/javascript repo. */}`;
25
27
  }
26
28
 
27
29
  // Renders a markdown file, partial-style - will read out of shared if not found in sdk dir
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: "`Organization.members_count` -> `Organization.membersCount`"
3
+ matcher: "\.members_count"
4
+ ---
5
+
6
+ The `members_count` attribute of the `Organization` resource has been renamed to `membersCount` to match the naming convention of other attributes.
7
+
8
+ ```diff
9
+ - organization.members_count
10
+ + organization.membersCount
11
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: '`afterSignXUrl` changes'
3
+ matcher:
4
+ - 'CLERK_AFTER_SIGN_IN_URL'
5
+ - 'CLERK_AFTER_SIGN_UP_URL'
6
+ - "<ClerkProvider[\\s\\S]*?(afterSignInUrl)=[\\s\\S]*?>"
7
+ - "<ClerkProvider[\\s\\S]*?(afterSignUpUrl)=[\\s\\S]*?>"
8
+ - "<ClerkProvider[\\s\\S]*?(redirectUrl)=[\\s\\S]*?>"
9
+ - "<SignIn[\\s\\S]*?(afterSignInUrl)=[\\s\\S]*?>"
10
+ - "<SignIn[\\s\\S]*?(afterSignUpUrl)=[\\s\\S]*?>"
11
+ - "<SignIn[\\s\\S]*?(redirectUrl)=[\\s\\S]*?>"
12
+ - "<SignUp[\\s\\S]*?(afterSignInUrl)=[\\s\\S]*?>"
13
+ - "<SignUp[\\s\\S]*?(afterSignUpUrl)=[\\s\\S]*?>"
14
+ - "<SignUp[\\s\\S]*?(redirectUrl)=[\\s\\S]*?>"
15
+ category: 'after-sign-x-url-changes'
16
+ matcherFlags: 'm'
17
+ ---
18
+
19
+ Some changes are being made to the way that "after sign up/in url"s and redirect url props are handled as part of this new version, in order to make behavior more clear and predictable.
20
+
21
+ > We will refer to these urls as `afterSignXUrl` where `X` could be `Up` or `In` depending on the context.
22
+
23
+ Previously, setting `afterSignInUrl` or `afterSignOutUrl` would only actually redirect some of the time. If the user clicks on any form of link that takes them to a sign up/in page, Clerk automatically sets `redirect_url` in the querystring such that after the sign up or in, the user is returned back to the page they were on before. This is a common pattern for sign up/in flows, as it leads to the least interruption of the user's navigation through your app. When a `redirect_url` is present, any value passed to `afterSignInUrl` or `afterSignUpUrl` is ignored. However, if the user navigates directly to a sign up/in page, there’s no redirect url in the querystring and in this case the `afterSignInUrl` or `afterSignOutUrl` would take effect. This behavior was not intuitive and didn't give a way to force a redirect after sign up/in, so the behavior is changing to address both of these issues.
24
+
25
+ All `afterSignXUrl` props and `CLERK_AFTER_SIGN_X_URL` environment variables have been removed, and should be replaced by one of the following options:
26
+
27
+ - `signXForceRedirectUrl` / `CLERK_SIGN_X_FORCE_REDIRECT_URL` - if set, Clerk will always redirect to provided URL, regardless of what page the user was on before. Use this option with caution, as it will interrupt the user’s flow by taking them away from the page they were on before.
28
+ - `signXFallbackRedirectUrl` / `CLERK_SIGN_UP_FALLBACK_REDIRECT_URL` - if set, this will mirror the previous behavior, only redirecting to the provided URL if there is no `redirect_url` in the querystring.
29
+
30
+ If neither value is set, Clerk will redirect to the `redirect_url` if present, otherwise it will redirect to `/`. If you'd like to retain the current behavior of your app without any changes, you can switch `afterSignXUrl` with `signXFallbackRedirectUrl` as such:
31
+
32
+ ```diff
33
+ - <SignIn afterSignInUrl='/foo' />
34
+ + <SignIn signInFallbackRedirectUrl='/foo' />
35
+ ```
@@ -4,7 +4,7 @@ const load = createLoader({
4
4
  baseUrl: 'https://clerk.com/docs/upgrade-guides/core-2'
5
5
  });
6
6
  const changesAffectingAll = ['organization-getroles-arguments-changed', 'organization-getmemberships-arguments-changed', 'organization-getdomains-arguments-change', 'organization-getinvitations-arguments-changed', 'organization-getmembershiprequests-arguments-changed', 'user-getorganizationinvitations-arguments-changed', 'user-getorganizationsuggestions-arguments-changed', 'user-getorganizationmemberships-arguments-changed', 'user-getorganizationmemberships-return-signature', 'getorganizationinvitationlist-return-signature', 'getorganizationinvitationlist-return-type-change', 'getorganizationmembershiplist-return-type-change', 'getorganizationlist-return-signature', 'getorganizationlist-return-type-change', 'getinvitationlist-return-signature', 'getsessionlist-return-signature', 'getuserlist-return-signature', 'getallowlistidentifierlist-return-signature', 'getclientlist-return-signature', 'getredirecturllist-return-signature', 'getuseroauthaccesstoken-return-signature', 'organization-logourl', 'user-profileimageurl', 'user-update-password'];
7
- const jsChanges = ['setsession', 'organization-create-string', 'organization-getpendinginvitations', 'mfa-dropdown', 'appearance-variables-breaking-changes'];
7
+ const jsChanges = ['setsession', 'organization-create-string', 'organization-getpendinginvitations', 'mfa-dropdown', 'appearance-variables-breaking-changes', 'aftersignxurl-changes', 'supported-external-accounts-type-removed'];
8
8
  const reactChanges = ['magiclinkerrorcode', 'usemagiclink', 'ismagiclinkerror', 'magiclinkerror', 'handlemagiclinkverification', 'clerkprovider-frontendapi-2', 'navigate-to-routerpush-routerreplace', 'afterswitchorganizationurl', 'appearance-organizationpreview-organizationswitcher', 'useorganization-invitationlist', 'useorganization-membershiplist', 'useorganizations', 'userprofile-prop', 'organizationprofile-settings', 'userprofile-security', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'withsession-removed', 'withclerk-removed', 'withuser-removed-2', 'withclerk-hof-removed', 'withsession-hof-removed', 'withuser-hof-removed', 'multisessionappsupport-import-change', 'clerkprovideroptionswrapper-dropped', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'min-react-version', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'];
9
9
  export default {
10
10
  nextjs: load('nextjs', dedupeMerge(changesAffectingAll, jsChanges, ['api-key-to-secret-key', 'frontend-api-to-publishable-key', 'with-clerk-middleware-removed', 'auth-middleware-deprecated', 'clerk-js-version-next-public', 'authmiddleware-apikey', 'authmiddleware-frontendapi', 'createclerkclient-apikey', 'createclerkclient-frontendapi', 'getauth-apikey', 'clerkprovider-frontendapi-2', 'import-nextjs-app-beta', 'import-nextjs-ssr', 'import-nextjs-edge-middleware', 'import-nextjs-edge-middlewarefiles', 'import-api-url', 'import-api-version', 'import-clerk-js-url', 'import-clerk-js-version', 'import-domain', 'import-is-satellite', 'import-proxy-url', 'import-publishable-key', 'import-secret-key', 'import-sign-in-url', 'import-sign-up-url', 'import-nextjs-api', 'api-url-value-change', 'ismagiclinkerror', 'usemagiclink', 'magiclinkerrorcode', 'organizationprofile-settings', 'userprofile-security', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'multisessionappsupport-import-change', 'auth-import-change', 'currentuser-import-change', 'authmiddleware-import-change', 'buildclerkprops-import-change', 'verifytoken-import-change', 'verifyjwt-import-change', 'decodejwt-import-change', 'signjwt-import-change', 'constants-import-change', 'createauthenticaterequest-import-change', 'createisomorphicrequest-import-change', 'clerk-import-change', 'isclerkapiresponserror-import-change', 'isemaillinkerror-import-change', 'isknownerror-import-change', 'ismetamaskerror-import-change', 'withsession-removed', 'withclerk-removed', 'withuser-removed-2', 'withclerk-hof-removed', 'withsession-hof-removed', 'withuser-hof-removed', 'next-public-clerk-js-url', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'min-nextjs-version', 'redirecttosignin-import-path', 'redirecttosignup-import-path', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'])),
@@ -14,17 +14,17 @@ export default {
14
14
  remix: load('remix', dedupeMerge(changesAffectingAll, jsChanges, ['clerkerrorboundary-removed', 'createclerkclient-apikey', 'rootauthloader-apikey', 'getauth-apikey', 'clerkprovider-frontendapi-2', 'rootauthloader-frontendapi', 'frontend-api-to-publishable-key', 'api-key-to-secret-key', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'clerk-import-change', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'])),
15
15
  expo: load('expo', dedupeMerge(changesAffectingAll, jsChanges, ['apikey-to-publishable-key', 'ismagiclinkerror', 'usemagiclink', 'magiclinkerrorcode', 'organizationprofile-settings', 'userprofile-security', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'])),
16
16
  fastify: load('fastify', dedupeMerge(changesAffectingAll, ['api-key-to-secret-key', 'api-url-value-change', 'frontend-api-to-publishable-key', 'createclerkclient-apikey', 'createclerkclient-frontendapi', 'clerkplugin-frontendapi', 'clerk-import-change', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'])),
17
- node: load('node', dedupeMerge(changesAffectingAll, ['api-key-to-secret-key', 'api-url-value-change', 'frontend-api-to-publishable-key', 'clerkexpressrequireauth-apikey', 'clerkexpresswithauth-apikey', 'createclerkclient-apikey', 'createclerkexpressrequireauth-apikey', 'createclerkexpresswithauth-apikey', 'createclerkclient-frontendapi', 'createclerkexpressrequireauth-frontendapi', 'clerkexpressrequireauth-frontendapi', 'createclerkexpresswithauth-frontendapi', 'clerkexpresswithauth-frontendapi', 'setclerkapikey', 'setclerkapiversion', 'setclerkhttpoptions', 'setclerkserverapiurl', 'cjs-esm-instance', 'legacyauthobject-removed', 'clerk-import-change', 'organizationmembershippublicuserdata-profileimageurl', 'externalaccount-picture'])),
17
+ node: load('node', dedupeMerge(changesAffectingAll, ['api-key-to-secret-key', 'api-url-value-change', 'frontend-api-to-publishable-key', 'clerkexpressrequireauth-apikey', 'clerkexpresswithauth-apikey', 'createclerkclient-apikey', 'createclerkexpressrequireauth-apikey', 'createclerkexpresswithauth-apikey', 'createclerkclient-frontendapi', 'createclerkexpressrequireauth-frontendapi', 'clerkexpressrequireauth-frontendapi', 'createclerkexpresswithauth-frontendapi', 'clerkexpresswithauth-frontendapi', 'setclerkapikey', 'setclerkapiversion', 'setclerkhttpoptions', 'setclerkserverapiurl', 'cjs-esm-instance', 'legacyauthobject-removed', 'clerk-import-change', 'organizationmembershippublicuserdata-profileimageurl', 'externalaccount-picture', 'createclerkexpressrequireauth-public-key-required', 'createclerkexpresswithauth-publickey-required'])),
18
18
  react: load('react', dedupeMerge(changesAffectingAll, reactChanges, jsChanges)),
19
19
  js: load('js', dedupeMerge(changesAffectingAll, jsChanges, ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'handlemagiclinkverification', 'user-orgpublicdata-profileimageurl', 'experimental-canusecaptcha', 'experimental-captchaurl', 'experimental-captchasitekey', 'getorganizationmemberships', 'lastorganizationinvitation-member', 'unstable-invitationupdate', 'unstable-membershipupdate', 'user-createexternalaccount-redirecturl',
20
20
  // maybe shared with all?
21
- 'signup-attemptweb3walletverification-generatedsignature', 'redirecttohome', 'organizationprofile-settings', 'userprofile-security', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'clerk-isready-removed', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl'])),
21
+ 'signup-attemptweb3walletverification-generatedsignature', 'redirecttohome', 'organizationprofile-settings', 'userprofile-security', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'clerk-isready-removed', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl', 'externalaccount-avatarurl', 'organizationmembershippublicuserdata-profileimageurl', 'clerk-import'])),
22
22
  shared: load('shared', ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'getrequesturl', 'organizationcontext', 'useorganizationlist-organizationlist' // shared outside this pkg?
23
23
  ]),
24
24
 
25
25
  'chrome-extension': load('chrome-extension', dedupeMerge(changesAffectingAll, jsChanges, ['clerkprovider-tokencache'])),
26
26
  localizations: load('localization', ['new-localization-keys', 'removed-localization-keys', 'changed-localization-keys']),
27
- backend: load('backend', dedupeMerge(changesAffectingAll, ['api-url-value-changed', 'verifyjwt-import-path-move', 'decodejwt-import-path-move', 'signjwt-import-path-move', 'constants-import-path-move', 'redirect-import-path-move', 'createauthenticaterequest-import-path-move', 'createisomorphicrequest-import-path-move', 'createclerkclient-frontendapi', 'authenticaterequest-params-change', 'clerk-import', 'externalaccount-picture', 'externalaccountjson-avatarurl', 'organizationjson-logourl', 'userjson-profileimageurl', 'organizationmembershippublicuserdata-profileimageurl', 'organizationmembershippublicuserdatajson-profileimageurl', 'clockskewinseconds', 'pkgversion', 'client-unstableoptions-removed', 'httpoptions-removed', 'createisomorphicrequest-removed', 'createemail-removed', 'signjwterror-import-move', 'tokenverificationerror-import-move', 'tokenverificationerroraction-import-move', 'tokenverificationerrorreason-import-move', 'membershiprole', 'getorganizationmembershiplist-return-signature', 'buildrequesturl-removed', 'createclerkclient-apikey', 'getclientlist-arguments', 'getsessionlist-arguments'])),
27
+ backend: load('backend', dedupeMerge(changesAffectingAll, ['api-url-value-changed', 'verifyjwt-import-path-move', 'decodejwt-import-path-move', 'signjwt-import-path-move', 'constants-import-path-move', 'redirect-import-path-move', 'createauthenticaterequest-import-path-move', 'createisomorphicrequest-import-path-move', 'createclerkclient-frontendapi', 'authenticaterequest-params-change', 'clerk-import', 'externalaccount-picture', 'externalaccountjson-avatarurl', 'organizationjson-logourl', 'userjson-profileimageurl', 'organizationmembershippublicuserdata-profileimageurl', 'organizationmembershippublicuserdatajson-profileimageurl', 'clockskewinseconds', 'pkgversion', 'client-unstableoptions-removed', 'httpoptions-removed', 'createisomorphicrequest-removed', 'createemail-removed', 'signjwterror-import-move', 'tokenverificationerror-import-move', 'tokenverificationerroraction-import-move', 'tokenverificationerrorreason-import-move', 'membershiprole', 'getorganizationmembershiplist-return-signature', 'buildrequesturl-removed', 'createclerkclient-apikey', 'getclientlist-arguments', 'getsessionlist-arguments', 'members-count'])),
28
28
  types: [],
29
29
  redwood: [],
30
30
  express: []
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`Clerk` import changed'
3
+ matcher: "import\\s+{[^}]*?(Clerk)[\\s\\S]*?}\\s+from\\s+['\"]@clerk/clerk-js(?:\/headless)?['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: '{ Clerk }'
6
+ ---
7
+
8
+ The top level `Clerk` import was changed to a named export, like `{ Clerk }`. This is just a name change and can be treated as a text replacement, no changes to the params or return types.
9
+
10
+ ```diff
11
+ - import Clerk from '@clerk/clerk-js';
12
+ + import { Clerk } from '@clerk/clerk-js';
13
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`SignIn.supported_external_accounts` property removed'
3
+ category: 'deprecation-removals'
4
+ matcher: "\\.supported_external_accounts"
5
+ ---
6
+
7
+ The deprecated `SignIn.supported_external_accounts` property has been removed.
@@ -6,9 +6,9 @@ matcherFlags: 'm'
6
6
  warning: true
7
7
  ---
8
8
 
9
- The [`authMiddleware`](https://clerk.com/docs/references/nextjs/auth-middleware) API from `@clerk/nextjs` has been marked as deprecated. We highly recommend using [`clerkMiddleware`](https://clerk.com/docs/references/nextjs/clerk-middleware) going forward. `clerkMiddleware` protects no routes by default and you need to add your individual routes you want to opt into protection. Here's an example of having all routes public except for everything under `/dashboard`.
9
+ The [`authMiddleware`](https://clerk.com/docs/references/nextjs/auth-middleware) API from `@clerk/nextjs` has been marked as deprecated. We highly recommend using [`clerkMiddleware`](https://beta.clerk.com/docs/references/nextjs/clerk-middleware) going forward. `clerkMiddleware` protects no routes by default and you need to add your individual routes you want to opt into protection. Here's an example of having all routes public except for everything under `/dashboard`.
10
10
 
11
- For more documentation on the new `clerkMiddleware` function, check out [our official docs](https://clerk.com/docs/references/nextjs/clerk-middleware)!
11
+ For more documentation on the new `clerkMiddleware` function, check out [our official docs](https://beta.clerk.com/docs/references/nextjs/clerk-middleware)!
12
12
 
13
13
  **Before:**
14
14
 
@@ -6,7 +6,7 @@ category: 'top-level-imports'
6
6
  replaceWithString: 'nextjs/server'
7
7
  ---
8
8
 
9
- The `authMiddleware` import path has changed from `@clerk/nextjs` to `@clerk/nextjs/server`, as this is a helper that should be only used on the server side. You must update your import path in order for it to work correctly. Note as well that `authMiddleware` is deprecated as of this release, and we recommend [using `clerkMiddleware` instead](https://clerk.com/docs/references/nextjs/clerk-middleware). Example below of the fix that needs to be made:
9
+ The `authMiddleware` import path has changed from `@clerk/nextjs` to `@clerk/nextjs/server`, as this is a helper that should be only used on the server side. You must update your import path in order for it to work correctly. Note as well that `authMiddleware` is deprecated as of this release, and we recommend [using `clerkMiddleware` instead](https://beta.clerk.com/docs/references/nextjs/clerk-middleware). Example below of the fix that needs to be made:
10
10
 
11
11
  ```diff
12
12
  - import { authMiddleware } from "@clerk/nextjs"
@@ -4,7 +4,7 @@ category: 'middleware'
4
4
  matcher: "withClerkMiddleware\\("
5
5
  ---
6
6
 
7
- `withClerkMiddleware` has been deprecated and is now removed in v5. We recommend moving to `clerkMiddleware` instead. Please read the [clerkMiddleware guide](https://clerk.com/docs/references/nextjs/clerk-middleware) for more details. Here’s an example of how a simple middleware setup might look before and after.
7
+ `withClerkMiddleware` has been deprecated and is now removed in v5. We recommend moving to `clerkMiddleware` instead. Please read the [clerkMiddleware guide](https://beta.clerk.com/docs/references/nextjs/clerk-middleware) for more details. Here’s an example of how a simple middleware setup might look before and after.
8
8
 
9
9
  ```js
10
10
  // Before: using withClerkMiddleware
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: "`createClerkExpressRequireAuth` requires publishable key"
3
+ warning: true
4
+ matcher: `createClerkExpressRequireAuth`
5
+ ---
6
+
7
+ The `createClerkExpressRequireAuth` method now requires a clerk public key in order to work correctly. It can be passed in as a parameter directly, or picked up via environment variable. An error will be thrown now if there's no public key provided, this was not previously the case.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/upgrade",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -1,16 +0,0 @@
1
- ---
2
- title: '`Clients.getClientList` arguments changed'
3
- matcher: "\\.getClientList\\("
4
- category: 'pagination-args'
5
- ---
6
-
7
- There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
8
-
9
- ```diff
10
- const { data } = await clients.getClientList({
11
- - limit: 10,
12
- + pageSize: 10,
13
- - offset: 10,
14
- + initialPage: 2,
15
- })
16
- ```
@@ -1,16 +0,0 @@
1
- ---
2
- title: '`Sessions.getSessionList` arguments changed'
3
- matcher: "\\.getSessionList\\("
4
- category: 'pagination-args'
5
- ---
6
-
7
- There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
8
-
9
- ```diff
10
- const { data } = await sessions.getSessionList({
11
- - limit: 10,
12
- + pageSize: 10,
13
- - offset: 10,
14
- + initialPage: 2,
15
- })
16
- ```