Post

Legend List 0.1 is ready to test! This is an early experiment to see how well it works in real apps so please post issues and/or PRs 🙏. It’s only ~600 lines so it should be easy to understand and tweak. ✨ 100% JS ✨ Fast ✨ Dynamic sizing ✨ Works in both new and old arch

15 reposts105 likes

It surprisingly seems to work well in old arch too, and still seems faster than other lists 😀. Needs a lot more testing and benchmarking though... There's still more optimizations to be done, but I'm very curious to see how it works for you!

On old arch? I thought you achieved perf via sync onLayout? Have you played with it on Web at all? Happy to drop it into @guild.host & can pair on that too if you need a guinea pig 😄

Perf is more from legend state's targeted small renders 😃 I tested web only briefly. It seems to work at least, but not sure how perf compares to others. We may be able to do some web specific optimizations with things like ResizeObserver. I'd love to try it in guild!

would it be possible to do a version that doesn’t require the -state dependency? it seems like it should be possible to write the same windowing logic with imperative re-renders that don’t introduce an observable abstraction in the middle. not sure if you feel super strongly about it!

it implies buying into the -state model which feels dicey to me (so far i’ve only had to remove these kinds of observable bindings from codebases i worked in — and people have been creating them since 2014). plain react components tend to outlive these abstractions & work with all react features

i might be missing something though! curious if you consider this part essential to it and how exactly that manifests — couldn’t quite understand it from reading

Yes, absolutely. This was the easiest way for me to prototype and experiment with minimizing renders and get something out asap, but I’m planning to change it to do it imperatively so I can remove the dependency. I’ll try to release an update in the next few days.

I haven't tested it, but could be an interesting comparison! Looks like Skia List would require big architecture changes to render items with skia instead of regular RN components? But I could see how it could potentially be faster to fully control all rendering...

There's an example app in the repo which is what I recorded for that video. I'll work on making a good benchmark. From what I can tell it seems faster though.