
Jay Meistrich
@jmeistrich • 5,952 subscribers
@LegendAppHQ @bravely_io @margelo_com. Been a digital nomad for 14 years. Talk to me about Legend State, Legend List, web perf, productivity, and traveling.
Shorts
Experimenting with Legend List in the other app, which uses FlatList and performs surprisingly well already. I only really see it get slow after loading a lot of pages and then scrolling very quickly. I learned a lot from this! - Recycling looks great! I’m actually surprised it’s so much faster! And it doesn’t seem to do anything weird to the state in posts. - FlatList is pre-rendering 9 pages worth of posts so it scrolls smoothly through those, then it falls apart and blanks. Watching its behavior in the dev tools gave me some ideas to pre-render more intelligently. - Legend List seems slightly better than FlatList without recycling, but I think we can still get it to *much* better. When scrolling quickly through expensive list items, by the time they finish rendering they’re already off screen. So I think the best solution is to try to do better at predicting what *will* be on screen when scrolling quickly. - FlatList always keeps the first 4 items rendered at the top, so scrolling to the top looks great. We could consider doing that? Or maybe the prediction algorithm could have a special case for when it looks like a scroll to top. - The big difference in perf is that FlatList renders an array of all items in view, while Legend List renders absolutely positioned containers. So when adding an item, FL re-renders the whole array and LL updates one container. And with static positioning in FL a size change triggers a layout in the ScrollView, while with absolute positioning in LL it just updates a few style props on containers. - Legend List is not quite ready to drop in. Some event handlers (onScroll, onEndReached) appear to behave differently so I need to debug and fix those first, and will do more testing in Bluesky to find any other bugs. - It’s looking promising! 🎉
23,667 görüntüleme