Re:Show HN: Seen: rendering 1,000,000+ notes in <1s. speed, ...
by billconan on Monday February 10, 2025 @10:49AM
(#43001637)
how do you cache heights without rendering? It seems to be a chicken-egg problem, you need to know the heights to test visibility, but without rendering, you can’t know the heights? Or heights are obtained by invisible rendering in a hidden div?
[ Parent
| on HN ]
Re:Show HN: Seen: rendering 1,000,000+ notes in <1s. speed, ...
by _bittere on Monday February 10, 2025 @11:00AM
(#43001754)
What Seen does is render notes off-screen first, then pack them up in the container. So yes, it does use a hidden div in a way. Some CSS styling does not let you measure the height, which is why Seen uses an off-screen div.
Re:Show HN: Seen: rendering 1,000,000+ notes in <1s. speed, ...
by billconan on Monday February 10, 2025 @11:12AM
(#43001889)
Thank you for the tips. the off-screen div can't set display to none right? otherwise the browser will skip rendering?
Re:Show HN: Seen: rendering 1,000,000+ notes in <1s. speed, ...
by bloomingkales on Monday February 10, 2025 @10:52AM
(#43001664)
Working with fixed heights makes virtualized lists more predictable, easier to implement.
Re:Show HN: Seen: rendering 1,000,000+ notes in <1s. speed, ...
by _bittere on Monday February 10, 2025 @11:01AM
(#43001765)
While that is true, it's not guaranteed that all notes will be of the same height. Some notes might have more content, some might have less; which is why we need all the fancy JavaScript rendering.