@clerk/upgrade 0.0.2 → 0.1.0
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.
- package/dist/app.js +10 -2
- package/dist/cli.js +15 -6
- package/dist/img/alternativemethods-backlink.png +0 -0
- package/dist/img/button-to-organizationlistcreateorganizationactionbutton.png +0 -0
- package/dist/img/connected-accounts-dropdown.png +0 -0
- package/dist/img/mfa-dropdown.png +0 -0
- package/dist/img/organizationprofile-settings.png +0 -0
- package/dist/img/remove-identitypreview-avatar.png +0 -0
- package/dist/img/remove-socialbuttonsblockbuttonarrow.png +0 -0
- package/dist/img/userbuttonpopoveractionbuttontext-removed.png +0 -0
- package/dist/img/userprofile-security.png +0 -0
- package/dist/scan.js +50 -23
- package/dist/util/expandable-list.js +12 -5
- package/dist/util/generate-export-change.js +10 -0
- package/dist/util/guess-framework.js +8 -3
- package/dist/util/load-change.js +2 -1
- package/dist/versions/v5/backend/api-url-value-changed.md +7 -0
- package/dist/versions/v5/backend/authenticaterequest-params-change.md +12 -0
- package/dist/versions/v5/backend/buildrequesturl-removed.md +7 -0
- package/dist/versions/v5/backend/clerk-import.md +2 -2
- package/dist/versions/v5/backend/client-unstableoptions-removed.md +15 -0
- package/dist/versions/v5/backend/clockskewinseconds.md +10 -2
- package/dist/versions/v5/backend/constants-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createauthenticaterequest-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createclerkclient-apikey.md +8 -11
- package/dist/versions/v5/backend/createclerkclient-frontendapi.md +7 -10
- package/dist/versions/v5/backend/createemail-removed.md +7 -0
- package/dist/versions/v5/backend/createisomorphicrequest-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createisomorphicrequest-removed.md +13 -0
- package/dist/versions/v5/backend/decodeJwt-import-path-move.md +13 -0
- package/dist/versions/v5/backend/externalaccount-picture.md +6 -0
- package/dist/versions/v5/backend/externalaccountjson-avatarurl.md +6 -0
- package/dist/versions/v5/backend/getorganizationinvitationlist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getorganizationlist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getorganizationmembershiplist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getpendingorganizationinvitationlist.md +5 -5
- package/dist/versions/v5/backend/httpoptions-removed.md +15 -0
- package/dist/versions/v5/backend/membershiprole.md +21 -0
- package/dist/versions/v5/backend/organization-logourl.md +6 -0
- package/dist/versions/v5/backend/organizationjson-logourl.md +6 -0
- package/dist/versions/v5/backend/organizationmembershippublicuserdata-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/organizationmembershippublicuserdatajson-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/pkgversion.md +15 -0
- package/dist/versions/v5/backend/redirect-import-path-move.md +13 -0
- package/dist/versions/v5/backend/return-signature-change.md +14 -0
- package/dist/versions/v5/backend/signjwt-import-path-move +0 -0
- package/dist/versions/v5/backend/signjwt-import-path-move.md +13 -0
- package/dist/versions/v5/backend/signjwterror-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerror-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerroraction-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerrorcode-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerrorreason-import-move.md +13 -0
- package/dist/versions/v5/backend/user-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/userjson-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/verifyjwt-import-path-move.md +13 -0
- package/dist/versions/v5/common/aftersigninouturl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersignouturl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersignupurl-behavior-change.md +7 -0
- package/dist/versions/v5/common/afterswitchorganizationurl.md +16 -0
- package/dist/versions/v5/common/alternativemethods-backlink.md +18 -0
- package/dist/versions/v5/common/api-key-to-secret-key.md +1 -1
- package/dist/versions/v5/common/appearance-organizationpreview-organizationswitcher.md +8 -0
- package/dist/versions/v5/common/button-to-organizationlistcreateorganizationactionbutton.md +11 -0
- package/dist/versions/v5/common/card-changes.md +14 -0
- package/dist/versions/v5/common/changed-localization-keys.md +179 -0
- package/dist/versions/v5/common/clerkprovider-frontendapi-2.md +7 -0
- package/dist/versions/v5/common/clerkprovideroptionswrapper-dropped.md +6 -0
- package/dist/versions/v5/common/connected-accounts-dropdown.md +15 -0
- package/dist/versions/v5/common/emaillinkerrorcode-import-change.md +13 -0
- package/dist/versions/v5/common/external-account-avatarurl.md +7 -0
- package/dist/versions/v5/common/frontend-api-to-publishable-key.md +1 -1
- package/dist/versions/v5/common/isclerkapiresponserror-import-change.md +13 -0
- package/dist/versions/v5/common/isemaillinkerror-import-change.md +13 -0
- package/dist/versions/v5/common/isknownerror-import-change.md +13 -0
- package/dist/versions/v5/common/ismetamaskerror-import-change.md +13 -0
- package/dist/versions/v5/common/mfa-dropdown.md +11 -0
- package/dist/versions/v5/common/multi-session-ui-changes.md +0 -0
- package/dist/versions/v5/common/multisessionappsupport-import-change.md +12 -0
- package/dist/versions/v5/common/new-localization-keys.md +133 -0
- package/dist/versions/v5/common/organization-getdomains-arguments-change.md +20 -0
- package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +20 -0
- package/dist/versions/v5/common/organization-getroles-arguments-changed.md +20 -0
- package/dist/versions/v5/common/organization-getroles-return-type.md +0 -0
- package/dist/versions/v5/common/organizationprofile-general.md +0 -0
- package/dist/versions/v5/common/organizationprofile-settings.md +12 -0
- package/dist/versions/v5/common/organizationswitcherpopoveractionbuttontext-removed.md +14 -0
- package/dist/versions/v5/common/remove-identitypreview-avatar.md +12 -0
- package/dist/versions/v5/common/remove-socialbuttonsblockbuttonarrow.md +10 -0
- package/dist/versions/v5/common/removed-localization-keys.md +166 -0
- package/dist/versions/v5/common/signoutcallback-to-redirecturl.md +22 -0
- package/dist/versions/v5/common/useorganization-invitationlist.md +25 -0
- package/dist/versions/v5/common/useorganization-membershiplist.md +25 -0
- package/dist/versions/v5/common/useorganizations.md +26 -0
- package/dist/versions/v5/common/userbuttonpopoveractionbuttontext-removed.md +14 -0
- package/dist/versions/v5/common/userbuttonpopoveractionbuttontext.md +7 -0
- package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +12 -0
- package/dist/versions/v5/common/userprofile-prop.md +8 -0
- package/dist/versions/v5/common/userprofile-security.md +8 -0
- package/dist/versions/v5/common/withclerk-hof-removed.md +29 -0
- package/dist/versions/v5/common/withclerk-removed.md +16 -0
- package/dist/versions/v5/common/withsession-hof-removed.md +29 -0
- package/dist/versions/v5/common/withsession-removed.md +16 -0
- package/dist/versions/v5/common/withuser-hof-removed.md +29 -0
- package/dist/versions/v5/common/withuser-removed-2.md +18 -0
- package/dist/versions/v5/common/withuser-removed.md +16 -0
- package/dist/versions/v5/expo/apikey-to-publishable-key.md +1 -1
- package/dist/versions/v5/gatsby/apikey-to-publishable-key.md +1 -1
- package/dist/versions/v5/index.js +12 -31
- package/dist/versions/v5/js/aftersigninout-behavior-change.md +7 -0
- package/dist/versions/v5/js/aftersigninouturl-behavior-change.md +7 -0
- package/dist/versions/v5/js/aftersigninurl-behavior-change.md +0 -0
- package/dist/versions/v5/js/clerk-isready-removed.md +6 -0
- package/dist/versions/v5/js/lastorganizationinvitation-member.md +1 -1
- package/dist/versions/v5/js/organization-getdomains-arguments-change.md +20 -0
- package/dist/versions/v5/js/organization-getinvitations-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getmembershiprequests-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getmemberships-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getroles-arguments-changed.md +20 -0
- package/dist/versions/v5/js/user-getorganizationinvitations-arguments-chanaged.md +20 -0
- package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged +0 -0
- package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged.md +20 -0
- package/dist/versions/v5/js/user-getorganizationsuggestions-arguments-chanaged.md +20 -0
- package/dist/versions/v5/next/api-url-value-change.md +1 -0
- package/dist/versions/v5/next/auth-import-change.md +13 -0
- package/dist/versions/v5/next/auth-middleware-deprecated.md +43 -4
- package/dist/versions/v5/next/authmiddleware-import-change.md +13 -0
- package/dist/versions/v5/next/buildclerkprops-import-change.md +13 -0
- package/dist/versions/v5/next/clerk-import-change.md +12 -0
- package/dist/versions/v5/next/clerk-js-version-next-public.md +1 -1
- package/dist/versions/v5/next/constants-import-change.md +13 -0
- package/dist/versions/v5/next/createauthenticaterequest-import-change.md +13 -0
- package/dist/versions/v5/next/createisomorphicrequest-import-change.md +13 -0
- package/dist/versions/v5/next/currentuser-import-change.md +13 -0
- package/dist/versions/v5/next/decodejwt-import-change.md +13 -0
- package/dist/versions/v5/next/emaillinkerrorcode-import-change.md +13 -0
- package/dist/versions/v5/next/import-api-url.md +1 -1
- package/dist/versions/v5/next/import-api-version.md +1 -1
- package/dist/versions/v5/next/import-clerk-js-url.md +1 -1
- package/dist/versions/v5/next/import-clerk-js-version.md +1 -1
- package/dist/versions/v5/next/import-domain.md +1 -1
- package/dist/versions/v5/next/import-is-satellite.md +1 -1
- package/dist/versions/v5/next/import-proxy-url.md +1 -1
- package/dist/versions/v5/next/import-publishable-key.md +1 -1
- package/dist/versions/v5/next/import-secret-key.md +1 -1
- package/dist/versions/v5/next/import-sign-in-url.md +1 -1
- package/dist/versions/v5/next/import-sign-up-url.md +2 -1
- package/dist/versions/v5/next/isclerkapiresponserror-import-change.md +13 -0
- package/dist/versions/v5/next/isemaillinkerror-import-change.md +13 -0
- package/dist/versions/v5/next/isknownerror-import-change.md +13 -0
- package/dist/versions/v5/next/ismetamaskerror-import-change.md +13 -0
- package/dist/versions/v5/next/multisessionappsupport-import-change.md +13 -0
- package/dist/versions/v5/next/next-public-clerk-js-url.md +6 -0
- package/dist/versions/v5/next/redirect-import-change.md +13 -0
- package/dist/versions/v5/next/signjwt-import-change.md +13 -0
- package/dist/versions/v5/next/verify +0 -0
- package/dist/versions/v5/next/verifyjwt-import-change.md +13 -0
- package/dist/versions/v5/next/verifytoken-import-change.md +13 -0
- package/dist/versions/v5/next/withclerk-removed.md +15 -0
- package/dist/versions/v5/next/withsession-removed.md +15 -0
- package/dist/versions/v5/next/withuser-removed.md +0 -0
- package/dist/versions/v5/node/legacyauthobject-removed.md +26 -0
- package/dist/versions/v5/react/afterswitchorganizationurl.md +15 -0
- package/dist/versions/v5/react/appearance-organizationpreview-organizationswitcher.md +8 -0
- package/dist/versions/v5/react/router-navigate.md +18 -0
- package/dist/versions/v5/react/signoutcallback-to- +0 -0
- package/dist/versions/v5/react/signoutcallback-to-redirecturl.md +22 -0
- package/dist/versions/v5/react/useorganization-invitationlist.md +25 -0
- package/dist/versions/v5/react/useorganization-membershiplist.md +24 -0
- package/dist/versions/v5/react/useorganizations.md +26 -0
- package/dist/versions/v5/react/userprofile-prop.md +7 -0
- package/dist/versions/v5/remix/clerkerrorboundary-removed.md +22 -0
- package/dist/versions/v5/remix/clerkprovider-frontendapi.md +0 -0
- package/dist/versions/v5/remix/createclerkclient-apikey.md +14 -0
- package/dist/versions/v5/remix/getauth-apikey.md +16 -0
- package/dist/versions/v5/remix/rootauthloader-apikey.md +14 -0
- package/dist/versions/v5/remix/rootauthloader-frontendapi.md +14 -0
- package/dist/versions/v5/shared/buildrequesturl.md +6 -8
- package/dist/versions/v5/shared/getrequesturl.md +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`withClerk` function removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?withClerk[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `withClerk` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
function withClerk(Component, displayName) {
|
|
11
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
12
|
+
Component.displayName = displayName;
|
|
13
|
+
const HOC = props => {
|
|
14
|
+
const clerk = useIsomorphicClerkContext();
|
|
15
|
+
|
|
16
|
+
if (!clerk.loaded) return null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Component
|
|
20
|
+
{...props}
|
|
21
|
+
clerk={clerk}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
HOC.displayName = `withClerk(${displayName})`;
|
|
27
|
+
return HOC;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`WithClerk` component removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?WithClerk[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `WithClerk` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
export const WithClerk = ({ children }) => {
|
|
11
|
+
const clerk = useClerk();
|
|
12
|
+
if (typeof children !== 'function') throw new Error();
|
|
13
|
+
|
|
14
|
+
return {children(clerk)};
|
|
15
|
+
};
|
|
16
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`withSession` function removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?withSession[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `withSession` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
function withSession(Component, displayName) {
|
|
11
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
12
|
+
Component.displayName = displayName;
|
|
13
|
+
const HOC = props => {
|
|
14
|
+
const session = useSessionContext();
|
|
15
|
+
|
|
16
|
+
if (!session) return null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Component
|
|
20
|
+
{...props}
|
|
21
|
+
session={session}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
HOC.displayName = `withSession(${displayName})`;
|
|
27
|
+
return HOC;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`WithSession` component removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?WithSession[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `WithSession` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
export const WithSession = ({ children }) => {
|
|
11
|
+
const session = useSession();
|
|
12
|
+
if (typeof children !== 'function') throw new Error();
|
|
13
|
+
|
|
14
|
+
return {children(session)};
|
|
15
|
+
};
|
|
16
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`withUser` function removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?withUser[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `withUser` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
function withUser(Component, displayName) {
|
|
11
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
12
|
+
Component.displayName = displayName;
|
|
13
|
+
const HOC = props => {
|
|
14
|
+
const clerk = useUserContext();
|
|
15
|
+
|
|
16
|
+
if (!user) return null;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Component
|
|
20
|
+
{...props}
|
|
21
|
+
user={user}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
HOC.displayName = `withUser(${displayName})`;
|
|
27
|
+
return HOC;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`WithUser` component removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?withUser[\\s\\S]*?from\\s+['\"]@clerk\\/(?:nextjs|clerk-react)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- why is this called withuser-removed-2 you may ask? if you remove the "-2", it doesn't load, depsite identical content. Truly, this is baffling -->
|
|
8
|
+
|
|
9
|
+
The `WithUser` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
export const WithUser = ({ children }) => {
|
|
13
|
+
const user = useUser();
|
|
14
|
+
if (typeof children !== 'function') throw new Error();
|
|
15
|
+
|
|
16
|
+
return {children(user)};
|
|
17
|
+
};
|
|
18
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`WithUser` component removed'
|
|
3
|
+
matcher: 'foobar'
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `WithUser` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
export const WithUser = ({ children }) => {
|
|
11
|
+
const user = useUser();
|
|
12
|
+
if (typeof children !== 'function') throw new Error();
|
|
13
|
+
|
|
14
|
+
return {children(user)};
|
|
15
|
+
};
|
|
16
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`CLERK_FRONTEND_API` replaced by `CLERK_PUBLISHABLE_KEY`'
|
|
3
|
-
matcher: '
|
|
3
|
+
matcher: 'CLERK_FRONTEND_API'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
If you are using a `CLERK_FRONTEND_API` environment variable, the name must be changed to `CLERK_PUBLISHABLE_KEY` instead. Note that the values are different as well, so this is not just a key replacement. You can find the publishable key in your Clerk dashboard. Make sure you do this in both your dev and production environments.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`GASTBY_CLERK_FRONTEND_API` replaced by `GATSBY_CLERK_PUBLISHABLE_KEY`'
|
|
3
|
-
matcher: '
|
|
3
|
+
matcher: 'GATSBY_CLERK_FRONTEND_API'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
If you are using a `GATSBY_CLERK_FRONTEND_API` environment variable, the name must be changed to `GATSBY_CLERK_PUBLISHABLE_KEY` instead. Note that the values are different as well, so this is not just a key replacement. You can find the publishable key in your Clerk dashboard. Make sure you do this in both your dev and production environments.
|
|
@@ -3,15 +3,16 @@ const load = createLoader({
|
|
|
3
3
|
version: '5',
|
|
4
4
|
baseUrl: 'https://clerk.com/docs/upgrade-guides/v5'
|
|
5
5
|
});
|
|
6
|
-
const reactChangesList = ['magiclinkerrorcode', 'usemagiclink', 'ismagiclinkerror', 'magiclinkerror', 'handlemagiclinkverification', 'clerkprovider-frontendapi', 'setsession', 'navigate-to-routerpush-routerreplace'];
|
|
6
|
+
const reactChangesList = ['magiclinkerrorcode', 'usemagiclink', 'ismagiclinkerror', 'magiclinkerror', 'handlemagiclinkverification', 'clerkprovider-frontendapi-2', 'setsession', 'navigate-to-routerpush-routerreplace', 'afterswitchorganizationurl', 'appearance-organizationpreview-organizationswitcher', 'useorganization-invitationlist', 'useorganization-membershiplist', 'useorganizations', 'userprofile-prop', 'organizationprofile-settings', 'userprofile-security', 'mfa-dropdown', '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', 'aftersignouturl-behavior-change', 'aftersigninurl-behavior-change-2', 'aftersignupurl-behavior-change', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl'];
|
|
7
7
|
export default {
|
|
8
|
-
nextjs: load('next', ['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', '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', 'setsession']),
|
|
8
|
+
nextjs: load('next', ['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', 'setsession', 'organizationprofile-settings', 'userprofile-security', 'mfa-dropdown', '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', 'aftersignouturl-behavior-change', 'aftersigninurl-behavior-change-2', 'aftersignupurl-behavior-change', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl']),
|
|
9
9
|
// since we export clerk-react at the top level from the gatsby plugin
|
|
10
10
|
// if you're using gatsby, we also need to scan for the react changes
|
|
11
11
|
gatsby: load('gatsby', dedupeMerge(reactChangesList, ['api-key-to-secret-key', 'createclerkclient-apikey', 'apikey-to-publishable-key', 'createclerkclient-frontendapi', 'ismagiclinkerror', 'usemagiclink', 'magiclinkerrorcode', 'setsession', 'api-url-value-change', 'withserverauth-return-type'])),
|
|
12
|
-
|
|
12
|
+
remix: load('remix', ['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', 'setsession', 'aftersignouturl-behavior-change', 'aftersigninurl-behavior-change-2', 'aftersignupurl-behavior-change', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl']),
|
|
13
|
+
expo: load('expo', ['apikey-to-publishable-key', 'ismagiclinkerror', 'usemagiclink', 'magiclinkerrorcode', 'setsession', 'organizationprofile-settings', 'userprofile-security', 'mfa-dropdown', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'aftersignouturl-behavior-change', 'aftersigninurl-behavior-change-2', 'aftersignupurl-behavior-change', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl']),
|
|
13
14
|
fastify: load('fastify', ['api-key-to-secret-key', 'api-url-value-change', 'frontend-api-to-publishable-key', 'createclerkclient-apikey', 'createclerkclient-frontendapi', 'clerkplugin-frontendapi']),
|
|
14
|
-
node: load('node', ['package-rename', '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']),
|
|
15
|
+
node: load('node', ['package-rename', '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']),
|
|
15
16
|
react: load('react', reactChangesList),
|
|
16
17
|
js: load('js', ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'handlemagiclinkverification', 'external-account-avatarurl',
|
|
17
18
|
// shared w/ all
|
|
@@ -19,45 +20,25 @@ export default {
|
|
|
19
20
|
// shared w/ all
|
|
20
21
|
'user-orgpublicdata-profileimageurl',
|
|
21
22
|
// shared w/ all
|
|
22
|
-
'
|
|
23
|
-
// shared w/ all
|
|
24
|
-
'afterswitchorganizationurl',
|
|
23
|
+
'setsession', 'user-update-password',
|
|
25
24
|
// shared w/ all
|
|
26
25
|
'experimental-canusecaptcha', 'experimental-captchaurl', 'experimental-captchasitekey', 'getorganizationmemberships', 'lastorganizationinvitation-member', 'unstable-invitationupdate', 'unstable-membershipupdate', 'organization-create-string',
|
|
27
26
|
// maybe shared with all?
|
|
28
27
|
'organization-getpendinginvitations',
|
|
29
28
|
// maybe shared with all?
|
|
30
|
-
'useorganization-invitationlist',
|
|
31
|
-
// maybe shared with all?
|
|
32
|
-
'useorganization-membershiplist',
|
|
33
|
-
// maybe shared with all?
|
|
34
29
|
'user-createexternalaccount-redirecturl',
|
|
35
30
|
// maybe shared with all?
|
|
36
|
-
'signup-attemptweb3walletverification-generatedsignature', '
|
|
37
|
-
// shared
|
|
38
|
-
'redirecttohome']),
|
|
39
|
-
shared: load('shared', ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'buildrequesturl', 'organizationcontext', 'useorganizationlist-organizationlist' // shared outside this pkg?
|
|
31
|
+
'signup-attemptweb3walletverification-generatedsignature', 'redirecttohome', 'organizationprofile-settings', 'userprofile-security', 'mfa-dropdown', 'connected-accounts-dropdown', 'userbuttonpopoveractionbuttontext-removed', 'userbuttontrigger-userbuttonbox-invert', 'organizationswitcherpopoveractionbuttontext-removed', 'card-changes', 'alternativemethods-backlink', 'button-to-organizationlistcreateorganizationactionbutton', 'remove-socialbuttonsblockbuttonarrow', 'remove-identitypreview-avatar', 'organization-getroles-arguments-changed', 'organization-getdomains-arguments-change', 'organization-getmembershiprequests-arguments-changed', 'organization-getmemberships-arguments-changed', 'organization-getinvitations-arguments-changed', 'user-getorganizationinvitations-arguments-chanaged', 'user-getorganizationsuggestions-arguments-chanaged', 'user-getorganizationmemberships-arguments-chanaged', 'aftersignouturl-behavior-change', 'aftersigninurl-behavior-change-2', 'aftersignupurl-behavior-change', 'clerk-isready-removed', 'new-localization-keys', 'removed-localization-keys', 'changed-localization-keys', 'signoutcallback-to-redirecturl']),
|
|
32
|
+
shared: load('shared', ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'getrequesturl', 'organizationcontext', 'useorganizationlist-organizationlist' // shared outside this pkg?
|
|
40
33
|
]),
|
|
41
34
|
|
|
42
35
|
chromeExtension: load('chromeExtension', ['clerkprovider-tokencache']),
|
|
43
|
-
localizations: [],
|
|
36
|
+
localizations: load('localization', ['new-localization-keys', 'removed-localization-keys', 'changed-localization-keys']),
|
|
37
|
+
backend: load('backend', ['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', 'organization-logourl', 'organizationjson-logourl', 'user-profileimageurl', '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', 'getorganizationlist-return-signature', 'getorganizationinvitationlist-return-signature']),
|
|
44
38
|
types: [],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// 'createclerkclient-frontendapi',
|
|
48
|
-
// 'clerk-import',
|
|
49
|
-
// 'externalaccount-picture',
|
|
50
|
-
// 'externalaccountjson-avatarurl',
|
|
51
|
-
// 'organization-logourl',
|
|
52
|
-
// 'organizationjson-logourl',
|
|
53
|
-
// 'user-profileimageurl',
|
|
54
|
-
// 'userjson-profileimageurl',
|
|
55
|
-
// 'organizationmembershippublicuserdata-profileimageurl',
|
|
56
|
-
// 'organizationmembershippublicuserdatajson-profileimageurl',
|
|
57
|
-
// 'clockskewinseconds',
|
|
58
|
-
// ]),
|
|
39
|
+
redwood: [],
|
|
40
|
+
express: []
|
|
59
41
|
};
|
|
60
|
-
|
|
61
42
|
function dedupeMerge(arr1, arr2) {
|
|
62
43
|
return [...new Set(arr1.concat(arr2))];
|
|
63
44
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`afterSignOutUrl` prop behavior change'
|
|
3
|
+
matcher: 'afterSignOutUrl='
|
|
4
|
+
warning: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The default value of `afterSignOutUrl` has been changed to `/`. The URLs defined in your `Dashboard > Account Portal > Redirects` section will no longer affect these values. Read the [Customizing your Account Portal redirects](https://docs-preview-605.clerkpreview.com/docs/account-portal/custom-redirects) guide to learn how to override these defaults.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`afterSignOutUrl` prop behavior change'
|
|
3
|
+
matcher: 'afterSignOutUrl='
|
|
4
|
+
warning: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The default value of `afterSignOutUrl` has been changed to `/`. The URLs defined in your `Dashboard > Account Portal > Redirects` section will no longer affect these values. Read the [Customizing your Account Portal redirects](https://docs-preview-605.clerkpreview.com/docs/account-portal/custom-redirects) guide to learn how to override these defaults.
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`lastOrganizationInvitation` and `lastOrganizationMember` dropped from event emitter'
|
|
3
|
-
matcher: "
|
|
3
|
+
matcher: "(?:\\.lastOrganizationInvitation|\\.lastOrganizationMember)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
If you are using [`Clerk.addListener`](https://clerk.com/docs/references/javascript/clerk/clerk#add-listener) or `OrganizationContext` and utilizing either the `lastOrganizationInvitation` and/or `lastOrganizationMember` emitted events, these properties have been removed, as they were only relevant for internal use. We are not providing a way to backfill this functionality at the moment. If you are using it and this is an issue for you, please [reach out to Clerk support](https://clerk.com/support) and we can find a way to resolve the issue!
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Organization.getDomains` arguments changed'
|
|
3
|
+
matcher: "\\.getDomains\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.organization.getDomains({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Organization.getInvitations` arguments changed'
|
|
3
|
+
matcher: "\\.getInvitations\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.organization.getInvitations({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Organization.getMembershipRequests` arguments changed'
|
|
3
|
+
matcher: "\\.getMembershipRequests\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.organization.getMembershipRequests({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Organization.getMemberships` arguments changed'
|
|
3
|
+
matcher: "\\.getMemberships\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.organization.getMemberships({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Organization.getRoles` arguments changed'
|
|
3
|
+
matcher: "\\.getRoles\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.organization.getRoles({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`User.getOrganizationInvitations` arguments changed'
|
|
3
|
+
matcher: "\\.getOrganizationInvitations\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.user.getOrganizationInvitations({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`User.getOrganizationMemberships` arguments changed'
|
|
3
|
+
matcher: "\\.getOrganizationMemberships\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.user.getOrganizationMemberships({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`User.getOrganizationSuggestions` arguments changed'
|
|
3
|
+
matcher: "\\.getOrganizationSuggestions\\("
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
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:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import Clerk from "@clerk/clerk-js"
|
|
10
|
+
|
|
11
|
+
const clerk = new Clerk()
|
|
12
|
+
await clerk.load()
|
|
13
|
+
|
|
14
|
+
const { data: orgs } = await clerk.user.getOrganizationSuggestions({
|
|
15
|
+
- limit: 10,
|
|
16
|
+
+ pageSize: 10,
|
|
17
|
+
- offset: 10,
|
|
18
|
+
+ initialPage: 2,
|
|
19
|
+
})
|
|
20
|
+
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`API_URL` value has changed'
|
|
3
3
|
matcher: "API_URL[\\s\\S]+?from\\s+['\"]@clerk\\/nextjs\\/server['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
The value of this export has changed from `https://api.clerk.dev` to `https://api.clerk.com`. If you were relying on the text content of this value not changing, you may need to make adjustments.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`auth` import moved under `/server`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?auth[\\s\\S]*?from\\s+['\"]@clerk\\/(nextjs)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'nextjs/server'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `auth` 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. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { auth } from "@clerk/nextjs"
|
|
12
|
+
+ import { auth } from "@clerk/nextjs/server"
|
|
13
|
+
```
|
|
@@ -1,10 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`authMiddleware` deprecated'
|
|
3
|
-
matcher: "import\\s+{[\\s\\S]*?authMiddleware[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/nextjs
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?authMiddleware[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
warning: true
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
`authMiddleware`
|
|
8
|
+
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`.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
For more documentation on the new `clerkMiddleware` function, check out [our official docs](https://clerk.com/docs/references/nextjs/clerk-middleware)!
|
|
11
|
+
|
|
12
|
+
**Before:**
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// middleware.ts
|
|
16
|
+
|
|
17
|
+
import { authMiddleware } from '@clerk/nextjs';
|
|
18
|
+
|
|
19
|
+
export default authMiddleware({
|
|
20
|
+
publicRoutes: req => !req.url.includes('/dashboard'),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const config = {
|
|
24
|
+
matcher: ['/((?!.+\\.[\\w]+$|_next)._)', '/', '/(api|trpc)(._)'],
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**After:**
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// middleware.ts
|
|
32
|
+
|
|
33
|
+
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
|
|
34
|
+
import { NextResponse } from 'next/server';
|
|
35
|
+
|
|
36
|
+
const isProtectedRoute = createRouteMatcher(['/dashboard(.*)']);
|
|
37
|
+
|
|
38
|
+
export default clerkMiddleware((auth, request) => {
|
|
39
|
+
if (isProtectedRoute(request)) {
|
|
40
|
+
auth().protect();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return NextResponse.next();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const config = {
|
|
47
|
+
matcher: ['/((?!.+\\.[\\w]+$|_next)._)', '/', '/(api|trpc)(._)'],
|
|
48
|
+
};
|
|
10
49
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`authMiddleware` import moved under `/server`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?authMiddleware[\\s\\S]*?from\\s+['\"]@clerk\\/(nextjs)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'nextjs/server'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
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
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { authMiddleware } from "@clerk/nextjs"
|
|
12
|
+
+ import { authMiddleware } from "@clerk/nextjs/server"
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`buildClerkProps` import moved under `/server`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?buildClerkProps[\\s\\S]*?from\\s+['\"]@clerk\\/(nextjs)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'nextjs/server'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `buildClerkProps` 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. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { buildClerkProps } from "@clerk/nextjs"
|
|
12
|
+
+ import { buildClerkProps } from "@clerk/nextjs/server"
|
|
13
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Clerk` import moved under `/server`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?[,\\s]Clerk[,\\s][\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `Clerk` 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 the `Clerk` export has changed to `createClerkClient` as part of the v5 changes. Example below of the fix that needs to be made:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- import { Clerk } from "@clerk/nextjs"
|
|
11
|
+
+ import { createClerkClient } from "@clerk/nextjs/server"
|
|
12
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`CLERK_JS_VERSION` should be `NEXT_PUBLIC_CLERK_JS_VERSION`'
|
|
3
|
-
matcher: '[^_]CLERK_JS_VERSION'
|
|
3
|
+
matcher: '^[^_]*CLERK_JS_VERSION'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
If you are using `CLERK_JS_VERSION` as an environment variable, it should be changed to `NEXT_PUBLIC_CLERK_JS_VERSION` instead.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`constants` import moved under `/server`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?constants[\\s\\S]*?from\\s+['\"]@clerk\\/(nextjs)[\\s\\S]*?['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'nextjs/server'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `constants` 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. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { constants } from "@clerk/nextjs"
|
|
12
|
+
+ import { constants } from "@clerk/nextjs/server"
|
|
13
|
+
```
|