-
Notifications
You must be signed in to change notification settings - Fork 460
chore(clerk-js,backend,shared):Apply deprecation warnings @clerk/types
#1823
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
13 commits
Select commit
Hold shift + click to select a range
868ff6c
fix(shared): Fix deprecatedObjectProperty key usage and support optio…
dimkl 0c32d41
chore(clerk-js): Warn about orgs jwt claim deprecation
dimkl 033ed90
chore(backend): Warn about orgs jwt claim deprecation
dimkl d0c669b
chore(backend): Warn about apiKey deprecation
dimkl 225e3ef
chore(backend): Fix typo in frontendApi deprecation warning
dimkl cb1deb3
chore(clerk-react,clerk-js): Warn about PublishableKeyOrFrontendApi.f…
dimkl 4e78724
chore(clerk-js): Warn about PublicUserData.profileImageUrl deprecations
dimkl 0c04f1f
chore(clerk-js): Warn about redirect_url deprecations
dimkl 41d8871
chore(clerk-js): Warn about password deprecations in User.update
dimkl 31f7217
chore(clerk-js): Warn about generateSignature deprecations
dimkl c60c9c2
chore(clerk-js): Warn about afterSwitchOrganizationUrl deprecation
dimkl e292115
chore(clerk-js): Warn about UserData.profileImageUrl deprecations
dimkl 10fb826
chore(clerk-js): Use PublicUserData and UserData instead of multiple …
dimkl 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,17 @@ | ||
| --- | ||
| '@clerk/clerk-js': patch | ||
| '@clerk/backend': patch | ||
| '@clerk/shared': patch | ||
| '@clerk/clerk-react': patch | ||
| --- | ||
|
|
||
| Apply deprecation warnings for @clerk/types: | ||
|
|
||
| - `orgs` jwt claims | ||
| - `apiKey` | ||
| - `frontendApi` | ||
| - `redirect_url` | ||
| - `password` | ||
| - `generateSignature` | ||
| - `afterSwitchOrganizationUrl` | ||
| - `profileImageUrl` |
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
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { deprecatedProperty } from '@clerk/shared'; | ||
| import type { UserData as IUserData } from '@clerk/types'; | ||
| import type { UserDataJSON } from '@clerk/types'; | ||
|
|
||
| export class UserData implements IUserData { | ||
| firstName?: string; | ||
| lastName?: string; | ||
| /** | ||
| * @deprecated Use `imageUrl` instead. | ||
| */ | ||
| profileImageUrl?: string; | ||
| imageUrl?: string; | ||
| hasImage?: boolean; | ||
|
|
||
| constructor(data: UserDataJSON) { | ||
| this.fromJSON(data); | ||
| } | ||
|
|
||
| protected fromJSON(data: UserDataJSON | null): this { | ||
| if (data) { | ||
| this.firstName = data.first_name; | ||
| this.lastName = data.last_name; | ||
| this.profileImageUrl = data.profile_image_url; | ||
| this.imageUrl = data.image_url; | ||
| this.hasImage = data.has_image; | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
| } | ||
|
|
||
| deprecatedProperty(UserData, 'profileImageUrl', 'Use `imageUrl` instead.'); |
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.
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.
❓ Why are we renaming this class?
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.
Because the
publicUserDataproperty is the same for all Resources (egOrganizationMembership,Session), so there is no need to create a separate class for each resource.