-
Notifications
You must be signed in to change notification settings - Fork 462
chore(*): Improve @clerk/clerk-react DX #2328
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9ae5337
chore(clerk-react): Restrcture errors to separate module /errors module
dimkl f56123d
chore(clerk-react): Move errorThrower.ts to /errors path
dimkl a8010dc
chore(clerk-react): Introduce /internal subpath and export `setErrorT…
dimkl b09be52
chore(*): Move MultisessionAppSupport to @clerk/clerk-react/internal …
dimkl 8957d7d
chore(clerk-react): Introduce /errors subpath and export errors
dimkl ba34bec
chore(clerk-react,nextjs,clerk-expo): Drop public withUser, WithUser,…
nikosdouvlis 789cb01
chore(clerk-react): Drop StructureContext and related errors
nikosdouvlis 0d17493
fix(clerk-react): Drop `WithClerkProp` exported type
dimkl c73cf91
chore(repo): Add changeset
dimkl 4b52865
chore(clerk-react): Fix tsup configuration for type generation
dimkl ade1d3a
chore(*): Rename /errors subpath to /error in clerk/clerk-react and d…
dimkl 2bf5f19
chore(integration): Rename error to errors and fix "The inferred type…
nikosdouvlis 4ea2d22
chore(clerk-expo,nextjs): Drop internal MultisessionAppSupport export
dimkl b809288
chore(chrome-extension): Fix tests
dimkl 00e342a
fix(clerk-react): Use mts files for package.json[exports][imports]
nikosdouvlis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| 'gatsby-plugin-clerk': major | ||
| '@clerk/chrome-extension': major | ||
| '@clerk/nextjs': major | ||
| '@clerk/clerk-react': major | ||
| '@clerk/remix': major | ||
| '@clerk/clerk-expo': major | ||
| --- | ||
|
|
||
| - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg | ||
| ```typescript | ||
| // Before | ||
| import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; | ||
| // After | ||
| import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; | ||
|
|
||
| // Before | ||
| import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; | ||
| // After | ||
| import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react/errors'; | ||
|
|
||
| // Before | ||
| import { MultisessionAppSupport } from '@clerk/clerk-react'; | ||
| // After | ||
| import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; | ||
|
brkalow marked this conversation as resolved.
|
||
| ``` | ||
| - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: | ||
| - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) | ||
| - `WithClerkProp` type | ||
| - `MultisessionAppSupport` component (moved to /internal subpath) | ||
| - `EmailLinkErrorCode` enum | ||
| - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. | ||
| - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` | ||
| to reduce the export surface since it's trivial to implement if needed. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| export * from '@clerk/clerk-react'; | ||
|
|
||
| // Override Clerk React error thrower to show that errors come from gatsby-plugin-clerk | ||
| import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; | ||
| setErrorThrowerOptions({ packageName: PACKAGE_NAME }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /*/ | ||
| !/src/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.