Live data from Hacker News

React: Finally, a great server/client web stack

eflorenzano.com

11–20 of 134 posts

Re: React: Finally, a great server/client web stack

#11
post #7
post #4

Wouldn't this make it even more difficult for search engines to index your pages? Also, I'm not sure we want a full rendering on the server. That will make the page appear to have a longer loading time rather than the other way around. Unless I'm misunderstanding what you're trying to say. It does sound interesting though. I'm looking forward to your follow up posts.

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…

Exactly 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) - it's a really cool library for doing this via server-side rendering of Backbone views.

Re: React: Finally, a great server/client web stack

#12
post #2

I don't want to write a bunch of markup next to my javascript.

JSX isn't markup - it's XML which translates to Reacts internal representation which looks something like: bar --> React.DOM.div({ className: 'foo', children: 'bar' }) You don't have to use it - it's a convenience provided for designers (and arguably developers who have realised that templating provides a false separation of concerns). Om notably ( https://github.com/swannodette/om ) ignores it.

"JSX isn't markup - it's [Extensible Markup Language]"?

Re: React: Finally, a great server/client web stack

#13
post #7
post #4

Wouldn't this make it even more difficult for search engines to index your pages? Also, I'm not sure we want a full rendering on the server. That will make the page appear to have a longer loading time rather than the other way around. Unless I'm misunderstanding what you're trying to say. It does sound interesting though. I'm looking forward to your follow up posts.

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…

People 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.

Re: React: Finally, a great server/client web stack

#14
post #9
post #4

Wouldn't this make it even more difficult for search engines to index your pages? Also, I'm not sure we want a full rendering on the server. That will make the page appear to have a longer loading time rather than the other way around. Unless I'm misunderstanding what you're trying to say. It does sound interesting though. I'm looking forward to your follow up posts.

> Wouldn't this make it even more difficult for search engines to index your pages? If the string rendering is your initial page[0], why would it be difficult for crawlers do index pages? > Also, I'm not sure we want a full rendering on the server. That will make the page appear to have a longer loading time Servers tend to be beefy and have caches up the ass. Serving a pre-rendered "home" has been found time and aga…

Thanks for the useful follow up! I'm still learning a lot about Frontend Development and this definitely helps me out.

Re: React: Finally, a great server/client web stack

#18
> You can choose to use this, but after getting over my initial distaste for it ("Ack! Who got markup in my code!"), I could never go back to not using it.

Or you could just use HTMLbars/Handlebars. Seems like "JSX" is just a more complicated version of a Mustache-esque logic-less template.

Re: React: Finally, a great server/client web stack

#20

> You can choose to use this, but after getting over my initial distaste for it ("Ack! Who got markup in my code!"), I could never go back to not using it. Or you could just use HTMLbars/Handlebars. Seems like "JSX" is just a more complicated version of a Mustache-esque logic-less template.

Most of React's novelty, I think, comes from the Virtual DOM. Your view spits out a DOM tree using the React.DOM.* objects. The JSX allows you generate the appropriate calls to those constructors by writing something that more resembles HTML. You can't just use Handlebars, etc.
Post reply on HN