3 ms·
This scrolling trickery is absolutely doable in html/js. A friend of mine wrote an infinite-scroll table that will handily display tables of tens of thousands o
by asolove 14y ago
This scrolling trickery is absolutely doable in html/js. A friend of mine wrote an infinite-scroll table that will handily display tables of tens of thousands of rows. It carefully only requests the right data from the server (with lots of cacheing and prefetching, of course) and only ever instantiates 2*n (n being the number of rows visible) dom elements and just pops them in and out of view.
I think what you are saying that is correct is: UI developers as a general rule do not go to this level of detail, either on web or on native.
But on native, the frameworks have already done these kinds of optimizations for us. I think that's just a matter of the SDKs having more manpower and motivation for making it easy to build apps on their platform.
I actually have a semi-related project right now, so I'm going to go write a Backbone collection smart-scroll plugin that deals with the smart data loading and clever element rejiggering. Thanks for the suggestion.
- asolove 14y agoSo as one data point in this comparison, I have a pretty good version of a scrolling grid plugin that swaps in and out existing row dom elements as needed and loads that data dynamically from a backend. It's not totally done and not ready to open-source, but it's generic enough that another day or so of work will make it so. HN records that my original comment was posted 21 hours ago, and I assure you I spent a good deal of time sleeping and eating inbetween, so this is definitely doable in html/js. Now, as to the bigger point, that most developers don't know that they should do this to get performance, or that we shouldn't have to write it ourselves, those still stand.