4 ms·
Various companies (in one famous case, Twitter) have found that server rendering beats client rendering for initial rendering speed. React is designed so that i
by spicyj 13y ago
Various companies (in one famous case, Twitter) have found that server rendering beats client rendering for initial rendering speed. React is designed so that if you care about server rendering, you can have the best of both worlds -- using Node you can render a component to HTML on the server, then pick it up the prepopulated DOM in client-side JS once your page loads. Since the server sends down plain HTML, search engines are happy too.
- shebson 13y agoExactly this. Serving fully formed html and picking it up by a client-side framework is great for crawlers and also great for performance. In addition to React, you should check out Rendr (https://github.com/airbnb/rendr https://github.com/airbnb/rendr) - it's a really cool library for doing this via server-side rendering of Backbone views.
- woah 13y agoTried this, you have to turn your entire Node deal into Backbone. Yuck.
- sahat 13y agoDownloaded rendr, fired up the first example simple_00, opening links - Users and Repos, was painfully slow. With server MVC frameworks at least there is an indication by the browser that page you clicked on is currently loading. With client-side MVC frameworks pages usually load instantly and data arrives shortly after. In rendr, maybe it's just a terrible example, you wait 2+ seconds for a page to load and there is zero indication that page is loading.
- oinksoft 13y agoPeople have used goog.ui.Component with Soy Templates to do this for a while. You call call goog.soy stuff in your base component's createDom() so that decorateInternal() is always dealing with the same tree, whether it was rendered on the server or in the browser.