3 ms·
That's what Netflix got from using Reactjs. Facebook people search on mobile page version uses React too. It worked very well as a traditional AJAX search. Then
by frik 11y ago
That's what Netflix got from using Reactjs. Facebook people search on mobile page version uses React too. It worked very well as a traditional AJAX search. Then they changed to to use React and now it takes a second or two to initialize and load the page (even it is in cache). And the search textbox doesn't feel like a native textbox, it's very laggy and shows inputs way too many milliseconds later. And on top of this the search result adds another delay. So searching for "Joe doe" means a laggy delay for every character as you try to type it in. Why? It tries to guess the person after every keyboard change event. Something that worked fine with the original AJAX version (Facebook optimized that version a lot an blogged about it / wrote a paper). Sadly with the React rewrite the forgot to read their own blog and probably React is an overkill for such a type of page and consumes to much CPU cycles on mobile devices. If you have to refresh 90% of the search results page anyway, why use React? Building and diffing a VirtualDOM isn't cheap (and ShadowDOM isn't supported), and it would be a lot faster to simply overwrite the DIV with innerHTML and traditional vanilla Javascript AJAX. Use the right tool, don't use a hammer for everything.
- coldtea 11y ago>That's what Netflix got from using Reactjs. ...for using Reactjs badly. IFTFW. First, they could have had the item as a search box from the start, no need to make a label that when clicked turns into a search box. >* If you have to refresh 90% of the search results page anyway, why use React? Building and diffing a VirtualDOM isn't cheap* Actually it can be as cheap as directly changing the DOM with JS. And diffing can be just a single op e.g. when using an immutable data structure for their always changing part of the data. It's just a change done crudely, not even non-optimized, because it doesn't need that much optimization anyway.