-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Optimized listening to hasDraft property changes #30031
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
Optimized listening to hasDraft property changes #30031
Conversation
6393cd5 to
0fbc48e
Compare
|
Adding @robertKozik as a C+ as you have reviewed the other PR from @hurali97 @hurali97 would you be able to review this one too? @robertKozik Could you please priorotize this checklist? |
|
Sure on it 👀 |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid.-.web.movMobile Web - Safariios.-.web.movDesktopdesktop.moviOSios.-.android.-.nativee.copy.movAndroidios.-.android.-.nativee.copy.mov |
robertKozik
left a comment
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.
Tests well 🚀 I don't see any problems with drafts
mountiny
left a comment
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.
Thanks everyone!
|
✋ 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/mountiny in version: 1.3.90-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.90-2 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀
|
| comment: { | ||
| key: ({reportID}) => `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, | ||
| }, |
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.
@adhorodyski this is already on main branch, and I think you can use that for part that Rory has mentioned #30242 (comment)
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.
thank you so much for referencing it, will do!
Details
I've optimized
OptionRowLHNDatacomponent by changing not optimalwithReportCommentDraftsHOC which in this case subscribes to changes of all reports, towithOnyx -> commentthat will only listen to singularREPORT_DRAFT_COMMENTchange. In the result only oneOptionRowLHNDatacomponent will need to be rendered (rather than all of them even if only one REPORT_DRAFT_COMMENT changes).This is alternate approach to other open PR: #28469 but if my benchmarking are correct the results are much better. Possibly we can still use some of suggested improvements in the other PR.
Test case - change from empty report message input to single letter.
Profiler on x6 CPU throttling for @hurali97 changes (900ms for single commit + tense timeline):


Profiler on x6 CPU throttling for my changes (130ms for single commit + more relaxed timeline):


Fixed Issues
$ #28359
$ Proposal: #28359 (comment)
Tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android-app.mov
Android: mWeb Chrome
android-browser.mov
iOS: Native
ios-app.mov
iOS: mWeb Safari
ios-browser.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop2.mov