chore(*): Improve @clerk/clerk-react DX#2328
Conversation
🦋 Changeset detectedLatest commit: 00e342a The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
79b8de6 to
69c5aa9
Compare
69c5aa9 to
9c95a13
Compare
| return null; | ||
| } | ||
|
|
||
| return <LoadedGuarantee>{children(clerk as unknown as LoadedClerk)}</LoadedGuarantee>; |
There was a problem hiding this comment.
❓ Can you please elaborate what replaces the loaded guarantee?
There was a problem hiding this comment.
Nothing used the LoadedGuarantee (or "structure context") since the v4 hook change. We kept it around in case we wanted to use it to throw better errors in cases where the Clerk hooks were used outside the Clerk provider but ended up doing that by simply checking wether the ClerkProvider context exists or not.
Extra context: The LoadedGuarantee (or "structure context") used to wrap all SignedIn and SignedOut components and the older hooks could only be used when nested under these components - this is no longer the case as all hooks return isLoaded
| isEmailLinkError, | ||
| isKnownError, | ||
| isMetamaskError, | ||
| EmailLinkErrorCode, |
There was a problem hiding this comment.
Do we need both isEmailLinkError and EmailLinkErrorCode?
There was a problem hiding this comment.
How about exporting ClerkRuntimeError and ClerkAPIResponseError?
There was a problem hiding this comment.
Do we need both isEmailLinkError and EmailLinkErrorCode?
I think we should keep only the isEmailLinkError
How about exporting ClerkRuntimeError and ClerkAPIResponseError?
Let's keep only the helpers to allow the consumers of that package to identify and handle those errors but for now since those errors are supposed to be thrown by Clerk let's avoid exposing them.
If we need to use them in any of our packages we can import them from @clerk/shared
9c95a13 to
dd9c187
Compare
161024f to
6c36681
Compare
|
@dimkl Rebase |
… withClerk, WithClerk, withSession, WithSession
Actions: - Use `tsc` on success to produce types - Use `emitDeclarationOnly: true` - Replace `d.mts` with `d.ts` types in package.json - Move `setErrorThrowerOptions` definition from `/internal` to `errors.ts` Why: - Enabling `dts` was causing build issues with controlComponents inferred type in `@clerk/remix` package - Emitting declarations only is used to avoid tampering the bundled code which is configured as part of tsup - Using `d.ts` files for types is set because `d.mts` are not generated since we disabled dts option and the generated `d.mts` are the same as `d.ts` files based on some comparisons - Moving the `setErrorThrowerOptions` was done to simplify the dependency tree
…rop EmailLinkErrorCode export
… of X cannot be named without a reference to Y" TS issue: microsoft/TypeScript#47663
6c36681 to
b809288
Compare
Description
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore