@clerk/upgrade 2.0.0-snapshot.v20251211120550 → 2.0.0-snapshot.v20251215203425
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/__tests__/fixtures/nextjs-v6-scan-issues/package.json +9 -0
- package/dist/__tests__/fixtures/nextjs-v6-scan-issues/pnpm-lock.yaml +2 -0
- package/dist/__tests__/fixtures/nextjs-v6-scan-issues/src/app.tsx +30 -0
- package/dist/cli.js +12 -12
- package/dist/codemods/index.js +3 -3
- package/dist/codemods/transform-align-experimental-unstable-prefixes.cjs +0 -12
- package/dist/render.js +31 -1
- package/dist/runner.js +7 -5
- package/dist/versions/core-3/changes/after-switch-organization-url-removed.md +14 -0
- package/dist/versions/core-3/changes/appearance-layout-to-options.md +20 -0
- package/dist/versions/core-3/changes/billing-props-removed.md +14 -0
- package/dist/versions/core-3/changes/checkout-api-changed.md +35 -0
- package/dist/versions/core-3/changes/clerk-types-deprecation.md +17 -0
- package/dist/versions/core-3/changes/client-active-sessions-removed.md +12 -0
- package/dist/versions/core-3/changes/color-ring-backdrop-opacity.md +21 -0
- package/dist/versions/core-3/changes/deprecated-redirect-props-removed.md +29 -0
- package/dist/versions/core-3/changes/experimental-prefix-aligned.md +17 -0
- package/dist/versions/core-3/changes/expo-min-version.md +24 -0
- package/dist/versions/core-3/changes/hide-slug-removed.md +15 -0
- package/dist/versions/core-3/changes/min-node-version.md +17 -0
- package/dist/versions/core-3/changes/nextjs-encryption-key-required.md +17 -0
- package/dist/versions/core-3/changes/nuxt-getauth-removed.md +21 -0
- package/dist/versions/core-3/changes/nuxt-routing-strategy-default-path.md +28 -0
- package/dist/versions/core-3/changes/saml-account-renamed.md +15 -0
- package/dist/versions/core-3/changes/saml-to-enterprise-sso.md +12 -0
- package/dist/versions/core-3/changes/set-active-before-emit-removed.md +22 -0
- package/dist/versions/core-3/changes/show-optional-fields-default.md +20 -0
- package/dist/versions/core-3/changes/ui-themes-export-path.md +16 -0
- package/dist/versions/core-3/changes/unstable-to-internal.md +25 -0
- package/dist/versions/core-3/changes/user-settings-saml-renamed.md +13 -0
- package/dist/versions/core-3/changes/userbutton-signout-props-removed.md +26 -0
- package/package.json +4 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ClerkProvider, SignIn, useAuth } from '@clerk/nextjs';
|
|
2
|
+
|
|
3
|
+
export default function App({ children }) {
|
|
4
|
+
return (
|
|
5
|
+
<ClerkProvider
|
|
6
|
+
appearance={{
|
|
7
|
+
layout: {
|
|
8
|
+
socialButtonsPlacement: 'bottom',
|
|
9
|
+
},
|
|
10
|
+
}}
|
|
11
|
+
>
|
|
12
|
+
{children}
|
|
13
|
+
</ClerkProvider>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function SignInPage() {
|
|
18
|
+
return (
|
|
19
|
+
<SignIn
|
|
20
|
+
afterSignInUrl='/dashboard'
|
|
21
|
+
afterSignUpUrl='/onboarding'
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SamlCallback() {
|
|
27
|
+
const { isSignedIn } = useAuth();
|
|
28
|
+
// Handle saml callback
|
|
29
|
+
return <div>SAML SSO Callback</div>;
|
|
30
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -30,13 +30,14 @@ const cli = meow(`
|
|
|
30
30
|
`, {
|
|
31
31
|
importMeta: import.meta,
|
|
32
32
|
flags: {
|
|
33
|
-
sdk: {
|
|
34
|
-
type: 'string'
|
|
35
|
-
},
|
|
36
33
|
dir: {
|
|
37
34
|
type: 'string',
|
|
38
35
|
default: process.cwd()
|
|
39
36
|
},
|
|
37
|
+
dryRun: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
40
41
|
glob: {
|
|
41
42
|
type: 'string',
|
|
42
43
|
default: '**/*.(js|jsx|ts|tsx|mjs|cjs)'
|
|
@@ -45,18 +46,17 @@ const cli = meow(`
|
|
|
45
46
|
type: 'string',
|
|
46
47
|
isMultiple: true
|
|
47
48
|
},
|
|
48
|
-
skipUpgrade: {
|
|
49
|
-
type: 'boolean',
|
|
50
|
-
default: false
|
|
51
|
-
},
|
|
52
49
|
release: {
|
|
53
50
|
type: 'string'
|
|
54
51
|
},
|
|
55
|
-
|
|
52
|
+
sdk: {
|
|
53
|
+
type: 'string'
|
|
54
|
+
},
|
|
55
|
+
skipCodemods: {
|
|
56
56
|
type: 'boolean',
|
|
57
57
|
default: false
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
skipUpgrade: {
|
|
60
60
|
type: 'boolean',
|
|
61
61
|
default: false
|
|
62
62
|
}
|
|
@@ -66,12 +66,12 @@ async function main() {
|
|
|
66
66
|
renderHeader();
|
|
67
67
|
const options = {
|
|
68
68
|
dir: cli.flags.dir,
|
|
69
|
+
dryRun: cli.flags.dryRun,
|
|
69
70
|
glob: cli.flags.glob,
|
|
70
71
|
ignore: cli.flags.ignore,
|
|
71
|
-
skipUpgrade: cli.flags.skipUpgrade,
|
|
72
72
|
release: cli.flags.release,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
skipCodemods: cli.flags.skipCodemods,
|
|
74
|
+
skipUpgrade: cli.flags.skipUpgrade
|
|
75
75
|
};
|
|
76
76
|
if (options.dryRun) {
|
|
77
77
|
renderWarning(' Upgrade running in dry run mode - no changes will be made');
|
package/dist/codemods/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dirname, resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { globby } from 'globby';
|
|
5
4
|
import { run } from 'jscodeshift/src/Runner.js';
|
|
5
|
+
import { glob } from 'tinyglobby';
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const CODEMOD_CONFIG = {
|
|
8
8
|
'transform-remove-deprecated-props': {
|
|
@@ -10,12 +10,12 @@ const CODEMOD_CONFIG = {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
const GLOBBY_IGNORE = ['**/*.md', 'node_modules/**', '**/node_modules/**', '.git/**', '**/*.json', 'package.json', '**/package.json', 'package-lock.json', '**/package-lock.json', 'yarn.lock', '**/yarn.lock', 'pnpm-lock.yaml', '**/pnpm-lock.yaml', 'yalc.lock', '**/*.{ico,png,webp,svg,gif,jpg,jpeg}', '**/*.{mp4,mkv,wmv,m4v,mov,avi,flv,webm,flac,mka,m4a,aac,ogg}', '**/*.{css,scss,sass,less,styl}'];
|
|
13
|
-
export async function runCodemod(transform = 'transform-async-request',
|
|
13
|
+
export async function runCodemod(transform = 'transform-async-request', patterns, options = {}) {
|
|
14
14
|
if (!transform) {
|
|
15
15
|
throw new Error('No transform provided');
|
|
16
16
|
}
|
|
17
17
|
const resolvedPath = resolve(__dirname, `${transform}.cjs`);
|
|
18
|
-
const paths = await
|
|
18
|
+
const paths = await glob(patterns, {
|
|
19
19
|
ignore: GLOBBY_IGNORE
|
|
20
20
|
});
|
|
21
21
|
if (options.skipCodemods) {
|
|
@@ -20,18 +20,6 @@ const UI_LEGACY_SOURCES = new Set(['@clerk/ui', '@clerk/ui/themes', UI_THEME_SOU
|
|
|
20
20
|
const CHROME_CLIENT_NAMES = new Set(['__unstable__createClerkClient', 'createClerkClient']);
|
|
21
21
|
const CHROME_BACKGROUND_SOURCE = '@clerk/chrome-extension/background';
|
|
22
22
|
const CHROME_LEGACY_SOURCE = '@clerk/chrome-extension';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Transforms experimental and unstable prefixed identifiers to their stable or internal equivalents.
|
|
26
|
-
* Also moves theme-related imports to @clerk/ui/themes/experimental and Chrome extension imports
|
|
27
|
-
* to @clerk/chrome-extension/background. Removes deprecated billing-related props.
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} file - The file object containing the source code
|
|
30
|
-
* @param {string} file.source - The source code to transform
|
|
31
|
-
* @param {Object} api - The jscodeshift API
|
|
32
|
-
* @param {Function} api.jscodeshift - The jscodeshift function
|
|
33
|
-
* @returns {string|undefined} The transformed source code, or undefined if no changes were made
|
|
34
|
-
*/
|
|
35
23
|
module.exports = function transformAlignExperimentalUnstablePrefixes({
|
|
36
24
|
source
|
|
37
25
|
}, {
|
package/dist/render.js
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import * as readline from 'node:readline';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
const gradientColors = ['#5ee7df', '#b490ca'];
|
|
4
|
+
const hexToRgb = hex => {
|
|
5
|
+
const value = hex.replace('#', '');
|
|
6
|
+
const chunk = value.length === 3 ? value.split('').map(char => char + char) : value.match(/.{2}/g);
|
|
7
|
+
return chunk.map(part => parseInt(part, 16));
|
|
8
|
+
};
|
|
9
|
+
const interpolate = (start, end, t) => Math.round(start + (end - start) * t);
|
|
10
|
+
const applyGradient = text => {
|
|
11
|
+
if (!text) {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
const rgb = gradientColors.map(hexToRgb);
|
|
15
|
+
const maxIndex = text.length - 1 || 1;
|
|
16
|
+
const segmentCount = rgb.length - 1;
|
|
17
|
+
return text.split('').map((char, index) => {
|
|
18
|
+
const progress = index / maxIndex;
|
|
19
|
+
const segment = Math.min(Math.floor(progress * segmentCount), segmentCount - 1);
|
|
20
|
+
const localT = segmentCount === 0 ? 0 : progress * segmentCount - segment;
|
|
21
|
+
const [r1, g1, b1] = rgb[segment];
|
|
22
|
+
const [r2, g2, b2] = rgb[segment + 1] || rgb[segment];
|
|
23
|
+
const r = interpolate(r1, r2, localT);
|
|
24
|
+
const g = interpolate(g1, g2, localT);
|
|
25
|
+
const b = interpolate(b1, b2, localT);
|
|
26
|
+
return chalk.rgb(r, g, b)(char);
|
|
27
|
+
}).join('');
|
|
28
|
+
};
|
|
3
29
|
export function renderHeader() {
|
|
4
30
|
console.log('');
|
|
5
|
-
|
|
31
|
+
const heading = [' █▀▀ █ █▀▀ █▀█ █▄▀ █ █ █▀█ █▀▀ █▀█ ▄▀█ █▀▄ █▀▀', ' █▄▄ █▄▄ ██▄ █▀▄ █ █ █▄█ █▀▀ █▄█ █▀▄ █▀█ █▄▀ ██▄'];
|
|
32
|
+
heading.forEach(line => console.log(applyGradient(line)));
|
|
33
|
+
console.log('');
|
|
34
|
+
console.log("Hello friend! We're excited to help you upgrade Clerk modules. Before we get started, a couple");
|
|
35
|
+
console.log('questions...');
|
|
6
36
|
console.log('');
|
|
7
37
|
}
|
|
8
38
|
export function renderText(message, color) {
|
package/dist/runner.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { convertPathToPattern, globby } from 'globby';
|
|
5
4
|
import indexToPosition from 'index-to-position';
|
|
5
|
+
import { glob } from 'tinyglobby';
|
|
6
6
|
import { getCodemodConfig, runCodemod } from './codemods/index.js';
|
|
7
7
|
import { createSpinner, renderCodemodResults } from './render.js';
|
|
8
8
|
const GLOBBY_IGNORE = ['node_modules/**', '**/node_modules/**', '.git/**', 'dist/**', '**/dist/**', 'build/**', '**/build/**', '.next/**', '**/.next/**', 'package.json', '**/package.json', 'package-lock.json', '**/package-lock.json', 'yarn.lock', '**/yarn.lock', 'pnpm-lock.yaml', '**/pnpm-lock.yaml', '**/*.{png,webp,svg,gif,jpg,jpeg}', '**/*.{mp4,mkv,wmv,m4v,mov,avi,flv,webm,flac,mka,m4a,aac,ogg}'];
|
|
@@ -11,11 +11,11 @@ export async function runCodemods(config, sdk, options) {
|
|
|
11
11
|
if (codemods.length === 0) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const patterns = typeof options.glob === 'string' ? options.glob.split(/[ ,]/).filter(Boolean) : options.glob;
|
|
15
15
|
for (const transform of codemods) {
|
|
16
16
|
const spinner = createSpinner(`Running codemod: ${transform}`);
|
|
17
17
|
try {
|
|
18
|
-
const result = await runCodemod(transform,
|
|
18
|
+
const result = await runCodemod(transform, patterns, options);
|
|
19
19
|
spinner.success(`Codemod applied: ${chalk.dim(transform)}`);
|
|
20
20
|
renderCodemodResults(transform, result);
|
|
21
21
|
const codemodConfig = getCodemodConfig(transform);
|
|
@@ -35,8 +35,10 @@ export async function runScans(config, sdk, options) {
|
|
|
35
35
|
}
|
|
36
36
|
const spinner = createSpinner('Scanning files for breaking changes...');
|
|
37
37
|
try {
|
|
38
|
-
const
|
|
39
|
-
const files = await
|
|
38
|
+
const cwd = path.resolve(options.dir);
|
|
39
|
+
const files = await glob('**/*', {
|
|
40
|
+
cwd,
|
|
41
|
+
absolute: true,
|
|
40
42
|
ignore: [...GLOBBY_IGNORE, ...(options.ignore || [])]
|
|
41
43
|
});
|
|
42
44
|
const results = {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`afterSwitchOrganizationUrl` removed from `OrganizationSwitcher`'
|
|
3
|
+
matcher: 'afterSwitchOrganizationUrl'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `afterSwitchOrganizationUrl` prop has been removed from `OrganizationSwitcher`. Use `afterSelectOrganizationUrl` instead:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
<OrganizationSwitcher
|
|
11
|
+
- afterSwitchOrganizationUrl="/org-dashboard"
|
|
12
|
+
+ afterSelectOrganizationUrl="/org-dashboard"
|
|
13
|
+
/>
|
|
14
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`appearance.layout` renamed to `appearance.options`'
|
|
3
|
+
matcher: 'appearance[\\s\\S]*?\\.layout'
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
category: 'breaking'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `appearance.layout` property has been renamed to `appearance.options`. Update all instances in your codebase:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
<ClerkProvider
|
|
12
|
+
appearance={{
|
|
13
|
+
- layout: {
|
|
14
|
+
+ options: {
|
|
15
|
+
socialButtonsPlacement: 'bottom',
|
|
16
|
+
socialButtonsVariant: 'iconButton',
|
|
17
|
+
}
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Unstable billing props removed'
|
|
3
|
+
matcher:
|
|
4
|
+
- '__unstable_manageBillingUrl'
|
|
5
|
+
- '__unstable_manageBillingLabel'
|
|
6
|
+
- '__unstable_manageBillingMembersLimit'
|
|
7
|
+
category: 'deprecation-removal'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The following unstable properties have been removed. If you were relying on these, please reach out to support.
|
|
11
|
+
|
|
12
|
+
- `__unstable_manageBillingUrl`
|
|
13
|
+
- `__unstable_manageBillingLabel`
|
|
14
|
+
- `__unstable_manageBillingMembersLimit`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`useCheckout` and `Clerk.checkout()` return value changed'
|
|
3
|
+
matcher:
|
|
4
|
+
- 'useCheckout'
|
|
5
|
+
- 'Clerk\\.checkout'
|
|
6
|
+
- '\.checkout\('
|
|
7
|
+
category: 'breaking'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The return values of `useCheckout` hook and `Clerk.checkout()` have been updated.
|
|
11
|
+
|
|
12
|
+
### React Hook
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- const { id, plan, status, start, confirm, paymentSource } = useCheckout({ planId: "xxx", planPeriod: "annual" });
|
|
16
|
+
+ const { checkout, errors, fetchStatus } = useCheckout({ planId: "xxx", planPeriod: "annual" });
|
|
17
|
+
+ // Access properties via checkout object
|
|
18
|
+
+ checkout.plan
|
|
19
|
+
+ checkout.status
|
|
20
|
+
+ checkout.start()
|
|
21
|
+
+ checkout.confirm()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Vanilla JS
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
- const { getState, subscribe, confirm, start, clear, finalize } = Clerk.checkout({ planId: "xxx", planPeriod: "annual" });
|
|
28
|
+
- getState().isStarting
|
|
29
|
+
- getState().checkout
|
|
30
|
+
+ const { checkout, errors, fetchStatus } = Clerk.checkout({ planId: "xxx", planPeriod: "annual" });
|
|
31
|
+
+ checkout.plan
|
|
32
|
+
+ checkout.status
|
|
33
|
+
+ checkout.start()
|
|
34
|
+
+ checkout.confirm()
|
|
35
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`@clerk/types` deprecated in favor of `@clerk/shared/types`'
|
|
3
|
+
matcher: "from\\s+['\"]@clerk/types['\"]"
|
|
4
|
+
category: 'deprecation'
|
|
5
|
+
warning: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `@clerk/types` package is deprecated. All type definitions have been consolidated into `@clerk/shared/types`.
|
|
9
|
+
|
|
10
|
+
Update your imports:
|
|
11
|
+
|
|
12
|
+
```diff
|
|
13
|
+
- import type { ClerkResource, UserResource } from '@clerk/types';
|
|
14
|
+
+ import type { ClerkResource, UserResource } from '@clerk/shared/types';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The `@clerk/types` package will continue to re-export types from `@clerk/shared/types` for backward compatibility, but new types will only be added to `@clerk/shared/types`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Client.activeSessions` removed'
|
|
3
|
+
matcher: '\\.activeSessions'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `activeSessions` property has been removed from the `Client` object. Use `sessions` instead:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- const sessions = client.activeSessions;
|
|
11
|
+
+ const sessions = client.sessions;
|
|
12
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`colorRing` and `colorModalBackdrop` now render at full opacity'
|
|
3
|
+
matcher:
|
|
4
|
+
- 'colorRing'
|
|
5
|
+
- 'colorModalBackdrop'
|
|
6
|
+
category: 'breaking'
|
|
7
|
+
warning: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The `colorRing` and `colorModalBackdrop` CSS variables now render at full opacity when modified via the appearance prop or CSS variables. Previously, provided colors were rendered at 15% opacity.
|
|
11
|
+
|
|
12
|
+
If you were relying on the previous behavior, you may need to adjust your color values to include the desired opacity:
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
appearance={{
|
|
16
|
+
variables: {
|
|
17
|
+
- colorRing: '#6366f1',
|
|
18
|
+
+ colorRing: 'rgba(99, 102, 241, 0.15)',
|
|
19
|
+
}
|
|
20
|
+
}}
|
|
21
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Legacy redirect props removed'
|
|
3
|
+
matcher:
|
|
4
|
+
- 'afterSignInUrl'
|
|
5
|
+
- 'afterSignUpUrl'
|
|
6
|
+
- 'afterSignOutUrl'
|
|
7
|
+
- 'redirectUrl'
|
|
8
|
+
category: 'deprecation-removal'
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
The legacy redirect props `afterSignInUrl`, `afterSignUpUrl`, and `redirectUrl` have been removed from components. Use the newer redirect options:
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
<SignIn
|
|
15
|
+
- afterSignInUrl="/dashboard"
|
|
16
|
+
- afterSignUpUrl="/onboarding"
|
|
17
|
+
+ fallbackRedirectUrl="/dashboard"
|
|
18
|
+
+ signUpFallbackRedirectUrl="/onboarding"
|
|
19
|
+
/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For forced redirects that ignore the `redirect_url` query parameter:
|
|
23
|
+
|
|
24
|
+
```diff
|
|
25
|
+
<SignIn
|
|
26
|
+
+ forceRedirectUrl="/dashboard"
|
|
27
|
+
+ signUpForceRedirectUrl="/onboarding"
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Experimental method prefix standardized to `__experimental_`'
|
|
3
|
+
matcher:
|
|
4
|
+
- 'experimental__'
|
|
5
|
+
- 'experimental_'
|
|
6
|
+
category: 'breaking'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
All experimental methods now use the `__experimental_` prefix consistently. Update any references:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- experimental__someMethod
|
|
13
|
+
+ __experimental_someMethod
|
|
14
|
+
|
|
15
|
+
- experimental_someMethod
|
|
16
|
+
+ __experimental_someMethod
|
|
17
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Minimum Expo version increased to 53'
|
|
3
|
+
packages: ['expo']
|
|
4
|
+
matcher: "expo\":\\s*\"(?:^|~|>|=|\\s)*(?:50|51|52)\\..*?"
|
|
5
|
+
matcherFlags: 'm'
|
|
6
|
+
category: 'version'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Support for Expo 50, 51, and 52 has been dropped. Update your project to Expo 53 or later:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
{
|
|
13
|
+
"dependencies": {
|
|
14
|
+
- "expo": "~52.0.0",
|
|
15
|
+
+ "expo": "~53.0.0",
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Run the Expo upgrade command:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx expo install expo@latest
|
|
24
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`hideSlug` prop removed'
|
|
3
|
+
matcher: 'hideSlug'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `hideSlug` prop has been removed. Organization slugs are now managed through the Clerk Dashboard under Organization Settings.
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
<OrganizationProfile
|
|
11
|
+
- hideSlug={true}
|
|
12
|
+
/>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To hide organization slugs, update your settings in the Clerk Dashboard → Organization Settings → Slug.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Upgrade Node.js to v20.9.0 or higher'
|
|
3
|
+
category: 'version'
|
|
4
|
+
matcher: "engines\":\\s*{[\\s\\S]*?\"node\":\\s*\"(?:^|~|>|=|\\s)*(?:14|16|18)\\..*?"
|
|
5
|
+
matcherFlags: 'm'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
All Clerk packages now require Node.js 20.9.0 or later. Update your Node.js version and ensure your `package.json` engines field reflects this requirement.
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
{
|
|
12
|
+
"engines": {
|
|
13
|
+
- "node": ">=18.0.0"
|
|
14
|
+
+ "node": ">=20.9.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Encryption key required when passing `secretKey` at runtime'
|
|
3
|
+
packages: ['nextjs']
|
|
4
|
+
matcher: 'clerkMiddleware\([\\s\\S]*?secretKey'
|
|
5
|
+
matcherFlags: 'm'
|
|
6
|
+
category: 'breaking'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
When passing `secretKey` as a runtime option to `clerkMiddleware()`, you must now also provide a `CLERK_ENCRYPTION_KEY` environment variable.
|
|
10
|
+
|
|
11
|
+
Add the encryption key to your environment:
|
|
12
|
+
|
|
13
|
+
```env
|
|
14
|
+
CLERK_ENCRYPTION_KEY=your-encryption-key
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
More information: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`getAuth()` helper removed'
|
|
3
|
+
packages: ['nuxt']
|
|
4
|
+
matcher: 'getAuth\\('
|
|
5
|
+
category: 'deprecation-removal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The deprecated `getAuth()` helper has been removed. Use `event.context.auth()` in your server routes instead:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { getAuth } from '@clerk/nuxt/server';
|
|
12
|
+
|
|
13
|
+
export default defineEventHandler((event) => {
|
|
14
|
+
- const { userId } = getAuth(event);
|
|
15
|
+
+ const { userId } = event.context.auth();
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
userId,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Routing strategy now defaults to `path`'
|
|
3
|
+
packages: ['nuxt']
|
|
4
|
+
matcher:
|
|
5
|
+
- '<SignIn'
|
|
6
|
+
- '<SignUp'
|
|
7
|
+
- '<UserProfile'
|
|
8
|
+
- '<OrganizationProfile'
|
|
9
|
+
- '<CreateOrganization'
|
|
10
|
+
- '<OrganizationList'
|
|
11
|
+
category: 'behavior-change'
|
|
12
|
+
warning: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
The following components now default to `path` routing strategy instead of `hash`:
|
|
16
|
+
|
|
17
|
+
- `<SignIn />`
|
|
18
|
+
- `<SignUp />`
|
|
19
|
+
- `<UserProfile />`
|
|
20
|
+
- `<OrganizationProfile />`
|
|
21
|
+
- `<CreateOrganization />`
|
|
22
|
+
- `<OrganizationList />`
|
|
23
|
+
|
|
24
|
+
If you were relying on the previous `hash` routing behavior, explicitly set the routing prop:
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<SignIn routing="hash" />
|
|
28
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`samlAccount` renamed to `enterpriseAccount`'
|
|
3
|
+
matcher: 'samlAccount'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `samlAccount` property has been renamed to `enterpriseAccount`. Update your code:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- user.samlAccounts
|
|
11
|
+
+ user.enterpriseAccounts
|
|
12
|
+
|
|
13
|
+
- verification.samlAccount
|
|
14
|
+
+ verification.enterpriseAccount
|
|
15
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`saml` strategy renamed to `enterprise_sso`'
|
|
3
|
+
matcher: 'saml'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `saml` authentication strategy has been renamed to `enterprise_sso`. Update any references in your code:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- strategy: 'saml'
|
|
11
|
+
+ strategy: 'enterprise_sso'
|
|
12
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`setActive({ beforeEmit })` changed to `setActive({ navigate })`'
|
|
3
|
+
matcher: 'beforeEmit'
|
|
4
|
+
category: 'deprecation-removal'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `beforeEmit` callback in `setActive()` has been replaced with `navigate`. The callback signature has also changed:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
await setActive({
|
|
11
|
+
session: sessionId,
|
|
12
|
+
- beforeEmit: () => {
|
|
13
|
+
- // Called before session is set
|
|
14
|
+
- }
|
|
15
|
+
+ navigate: ({ session }) => {
|
|
16
|
+
+ // Called with the session object
|
|
17
|
+
+ return '/dashboard';
|
|
18
|
+
+ }
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The `navigate` callback receives an object with the `session` property and should return the URL to navigate to.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`showOptionalFields` now defaults to `false`'
|
|
3
|
+
matcher: 'showOptionalFields'
|
|
4
|
+
category: 'behavior-change'
|
|
5
|
+
warning: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The default value of `appearance.layout.showOptionalFields` (now `appearance.options.showOptionalFields`) has changed from `true` to `false`. Optional fields are now hidden by default during sign up.
|
|
9
|
+
|
|
10
|
+
To restore the previous behavior, explicitly set the option:
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
<ClerkProvider
|
|
14
|
+
appearance={{
|
|
15
|
+
options: {
|
|
16
|
+
showOptionalFields: true,
|
|
17
|
+
}
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'UI themes moved to `@clerk/ui/themes/experimental`'
|
|
3
|
+
matcher:
|
|
4
|
+
- '__experimental_createTheme'
|
|
5
|
+
- 'experimental_createTheme'
|
|
6
|
+
category: 'breaking'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
The `createTheme` theme utility has been moved to a new export path. Update your imports:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- import { __experimental_createTheme } from '@clerk/ui';
|
|
13
|
+
+ import { createTheme } from '@clerk/ui/themes/experimental';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Note: The `__experimental_` prefix has been removed from the method since they're now in the `/themes/experimental` subpath.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`__unstable_*` methods renamed to `__internal_*`'
|
|
3
|
+
matcher: '__unstable_'
|
|
4
|
+
category: 'breaking'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
All `__unstable_*` methods have been renamed to `__internal_*`. These are internal APIs not intended for public use.
|
|
8
|
+
|
|
9
|
+
### @clerk/clerk-js
|
|
10
|
+
|
|
11
|
+
- `__unstable__environment` → `__internal_environment`
|
|
12
|
+
- `__unstable__updateProps` → `__internal_updateProps`
|
|
13
|
+
- `__unstable__setEnvironment` → `__internal_setEnvironment`
|
|
14
|
+
- `__unstable__onBeforeRequest` → `__internal_onBeforeRequest`
|
|
15
|
+
- `__unstable__onAfterResponse` → `__internal_onAfterResponse`
|
|
16
|
+
- `__unstable__onBeforeSetActive` → `__internal_onBeforeSetActive`
|
|
17
|
+
- `__unstable__onAfterSetActive` → `__internal_onAfterSetActive`
|
|
18
|
+
|
|
19
|
+
### @clerk/nextjs
|
|
20
|
+
|
|
21
|
+
- `__unstable_invokeMiddlewareOnAuthStateChange` → `__internal_invokeMiddlewareOnAuthStateChange`
|
|
22
|
+
|
|
23
|
+
### @clerk/chrome-extension
|
|
24
|
+
|
|
25
|
+
- `__unstable__createClerkClient` → `createClerkClient` (exported from `@clerk/chrome-extension/background`)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`UserSettings.saml` renamed to `enterpriseSSO`'
|
|
3
|
+
matcher: 'UserSettings[\\s\\S]*?saml'
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
category: 'deprecation-removal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `saml` property on `UserSettings` has been renamed to `enterpriseSSO`:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- userSettings.saml
|
|
12
|
+
+ userSettings.enterpriseSSO
|
|
13
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`UserButton` sign-out redirect props removed'
|
|
3
|
+
matcher: '<UserButton[\\s\\S]*?(afterSignOutUrl|signOutUrl)[\\s\\S]*?>'
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
category: 'deprecation-removal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `UserButton` component no longer accepts sign-out redirect override props. Configure sign-out redirects using one of these methods:
|
|
9
|
+
|
|
10
|
+
**Global configuration:**
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
<ClerkProvider afterSignOutUrl="/signed-out">
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Per-button with SignOutButton:**
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
<SignOutButton redirectUrl='/goodbye'>Sign Out</SignOutButton>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Programmatic:**
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
clerk.signOut({ redirectUrl: '/signed-out' });
|
|
26
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/upgrade",
|
|
3
|
-
"version": "2.0.0-snapshot.
|
|
3
|
+
"version": "2.0.0-snapshot.v20251215203425",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/clerk/javascript.git",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
25
|
"ejs": "3.1.10",
|
|
26
26
|
"execa": "9.4.1",
|
|
27
|
-
"globby": "^14.0.1",
|
|
28
27
|
"gray-matter": "^4.0.3",
|
|
29
28
|
"index-to-position": "^0.1.2",
|
|
30
29
|
"jscodeshift": "^17.0.0",
|
|
@@ -32,7 +31,8 @@
|
|
|
32
31
|
"meow": "^11.0.0",
|
|
33
32
|
"read-pkg": "^9.0.1",
|
|
34
33
|
"semver-regex": "^4.0.5",
|
|
35
|
-
"temp-dir": "^3.0.0"
|
|
34
|
+
"temp-dir": "^3.0.0",
|
|
35
|
+
"tinyglobby": "^0.2.15"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/cli": "^7.24.7",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"dev": "babel --keep-file-extension --out-dir=dist --watch src --copy-files",
|
|
52
52
|
"format": "node ../../scripts/format-package.mjs",
|
|
53
53
|
"format:check": "node ../../scripts/format-package.mjs --check",
|
|
54
|
+
"generate-guide": "node scripts/generate-guide.js",
|
|
54
55
|
"lint": "eslint src/",
|
|
55
56
|
"lint:publint": "publint",
|
|
56
57
|
"test": "vitest run",
|