-
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
[No QA] [Performance] Approximate the ideal number of reports to render on first render #4371
Conversation
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.
Looks good. Just had a few comments.
<BaseInvertedFlatList | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
ref={ref} | ||
initialNumToRender={20} | ||
initialNumToRender={props.initialNumToRender} |
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.
Probably we can just remove this since each platform version is getting the prop passed via ...props
same for the android, web, versions.
I'm not sure it should be a required prop as we can still fallback to the default value in cases where we are not getting more specific. Other things may use the inverted FlatList
without this optimization.
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 for the catch! This really is unnecessary. Changed the code for all platforms.
* Calculates the ideal number of reports to render in the first render, based on the screen height and on | ||
* the height of the smallest report possible. |
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.
* Calculates the ideal number of reports to render in the first render, based on the screen height and on | |
* the height of the smallest report possible. | |
* Calculates the ideal number of report actions to render in the first render, based on the screen height and on | |
* the height of the smallest report action possible. |
* @return {Number} | ||
*/ | ||
calculateInitialNumToRender() { | ||
const smallestReport = styles.chatItem.paddingTop + styles.chatItem.paddingBottom |
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.
name minimumReportActionHeight
?
// Remove clipped subviews helps prevent avatars and attachments from eating up excess memory on Android. When | ||
// we run out of memory images stop appearing without any warning. | ||
// eslint-disable-next-line react/jsx-props-no-multi-spaces | ||
shouldRemoveClippedSubviews |
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.
I don't think we want this here. Just removing the initialNumToRender={20}
. IIRC removing the clipped sub views has unexpected effects on iOS (which is why there are separate files for iOS and Android).
<BaseInvertedFlatList | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
ref={ref} | ||
initialNumToRender={20} | ||
initialNumToRender={props.initialNumToRender} |
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 can revert all these changes in this file I think?
Sorry @rdjuric just dawned on me that you maybe were not ready for another review 😓 |
No worries @marcaaron, I had forgot about Android 🥲 Should be ready for review now! |
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.
This is working great for me thanks!
✋ 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 in version: 1.0.82-8🚀
|
@rdjuric Hello! Any QA tests needed for this one? |
I don't think there are any specific steps besides regressions around navigating to a chat |
🚀 Deployed to production by @francoisl in version: 1.0.83-1 🚀
|
Details
Calculated the ideal number of reports to render in the first render based on the screen height and the minimum height of a report
Fixed Issues
$ #4258
Tests
QA Steps
Tested On
Screenshots
Web
web.mov
Mobile Web
mweb.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
Android.mp4