-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Performance: Store personalDetails
loading state in personalDetailsMetadata
key
#38756
Conversation
personalDetailsMetadata
keypersonalDetails
loading state in personalDetailsMetadata
key
personalDetails
loading state in personalDetailsMetadata
keypersonalDetails
loading state in personalDetailsMetadata
key
Reviewer Checklist
Screenshots/VideosAndroid: NativemetaDataAndroid.mp4Android: mWeb ChromemetaDataAndroidChrome.mp4iOS: NativemetaDataiOS.mp4iOS: mWeb SafarimetaDataiOSSafari.mp4MacOS: Chrome / SafarimetaDataAfterThisChange.mp4metaDataOnMain.mp4MacOS: DesktopmetaDataDesktop.mp4 |
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.
LGTM
@@ -265,6 +268,9 @@ export default withOnyx<ProfilePageProps, ProfilePageOnyxProps>({ | |||
personalDetails: { | |||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | |||
}, | |||
personalDetailsMetadata: { | |||
key: ONYXKEYS.PERSONAL_DETAILS_METADATA, |
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.
Do we need to connect to the whole thing, or can we use a selector to just connect to the one accountID we're interested in?
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.
There's no way we can retrieve the accountID
from route
in Onyx selector
because selector
does not expose the component's props
in its parameters. Neither does Onyx key
callback, because PERSONAL_DETAILS_METADATA
is not a collection type. Wdyt?
@@ -55,6 +56,9 @@ export default withOnyx<ProfileAvatarProps, ProfileAvatarOnyxProps>({ | |||
personalDetails: { | |||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | |||
}, | |||
personalDetailsMetadata: { | |||
key: ONYXKEYS.PERSONAL_DETAILS_METADATA, |
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.
Same question here about selector.
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.
Same ^
Co-authored-by: c3024 <[email protected]>
Co-authored-by: Puneet Lath <[email protected]>
src/ONYXKEYS.ts
Outdated
@@ -60,6 +60,9 @@ const ONYXKEYS = { | |||
/** Contains all the private personal details of the user */ | |||
PRIVATE_PERSONAL_DETAILS: 'private_personalDetails', | |||
|
|||
/** PERSONAL_DETAILS_METADATA is a perf optimization used to hold loading states. For more explanation, see REPORT_METADATA. */ |
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.
Actually I don't like this comment. We don't know that the comment for REPORT_METADATA
won't change or go away. Can we update this comment to be more self-sufficient?
@puneetlath I updated to comment for personalDetailsMetadata. Can you check again? |
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.
Small requested change. Then I think we're good to go.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.4.58-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
Details
There are a lot of subscribers to
personalDetails
key. Thus any changes to theirisLoading
state, which happens regularly, cause massive rerenders. This PR introduces a new Onyx keypersonalDetailsMetadata
dedicated to hold these loading states just like we did withreportMetadata
.Fixed Issues
$ #37986
PROPOSAL: #37986 (comment)
Tests
Offline tests
NA
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Untitled-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-03-22.at.00.57.28-compressed.mov
iOS: Native
Screen.Recording.2024-03-22.at.00.51.43-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-03-22.at.00.54.32-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-22.at.00.48.26-compressed.mov
MacOS: Desktop
Screen.Recording.2024-03-22.at.00.55.41-compressed.mov