-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
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 |
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
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
OptionRowLHNData
component by changing not optimalwithReportCommentDrafts
HOC which in this case subscribes to changes of all reports, towithOnyx -> comment
that will only listen to singularREPORT_DRAFT_COMMENT
change. In the result only oneOptionRowLHNData
component 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
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