[perf] Migrate LHNOptionList to FlashList#31711
Conversation
|
@Julesssss I'm opening a new PR after yesterdays revert. Could you please build ad-hoc and verify if the issue with skeleton doesn't exist anymore? |
|
I am interested in reviewing this if @getusha isn't able to install newDot dev on physical iPhone which is mandatory to test this PR. |
| shouldDisableFocusOptions={isSmallScreenWidth} | ||
| optionMode={viewMode} | ||
| /> | ||
| {isLoading && optionListItems.length === 0 && ( |
There was a problem hiding this comment.
I see that optionListItems.length === 0 && is fixing skeleton issue.
But were you able to find the root cause why this didn't happen on simulator? More importantly, not happened on other platforms? And more strange thing is that no issue on FlatList.
There was a problem hiding this comment.
I really tried to find the root cause but i wasn't able to do it. I think the reason behind it might be the fact that when you turn off the internet connection on MacOS, the simulator still indicates that the network connection on the device is on (even if the message says you are offline). However that's just my guess, not having this issuse on other platforms is even stranger.
My general understanding of this problem is: when isLoading was true and optionListItems was empty, the FlatList had 0px height and view was filled with skeleton. So when items were already there, and FlatList had a proper height, the Skeleton component was still rendered, but the list already covered 100% of the screen. After migrating to FlashList, the component couldn't have 0px height at any phase of rendering because its using recycling, which has an alghoritm that works only with a valid size (>=2px). With that in mind, the skeleton was displayed on top of the list, using absolute positioning. So each time isLoading was true, it was displayed on top of the list.
There was a problem hiding this comment.
I went through this problem together with @TMisiukiewicz and the reasoning makes sense to me. Flatlist behaved differently and 0px resulted with a 'ok UI state', whereas Flashlist just uncovered it as a bug.
|
I think we are safe to ignore the failing Reassure performance tests, as |
|
AdHoc build in progress |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Yeah, that sounds good to me, i don't have physical iOS device ATM so go ahead. |
|
Thanks. reviewing now |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.mp4Android: mWeb Chromemchrome.mp4iOS: Nativeios.MP4iOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
Reassure test failed. I'm retrying it |
@luacmartins it's expected |
|
@luacmartins FYI this is to establish a new baseline for the render count on |
|
Ah thanks for clarifying! Gonna merge with failing tests then. |
|
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ 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/luacmartins in version: 1.4.3-0 🚀
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.3-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.3-11 🚀
|
| maxToRenderPerBatch={5} | ||
| windowSize={5} | ||
| estimatedItemSize={optionMode === CONST.OPTION_MODE.COMPACT ? variables.optionRowHeightCompact : variables.optionRowHeight} | ||
| extraData={[currentReportID]} |
There was a problem hiding this comment.
This is missing other data, e.g. preferredLocale which caused the list not to re-render on language change
Details
Migrating
LHNOptionListtoFlashListone more time, as previous PR #31052 introduced a regression discoverable only on devices. PR was reverted in #31642Fixed Issues
$ #30910
$ #31610
$ #31581
PROPOSAL:
Tests
Offline 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 */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.mov
Android: mWeb Chrome
ANDROID_WEB.mov
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS_WEB.mp4
MacOS: Chrome / Safari
WEB.mov
MacOS: Desktop
DESKTOP.mov