-
Notifications
You must be signed in to change notification settings - Fork 436
feat(testing): Add nextjs cache components test app #7728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add integration test app for Next.js 16 cache components feature to validate Clerk's auth() behavior with the new cacheComponents config. Test scenarios: - auth() in server components, server actions, and API routes - 'use cache' correct pattern (auth outside, userId passed in) - 'use cache' error documentation - PPR with auth() - Protected routes via proxy Key findings: - ClerkProvider must be wrapped in Suspense for cache components - auth() inside 'use cache' functions produces build-time error - Route segment configs (dynamic) incompatible with cacheComponents
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📝 WalkthroughWalkthroughAdds a new Next.js integration template 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…nents - Apply Prettier formatting to template files - Add next.cacheComponents to E2E_APP_ID pattern in test:integration:nextjs
- Revert E2E_APP_ID pattern for nextjs tests to only match appRouter apps - Change cache-components test tag from @nextjs to @cache-components - Add dedicated test:integration:cache-components script
Runs with Next.js 16 which supports the "use cache" directive.
Summary
Adds integration test app for Next.js 16 cache components feature to validate Clerk's
auth()behavior with the newcacheComponentsconfig.Test Scenarios
auth()in server components, server actions, and API routes"use cache"correct pattern (auth outside, userId passed in)"use cache"error documentationauth()Key Findings
<Suspense>for cache components to workauth()inside"use cache"functions produces build-time errordynamic) incompatible withcacheComponentsexperimental.pprto top-levelcacheComponentsFiles Added
integration/templates/next-cache-components/- Full test appintegration/tests/cache-components.test.ts- E2E testsintegration/presets/next.tswithcacheComponentspresetTest plan
pnpm test:integration:next-cache-componentscd integration/templates/next-cache-components && pnpm buildSummary by CodeRabbit
New Features
Tests
Chores