News for hackers. Stuff that matters.
Re:High-Performance Infinite List in JavaScript by anonymoushn on Monday June 15, 2015 @03:47AM (#9718028)
Rendering to the DOM only what the user can see unfortunately breaks the browser's "find" feature. I hope that this technique does not become more popular than it already is. That way the rest of the web, other than Facebook's news feed, can continue to be searchable.
Re:High-Performance Infinite List in JavaScript by wereHamster on Monday June 15, 2015 @04:33AM (#9718141)
I wonder how you plan to support the browsers 'find' feature on an infinite list.
Re:High-Performance Infinite List in JavaScript by anonymoushn on Monday June 15, 2015 @07:43AM (#9718718)
For the Facebook news feed, I think it's reasonable to expect to be able to search for text you have scrolled past. Some infinite lists, like the Twitter news feed, or the Facebook page page (I don't know, the feed of all posts of a "Facebook page") work like this. They just leave all the text in the DOM.
Re:High-Performance Infinite List in JavaScript by cultureulterior on Monday June 15, 2015 @06:48AM (#9718562)
This is also a problem on mobile wikipedia. I wonder if a feature for this shouldn't be added to browsers
Re:High-Performance Infinite List in JavaScript by zachrose on Monday June 15, 2015 @10:24AM (#9719437)
Finally, a use for the HTTP SEARCH method?
Re:High-Performance Infinite List in JavaScript by ArthurClemens on Monday June 15, 2015 @07:06AM (#9718608)
This cannot be solved by the infinite list itself, because by definition it needs to throw out unneeded content (otherwise it would just grow in memory). A search field on top of the list could talk to the server and retrieve the filtered elements.
Re:High-Performance Infinite List in JavaScript by anonymoushn on Monday June 15, 2015 @07:46AM (#9718729)
Does this thing actually throw out not-in-view items entirely, and then ask the server for them again when the user scrolls up? That would be surprising. The memory overhead of the out-of-view items, after they are removed from the DOM, is probably pretty small.
Re:High-Performance Infinite List in JavaScript by roeierez on Monday June 15, 2015 @08:06AM (#9718794)
You are right, the pages data that is fetched from the server is kept in memory for future rendering, which usually does not cause memory problems. It is up to the user how to implement search, either by searching in-memory, or change the query and reload the list.
Re:High-Performance Infinite List in JavaScript by M4v3R on Monday June 15, 2015 @04:19AM (#9718108)
This kind of component in my mind is usually used in web applications, which then will also supply own search for you, which should be more robust than your browser find feature.
Re:High-Performance Infinite List in JavaScript by anonymoushn on Monday June 15, 2015 @07:44AM (#9718721)
That would be cool! Right now the Facebook news feed does not provide a search feature.