Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 469
feat(clerk-js): Allow Environment init with defaults#5287
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
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
cf1164d
feat(clerk-js): allow initialization with defaults
jacekradko 1c454b7
add captchaOauthBypess default
jacekradko 8f20fda
wip
jacekradko 32ca7c5
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko b591c92
Update packages/clerk-js/src/core/clerk.ts
jacekradko f28ab02
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko 3c7ea37
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko 8979e81
wip: withDefault helper
jacekradko ed5e1dd
typedoc
jacekradko a45783c
authconfig
jacekradko b9da1b9
displayconfig
jacekradko 2be6547
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko e9d3a80
Update userSettings
jacekradko 5471c2e
wip
jacekradko fc0b9f6
snappies
jacekradko b20008d
authconfig test
jacekradko 077a26f
wip
jacekradko 3195ab0
wip
jacekradko e793ae0
wip
jacekradko 2be4276
wip
jacekradko f5bfe87
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko b9435f6
wip
jacekradko e08bff0
wip
jacekradko 95c2542
Merge branch 'main' into feat/initialize-clerk-js-with-defaults
jacekradko fb8654b
PR feedback from @LekoArts
jacekradko 1d9edbf
feedback
jacekradko e098603
wip
jacekradko 0115dcf
Apply suggestions from code review
jacekradko ecf070a
wip
jacekradko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
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,5 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| --- | ||
| Improve the resilience of the SDK against situations where the /v1/environment endpoint is not reachable. This is achieved by allowing the initialization of the environment with default values. |
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 |
|---|---|---|
| @@ -166,6 +166,18 @@ export abstract class BaseResource { | ||
| protected abstract fromJSON(data: ClerkResourceJSON | null): this; | ||
| /** | ||
| * Returns the provided value if it is not `undefined` or `null`, otherwise returns the default value. | ||
| * | ||
| * @template T - The type of the value. | ||
| * @param value - The value to check. | ||
| * @param defaultValue - The default value to return if the provided value is `undefined` or `null`. | ||
| * @returns The provided value if it is not `undefined` or `null`, otherwise the default value. | ||
| */ | ||
| protected withDefault<T>(value: T | undefined | null, defaultValue: T): T { | ||
| return value ?? defaultValue; | ||
| } | ||
jacekradko marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| protected async _baseGet<J extends ClerkResourceJSON | null>(opts: BaseFetchOptions = {}): Promise<this> { | ||
| const json = await BaseResource._fetch<J>( | ||
| { | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.