Skip to content

Commit cdae69e

Browse files
authored
Merge branch 'main' into elef/sdk-1627-userprofile-menubuttons-have-no-labels
2 parents 98a2efe + 0deaf07 commit cdae69e

File tree

12 files changed

+45
-90
lines changed

12 files changed

+45
-90
lines changed

.changeset/good-paws-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/elements': patch
3+
---
4+
5+
Widen optional peerDependency of `next` to include `>=15.0.0-rc`. This way you can use Next.js 15 with Clerk Elements without your package manager complaining. Also allow React 19.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129

130130
strategy:
131131
matrix:
132-
test-name: ['generic', 'nextjs', 'express', 'quickstart', 'ap-flows', 'elements']
132+
test-name: [ 'generic', 'nextjs', 'express', 'quickstart', 'ap-flows', 'elements' ]
133133
test-project: ['chrome']
134134

135135
steps:

integration/presets/longRunningApps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const createLongRunningApps = () => {
2828

2929
return {
3030
getByPattern: (patterns: Array<string | (typeof configs)[number]['id']>) => {
31-
const res = new Set(...patterns.map(pattern => apps.filter(app => idMatchesPattern(app.id, pattern))));
31+
const res = new Set(patterns.map(pattern => apps.filter(app => idMatchesPattern(app.id, pattern))).flat());
3232
if (!res.size) {
3333
const availableIds = configs.map(c => `\n- ${c.id}`).join('');
3434
throw new Error(`Could not find long running app with id ${patterns}. The available ids are: ${availableIds}`);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SignIn } from '@clerk/nextjs';
2+
3+
export default function Page() {
4+
return (
5+
<div>
6+
<SignIn routing={'hash'} />
7+
</div>
8+
);
9+
}

integration/testUtils/testAgainstRunningApps.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { parseEnvOptions } from '../scripts';
1010

1111
type RunningAppsParams = {
1212
withEnv?: EnvironmentConfig | EnvironmentConfig[];
13+
withPattern?: string[];
1314
};
1415

1516
/**
@@ -20,24 +21,28 @@ type RunningAppsParams = {
2021
*/
2122
const runningApps = (params: RunningAppsParams = {}) => {
2223
const withEnv = [params.withEnv].flat().filter(Boolean);
24+
const withPattern = (params.withPattern || []).flat().filter(Boolean);
2325
const { appIds, appUrl, appPk, appSk, clerkApiUrl } = parseEnvOptions();
26+
2427
if (appIds.length) {
2528
// if appIds are provided, we only return the apps with the given ids
2629
const filter = app => (withEnv.length ? withEnv.includes(app.env) : true);
27-
return appConfigs.longRunningApps.getByPattern(appIds).filter(filter);
30+
return appConfigs.longRunningApps.getByPattern(withPattern.length ? withPattern : appIds).filter(filter);
2831
}
32+
2933
// if no appIds are provided, it means that the user is running an app manually
3034
// so, we return the app with the given env
3135
const env = environmentConfig()
3236
.setId('tempEnv')
3337
.setEnvVariable('private', 'CLERK_SECRET_KEY', appSk)
3438
.setEnvVariable('private', 'CLERK_API_URL', clerkApiUrl)
3539
.setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', appPk);
40+
3641
return [longRunningApplication({ id: 'standalone', env, serverUrl: appUrl, config: applicationConfig() })];
3742
};
3843

39-
export const testAgainstRunningApps =
40-
(runningAppsParams: RunningAppsParams) => (title: string, cb: (p: { app: Application }) => void) => {
44+
export function testAgainstRunningApps(runningAppsParams: RunningAppsParams) {
45+
return (title: string, cb: (p: { app: Application }) => void) => {
4146
test.describe(title, () => {
4247
runningApps(runningAppsParams).forEach(app => {
4348
test.describe(`${app.name}`, () => {
@@ -46,3 +51,4 @@ export const testAgainstRunningApps =
4651
});
4752
});
4853
};
54+
}

integration/tests/navigation.test.ts

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,13 @@
11
import { test } from '@playwright/test';
22

3-
import type { Application } from '../models/application';
4-
import { appConfigs } from '../presets';
53
import type { FakeUser } from '../testUtils';
6-
import { createTestUtils } from '../testUtils';
4+
import { createTestUtils, testAgainstRunningApps } from '../testUtils';
75

8-
test.describe('navigation modes @generic', () => {
6+
testAgainstRunningApps({ withPattern: ['next.appRouter.withEmailCodes'] })('navigation modes @generic', ({ app }) => {
97
test.describe.configure({ mode: 'serial' });
10-
let app: Application;
118
let fakeUser: FakeUser;
129

1310
test.beforeAll(async () => {
14-
app = await appConfigs.next.appRouter
15-
.clone()
16-
.addFile(
17-
'src/app/provider.tsx',
18-
() => `'use client'
19-
import { ClerkProvider } from "@clerk/nextjs";
20-
21-
export function Provider({ children }: { children: any }) {
22-
return (
23-
<ClerkProvider>
24-
{children}
25-
</ClerkProvider>
26-
)
27-
}`,
28-
)
29-
.addFile(
30-
'src/app/layout.tsx',
31-
() => `import './globals.css';
32-
import { Inter } from 'next/font/google';
33-
import { Provider } from './provider';
34-
35-
const inter = Inter({ subsets: ['latin'] });
36-
37-
export const metadata = {
38-
title: 'Create Next App',
39-
description: 'Generated by create next app',
40-
};
41-
42-
export default function RootLayout({ children }: { children: React.ReactNode }) {
43-
return (
44-
<Provider>
45-
<html lang='en'>
46-
<body className={inter.className}>{children}</body>
47-
</html>
48-
</Provider>
49-
);
50-
}`,
51-
)
52-
.addFile(
53-
'src/app/hash/sign-in/page.tsx',
54-
() => `
55-
import { SignIn } from '@clerk/nextjs';
56-
57-
export default function Page() {
58-
return (
59-
<SignIn routing="hash" />
60-
);
61-
}`,
62-
)
63-
.commit();
64-
await app.setup();
65-
await app.withEnv(appConfigs.envs.withEmailCodes);
66-
await app.dev();
67-
6811
const m = createTestUtils({ app });
6912
fakeUser = m.services.users.createFakeUser();
7013
await m.services.users.createBapiUser(fakeUser);
@@ -105,7 +48,7 @@ export default function Page() {
10548
await u.po.expect.toBeSignedIn();
10649
});
10750

108-
test('sign in with path routing navigates to previous page', async ({ page, context }) => {
51+
test.skip('sign in with path routing navigates to previous page', async ({ page, context }) => {
10952
const u = createTestUtils({ app, page, context });
11053
await u.po.signIn.goTo();
11154
await u.po.signIn.waitForMounted();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts",
3737
"test:integration:elements": "E2E_APP_ID=elements.* npm run test:integration:base -- --grep @elements",
3838
"test:integration:express": "E2E_APP_ID=express.* npm run test:integration:base -- --grep @express",
39-
"test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic",
39+
"test:integration:generic": "E2E_APP_ID=react.vite.*,next.appRouter.withEmailCodes npm run test:integration:base -- --grep @generic",
4040
"test:integration:nextjs": "E2E_APP_ID=next.appRouter.* npm run test:integration:base -- --grep @nextjs",
4141
"test:integration:quickstart": "E2E_APP_ID=quickstart.* npm run test:integration:base -- --grep @quickstart",
4242
"test:integration:remix": "echo 'placeholder'",

packages/elements/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@
9595
"peerDependencies": {
9696
"@clerk/clerk-react": "^5.0.0",
9797
"@clerk/shared": "^2.0.0",
98-
"next": "^13.5.4 || ^14.0.3",
99-
"react": ">=18",
100-
"react-dom": ">=18"
98+
"next": "^13.5.4 || ^14.0.3 || ^15.0.0-rc",
99+
"react": "^18.0.0 || ^19.0.0-beta",
100+
"react-dom": "^18.0.0 || ^19.0.0-beta"
101101
},
102102
"peerDependenciesMeta": {
103103
"next": {

packages/elements/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// TODO: Add link to docs
21
throw new Error(`No exports are available from the top-level "@clerk/elements" package.
32
Use specific subpath imports instead, e.g. "@clerk/elements/sign-in".
43
54
Find all available exports in the documentation:
6-
https://clerk.com/docs`);
5+
https://clerk.com/docs/elements/overview`);

0 commit comments

Comments
 (0)