-
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
[Perf] ReportScreen rendering optimisation part 2 #30354
[Perf] ReportScreen rendering optimisation part 2 #30354
Conversation
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/components/UserDetailsTooltip/BaseUserDetailsTooltip.web.js
Outdated
Show resolved
Hide resolved
@eVoloshchak All the remaining issues were fixed 👍 |
@kacper-mikolajczak, one last thing, the screen recording for Android: Native is missing |
Thanks @eVoloshchak for pointing that out! Recording provided ✅ |
Reviewer Checklist
Screenshots/VideosAndroid: Nativescreen-20231030-182739.mp4Android: mWeb Chromescreen-20231030-183656.mp4iOS: NativeScreen.Recording.2023-10-30.at.18.19.47.moviOS: mWeb SafariScreen.Recording.2023-10-30.at.18.22.12.movMacOS: Chrome / SafariScreen.Recording.2023-10-30.at.18.18.16.movMacOS: DesktopScreen.Recording.2023-10-30.at.18.38.55.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.
LGTM
There's a test failing, looks like it's not related to this PR
Hi @eVoloshchak 👋 I've resolved conflicts and tests! If you could let me knwo if such solution with a test is aligned with our testing best practices. Thanks! |
@kacper-mikolajczak, I don't think that's the correct way
|
@@ -34,8 +33,9 @@ export default function <TProps extends ComponentProps, TRef>( | |||
WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>, | |||
): ComponentType<Omit<Omit<TProps, keyof HOCProps> & RefAttributes<TRef>, keyof OnyxProps>> { | |||
function WithCurrentUserPersonalDetails(props: Omit<TProps, keyof HOCProps>, ref: ForwardedRef<TRef>) { | |||
const personalDetails = usePersonalDetails() ?? CONST.EMPTY_OBJECT; |
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 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.
@eVoloshchak For TS files I think we should adhere to these nullish-coalescing rules 👍
Here is an example that is directly line below code you've mentioned:
const personalDetails = usePersonalDetails() ?? CONST.EMPTY_OBJECT;
const accountID = props.session?.accountID ?? 0;
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.
we shouldn't use async/await, use the native Promise instead
Answered by Jack already.
we're calling waitForBatchedUpdatesWithAct twice, could you explain why is that needed and how does this resolve the issue? Doesn't seem right.
It was mostly trial and error process, but what I found out is that there is a race condition in the test that did not make the tests in any case deterministic (sometimes on test failed, another time two of them failed). In this case waitForBatchedUpdatesWithAct
helps by waiting for next "tick". Jokingly, we could say that the code now is too fast :D
was this test broken by this particular PR? If it's unrelated to this PR, we should fix it in a separate PR to avoid confusion in the future
It was caused by this PR
Hope that answers your concerns 👍
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
We actually recently started allowing the use of async await for tests since it just makes it much cleaner |
Thanks for reviewing guys! 🙇 |
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.3.96-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
Details
Fixed Issues
$ #29987
PROPOSAL: #29987
Tests
Offline tests
N/A
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.mov
Android: mWeb Chrome
mandroid.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
mios.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4