Skip to content

Commit d7ba456

Browse files
committed
Merge branch 'main' into nk/wire-clerk-ui-version
2 parents 7232e0b + 6e90b7f commit d7ba456

71 files changed

Lines changed: 2111 additions & 1415 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fifty-suits-vanish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/backend": patch
3+
---
4+
5+
Added date filter parameters to user list endpoint
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fix backwards compatibility for legacy `clerkUICtor` option removed in the `ui` prop PR

.changeset/green-humans-yawn.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@clerk/react-router': major
3+
---
4+
5+
Usage of `rootAuthLoader` without the `clerkMiddleware()` installed will not throw a runtime error.
6+
7+
**Before (Removed):**
8+
9+
```tsx
10+
import { rootAuthLoader } from '@clerk/react-router/ssr.server'
11+
12+
export const loader = (args: Route.LoaderArgs) => rootAuthLoader(args)
13+
```
14+
15+
**After:**
16+
17+
1. Enable the `v8_middleware` future flag:
18+
19+
```ts
20+
// react-router.config.ts
21+
export default {
22+
future: {
23+
v8_middleware: true,
24+
},
25+
} satisfies Config;
26+
```
27+
28+
2. Use the middleware in your app:
29+
30+
```tsx
31+
import { clerkMiddleware, rootAuthLoader } from '@clerk/react-router/server'
32+
33+
export const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]
34+
35+
export const loader = (args: Route.LoaderArgs) => rootAuthLoader(args)
36+
```

.changeset/ready-cats-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/astro': patch
3+
---
4+
5+
Fixed an issue when using `ClientRouter` where Clerk components don't load until navigation is performed.

.changeset/shiny-owls-dance.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@clerk/ui': minor
3+
'@clerk/react': minor
4+
'@clerk/nextjs': minor
5+
'@clerk/vue': minor
6+
'@clerk/astro': minor
7+
'@clerk/chrome-extension': minor
8+
'@clerk/shared': minor
9+
---
10+
11+
Add `ui` prop to `ClerkProvider` for passing `@clerk/ui`

.changeset/soft-trains-grin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/thin-camels-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/ui": patch
3+
---
4+
5+
Fixed an issue where primary identifier in OAuth consent screen shows undefined when signing in with phone number only

integration/templates/express-vite/src/client/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Clerk } from '@clerk/clerk-js';
2-
import { ClerkUi } from '@clerk/ui/entry';
2+
import { ClerkUI } from '@clerk/ui/entry';
33

44
const publishableKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
55

66
document.addEventListener('DOMContentLoaded', async function () {
77
const clerk = new Clerk(publishableKey);
88

99
await clerk.load({
10-
clerkUICtor: ClerkUi,
10+
ui: { ClerkUI },
1111
});
1212

1313
if (clerk.isSignedIn) {

integration/tests/next-build.test.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { expect, test } from '@playwright/test';
22

33
import type { Application } from '../models/application';
44
import { appConfigs } from '../presets';
5+
import { linkPackage } from '../presets/utils';
56

67
type RenderingModeTestCase = {
78
name: string;
@@ -23,6 +24,69 @@ function getIndicator(buildOutput: string, type: 'Static' | 'Dynamic') {
2324
.split(' ')[0];
2425
}
2526

27+
test.describe('next build - bundled UI with react-server condition @nextjs', () => {
28+
test.describe.configure({ mode: 'parallel' });
29+
let app: Application;
30+
31+
test.beforeAll(async () => {
32+
test.setTimeout(90_000); // Wait for app to be ready
33+
app = await appConfigs.next.appRouter
34+
.clone()
35+
.addDependency('@clerk/ui', linkPackage('ui'))
36+
.addFile(
37+
'src/app/layout.tsx',
38+
() => `import './globals.css';
39+
import { Inter } from 'next/font/google';
40+
import { ClerkProvider } from '@clerk/nextjs';
41+
import { ui } from '@clerk/ui';
42+
43+
const inter = Inter({ subsets: ['latin'] });
44+
45+
export const metadata = {
46+
title: 'Create Next App',
47+
description: 'Generated by create next app',
48+
};
49+
50+
export default function RootLayout({ children }: { children: React.ReactNode }) {
51+
return (
52+
<ClerkProvider ui={ui}>
53+
<html lang='en'>
54+
<body className={inter.className}>{children}</body>
55+
</html>
56+
</ClerkProvider>
57+
);
58+
}
59+
`,
60+
)
61+
.commit();
62+
await app.setup();
63+
await app.withEnv(appConfigs.envs.withEmailCodes);
64+
await app.build();
65+
});
66+
67+
test.afterAll(async () => {
68+
await app.teardown();
69+
});
70+
71+
test('When ui prop is used in server component layout, builds successfully', () => {
72+
// The layout.tsx imports { ui } from "@clerk/ui" and passes ui={ui} to ClerkProvider
73+
// This tests the react-server conditional export which provides a server-safe marker
74+
// The build should succeed without errors about client-only modules in server components
75+
expect(app.buildOutput).not.toMatch(/error/i);
76+
expect(app.buildOutput).toContain('Generating static pages');
77+
});
78+
79+
test('Static pages remain static with bundled UI', () => {
80+
// Get the static indicator from the build output
81+
const staticIndicator = getIndicator(app.buildOutput, 'Static');
82+
83+
// /_not-found should still be static even with bundled UI
84+
const notFoundPageLine = app.buildOutput.split('\n').find(msg => msg.includes('/_not-found'));
85+
86+
expect(notFoundPageLine).toContain(staticIndicator);
87+
});
88+
});
89+
2690
test.describe('next build - provider as client component @nextjs', () => {
2791
test.describe.configure({ mode: 'parallel' });
2892
let app: Application;

integration/tests/react-router/pre-middleware.test.ts

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)