-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat(clerk-react,clerk-js, types,shared): Introduce Clerk.status
#5476
base: main
Are you sure you want to change the base?
feat(clerk-react,clerk-js, types,shared): Introduce Clerk.status
#5476
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…clerk-has-failed-to-load-from # Conflicts: # packages/react/src/isomorphicClerk.ts
🦋 Changeset detectedLatest commit: 55da252 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
The inline script might fail before the event listeners are attached which causes an infinite pending state. Instead, we would like to retry fetching the script and/or throw an error.
This reverts commit 129d423.
…clerk-has-failed-to-load-from # Conflicts: # packages/clerk-js/src/core/auth/AuthCookieService.ts
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.
Overall LGTM, some smaller comments
…clerk-has-failed-to-load-from
86733c1
to
177e4e2
Compare
My comments were addressed, so no reason to block this
177e4e2
to
67fbe8f
Compare
…clerk-has-failed-to-load-from
…clerk-has-failed-to-load-from
Description
Introduce
useClerk().status
,Clerk.status
alongside<ClerkFailed/>
and<ClerkDegraded/>
.useClerk().status
Possible values are:
loading
(initial state)error
set when hotloading clerk-js failed orClerk.load()
failedready
set when Clerk is fully operationaldegraded
set when Clerk is partially operationaluseClerk().loaded
istrue
whenuseClerk().status
is either"ready"
or"degraded"
.useClerk().loaded
isfalse
whenuseClerk().status
is"loading"
or"error"
.Important
🚨🚨
Clerk.status
becomesloading
upon instantiation not upon calling.load()
New APIs
on()
Calls handler on every status event with the new status as parameter
Calls handler immediately with the last payload of the event.
off()
Accepts a handler to unregister from the specified event.
Removes all handlers for the specified event.
New Components
<ClerkFailed/>
<ClerkDegraded/>
Clerk.status values
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change