-
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
Remove hacks in web InvertedFlatList #31288
Conversation
a712c5a
to
68946cc
Compare
I can review & test if C+ is required here |
@situchan it would be great! we need to review it as it's a core feature |
Here's example report with lots of messages: Scroll is still not smooth but much better than current version. At least fixes the super weird bug. Before: (not able to reach the very first message and keep scrolling forever even if I am not scrolling) Screen.Recording.2023-11-14.at.3.07.51.PM.movAfter: Screen.Recording.2023-11-14.at.3.03.34.PM.mov |
On native, very hard to scroll up to see older messages. Is this out of scope for this PR? EDIT: Given that this PR doesn't affect native, should be out of scope ios.mov |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@nkuoch all yours |
@situchan Thanks for the review! Yes it only affects web so that would be out of scope. |
Is the perf problem in dev mode? I usually have to disable prop types checking to get decent perf in dev. (I force the production code path in prop-types package index.js) |
Maybe better in production. But can you still try in dev with the report I shared above? |
@situchan Yea, this report is not as smooth as the simple text messages one I used. I can try profiling it for potential other improvements. |
✋ 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/nkuoch in version: 1.3.99-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.99-0 🚀
|
🚀 Deployed to staging by https://github.com/nkuoch in version: 1.4.0-0 🚀
|
Details
Now that RN web is updated it should fix a bug that was happening causing us to have to use batchSize = 1 on web. After doing some more testing I noticed it was still buggy and tracked it down to the custom
getItemLayout
implementation. I assume this used to be needed to fix bugs inFlatList
but it doesn't seem to be needed anymore.FlatList
already caches cells it measures so it is not needed. After removing the customgetItemLayout
using the default batch size now works fine. This seems to reduce blanks a lot.Here you can observe with FlatList debug=true the virtualization window (yellow part) and the viewport (red box).
Before:
Screen.Recording.2023-11-13.at.22.41.32.mov
Virtualization seems broken and the list jumps around for a while.
After:
Screen.Recording.2023-11-13.at.22.44.51.mov
Virtualization works fine and no more jumping. Also no more blanks with bigger batch size, you can also observe how the viewport never gets close to the end of the render window compared to before where we keep hitting the top.
I also removed the extra component for forwarding ref, we can just use forwardRef directly BaseInvertedFlatList no need for an extra component.
Fixed Issues
$#30895
PROPOSAL: N/A
Tests
Tested by scrolling in various chats.
Use the FlatList debug prop to make sure virtualization is working properly.
Offline 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)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
N/A
Android: mWeb Chrome
iOS: Native
N/A
iOS: mWeb Safari
MacOS: Chrome / Safari
Chrome
Screen.Recording.2023-11-13.at.22.52.21.mov
Safari
Screen.Recording.2023-11-13.at.22.56.39.mov
MacOS: Desktop