feat(clerk-react,clerk-js,shared): Dynamically update props based on … - #2515
Merged
nikosdouvlis merged 3 commits intoJan 11, 2024
Merged
Conversation
…deep equality This change was made in an effort to support dynamic values for appearance, localization as modifying this values usually happens during dev where a fast HMR iteration cycle is required. However, we'd also like to support dynamic values for props like redirectUrl, where the value can be calculated based on data available during runtime, even after the Clerk components mount (eg, based on the results of a fetch request). In order to avoid extra renders, we use the pre-existing dequal utility to make sure that expensive calculations are avoided.
🦋 Changeset detectedLatest commit: b191313 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
nikosdouvlis
commented
Jan 9, 2024
| @@ -16,3 +16,5 @@ const useDeepEqualMemoize = <T>(value: T) => { | |||
| export const useDeepEqualMemo: UseDeepEqualMemo = (factory, dependencyArray) => { | |||
Member
Author
There was a problem hiding this comment.
This file was moved from clerk-js to shared
dimkl
approved these changes
Jan 9, 2024
nikosdouvlis
force-pushed
the
nikos/sdk-99-dynamic-redirecturl-not-respected-in-signin-signup
branch
from
January 11, 2024 08:55
61cebda to
8cc2a5c
Compare
React `children` can hold circular references with other `children` arrays and this crashes the deepEqual mechanism The customPages implementation requires the prop references to always change so there is no need to compare these on every prop update
anagstef
approved these changes
Jan 11, 2024
nikosdouvlis
deleted the
nikos/sdk-99-dynamic-redirecturl-not-respected-in-signin-signup
branch
January 11, 2024 11:34
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…deep equality
This change was made in an effort to support dynamic values for appearance, localization as modifying this values usually happens during dev where a fast HMR iteration cycle is required. However, we'd also like to support dynamic values for props like redirectUrl, where the value can be calculated based on data available during runtime, even after the Clerk components mount (eg, based on the results of a fetch request).
In order to avoid extra renders, we use the pre-existing dequal utility to make sure that expensive calculations are avoided.
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