Closed john--kane closed 1 year ago
@john--kane I assume you are talking about the app-beta feature, right? @clerk/nextjs
uses an interstitial page mechanism so as to have almost instance session state. Would you like to elaborate more on the request?
@SokratisVidros Yes, app-beta, testing on NextJS 13. Can do, it could also be an incorrect implementation on my part but they way I've got it is. ClerkProvider at the root layout, middleware.ts catches auth state via withClerkMiddleware (which I think you're referring to as their interstitial method) and client Clerk UI components rendering some UI conditionally.
My main 'issue' is around the client side
End effect is that user sees a loading spinner for a noticeable period of time, which I was looking to reduce since the middleware and session are good to go from the NextJS server side.
Is there better/official solution for NextJS 13, e.g. server component approach instead? e.g. use case of showing the profile component conditionally when the user is logged in.
@john--kane Hello! Thank you for reaching out! I understand your issue visually, but it would be helpful for us if you provided a demo of it. A sample of code or a code repository where this can be reproduced so that we can quickly identify the issue if there is one and address it or let you know how to work around this.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Package
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
gatsby-plugin-clerk
build/tooling/chore
Description
When using the in @clerk/nextjs , etc take time to recognise session state. Is it possible to add a revalidate flag or something like it to speed up this UI.
Current impact is that on every page load/transition a loading spinner is required to conditionally render part of the UI related to the clerk user.
Initial thoughts: use the Next13 loading.tsx as the place for this Clerk state check, or perhaps the provider needs some way to maintain state across page loads without going to clerk to reconfirm every time?