Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: da1ede7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis pull request adds support for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: |
There was a problem hiding this comment.
This PR in itself should not change the public behavior since we are still awaiting another header (nonce) in the provider. When we fix that, it will sometimes move where things suspend which is worthy of a proper changeset.
jacekradko
left a comment
There was a problem hiding this comment.
Nice work! Looks ready to go, but let's make an issue to come back and ensure we backfill any test coverage
|
@jacekradko Thanks! I chose not to include that here since the public behavior didn't change as part of this PR. I could have included some unit tests but not sure those are very valuable here so kind of want to figure out the whole thing first. I went ahead and created a ticket to not forget. 👍 |
Description
This PR adds internal support for
initialState: Promise<InitialState>and uses that in the Next SDK when<ClerkProvider dynamic>.This avoids having to await it in the top level provider, instead moving that down to where the
initialStateis actually being consumed, the hooks. This is done via theReact.usehook, which is only supported in React 19, which all Next versions core3 supports already relies on.Given that
initialStatecurrently only comes from a header, this might not seem like a consequential change, but it helps with two things:cacheComponentssupport, we want to move everything dynamic out of theClerkProviderdown to where things are actually used. This would also avoid users having to wrap the<ClerkProvider>in a<Suspense>boundary, instead being able to place those further down.initialState, and not blocking at the top level will be beneficial thenSummary by CodeRabbit
New Features
Improvements
Chores