-
Notifications
You must be signed in to change notification settings - Fork 431
fix(astro): Automatically use CSR control components for prerendered pages #7708
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 0c94d7d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/astro/src/astro-components/control/Protect.astro (1)
34-54: ProtectCSR is missing support for theprotect-fallbackslot.While ProtectSSR correctly implements the
protect-fallbackslot pattern (with fallback tofallbackslot) matching Protect.astro, ProtectCSR only handles thefallbackslot (line 40). This creates an inconsistency: the CSR implementation won't recognize theprotect-fallbackslot, while the SSR implementation will.ProtectCSR needs to add support for
protect-fallbackslot with the same fallback pattern used in Protect.astro and ProtectSSR.astro to maintain consistency across both rendering strategies.
Description
Fixes #7613
This PR fixes a runtime error that occurs when using Astro Clerk control components (
<SignedIn>,<SignedOut>,<Protect>) on prerendered pages.Modified the control component wrappers (
SignedIn.astro,SignedOut.astro,Protect.astro) to detect whenAstro.locals.authis unavailable and automatically fall back to CSR (client-side rendering) variants.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.