r/javascript • u/Suitable_Language_37 • Jul 26 '26
I spent over a year building a framework-agnostic virtual scrolling engine with an index-based architecture. I’d love feedback from developers who’ve built virtualization systems.
https://github.com/ceriousdevtech/cerious-scroll
29
Upvotes
8
u/Suitable_Language_37 Jul 27 '26
One thing I find discouraging about today’s open source community is how quickly technical discussions get replaced with AI accusations.
I have no problem saying I use AI. I use it to clean up code, improve documentation, and occasionally help explain complicated edge cases. It’s a productivity tool, just like a debugger, profiler, or static analyzer.
What I don’t understand is why we’ve reached a point where well-documented code is treated as evidence that the engineering itself wasn’t done by the author.
There is a significant difference between using AI to polish and explain your work, and asking AI to invent the architecture or solve the core engineering problem.
If someone believes the algorithm is wrong, the implementation is inefficient, or the architecture has flaws, I’d genuinely appreciate that feedback.
But reducing months or years of engineering to “looks like AI” without discussing the actual implementation discourages people from sharing their work. It shifts the conversation away from ideas and toward trying to prove authorship.
I’d much rather have someone tell me my virtualization algorithm is flawed than that my comments are too well documented.
13
u/aequasi08 Jul 27 '26
Little disingenuous to say you’ve been working on it for a year, when you’ve only committed 15 different days…
Just an attempt to hide your AI usage?
2
u/Is_Kub Jul 26 '26
Have you looked into Pierre code tree and diff? They developed some pretty advanced virtualization that’s suppose to handle insane amount of data with good performance.
Might be slightly different from your project
2
u/Plus-Weakness-2624 the webhead Jul 28 '26
Out of all JS libs the crawl out from the mudpits, virtual scrollers are the ones I like to see the most; like brother it's 20 fking 26 and we still don't have a decent solution for this sh!t
1
u/Suitable_Language_37 Jul 26 '26
Virtual scrolling seems like a solved problem until you actually try to build one.
About a year ago, I started writing my own virtualization engine because I wanted to understand how these systems actually work under the hood. I figured it would be a fun side project that would take a couple of months.
I was very wrong.
The farther I got into it, the more I realized that rendering fewer DOM elements is actually one of the easier parts of the problem.
Some of the challenges that consumed the most time were:
One of the biggest lessons was learning to stop fighting the browser.
Early on, I experimented with architectures that relied heavily on transforms and continuously repositioning content. While they worked, they also introduced edge cases involving text selection, accessibility, browser behavior, and scroll physics.
Eventually, I shifted toward an architecture that lets the browser do what it’s already exceptionally good at: scrolling.
Instead of trying to fake scrolling, the browser owns the scroll position, while the engine focuses solely on deciding which items should exist in the DOM.
The biggest architectural breakthrough came when I stopped thinking in terms of pixels and started thinking in terms of an index plus an offset.
Rather than trying to continuously map every scroll position to every item’s height, the viewport is anchored by the item currently at the top of the viewport and the pixel offset into that item. Once that anchor is known, everything else becomes relative to it.
That one change simplified a surprising number of problems:
The result is an engine that spends very little time touching the DOM. Most of the work is maintaining the viewport anchor and updating only the elements that actually changed, allowing the browser to handle scrolling exactly as it was designed to.
One of my primary goals became making virtualization invisible. If users can’t tell they’re interacting with a virtualized list, then the engine is doing its job.
I would love feedback and any ideas that could make this project better.
Github: https://github.com/ceriousdevtech/cerious-scroll
Demo: https://ceriousdevtech.github.io/cerious-scroll
1
u/alystair Jul 27 '26
Will need to review this soon, been working on my own web framework part time and this was one of the major "let someone else handle it" wish list items :)