Live data from Hacker News

React: Finally, a great server/client web stack

eflorenzano.com

31–40 of 134 posts

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

#31
post #11
post #7

Earlier quoted context omitted.

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.

Tried this, you have to turn your entire Node deal into Backbone. Yuck.

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

#32
I come from an Ember.js background and its router / nested layout management is the best I have used. I like react, and have been diving into OM as well in my free time, but I'm not sure of the best way to approach routing / page transitions.

When I start an app, I do not think from the bottom up, which is the react way. I want to start with the login page and redirects, or get the major page transitions down. I'll be interested in seeing how you approach that.

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

#33

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

It's not exactly novel. Opa (http://opalang.org) has been doing this for a few years...

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

#34

Am I the only one that kind of thinks most websites should just be static pages? Like, I get pretty irritated when I go to read a blog post on Medium or wherever and it loads a header and a blank page, and then loads a bunch of javascript (mostly tracking and analytics frameworks), and finally goes out and gets the actual content. And then if I scroll down, it has to load some more garbage from Disqus or something. P…

To a large degree I agree with your sentiment. I have never had to manage a site with thousands of pages but I would assume even then any template changes would not be that hard to render and then upload to a CDN.

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

#36

I come from an Ember.js background and its router / nested layout management is the best I have used. I like react, and have been diving into OM as well in my free time, but I'm not sure of the best way to approach routing / page transitions. When I start an app, I do not think from the bottom up, which is the react way. I want to start with the login page and redirects, or get the major page transitions down. I'll b…

I don't think react speaks to that, nor does it care to speak to that. It only addresses the view component of the app.

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

#37

Am I the only one that kind of thinks most websites should just be static pages? Like, I get pretty irritated when I go to read a blog post on Medium or wherever and it loads a header and a blank page, and then loads a bunch of javascript (mostly tracking and analytics frameworks), and finally goes out and gets the actual content. And then if I scroll down, it has to load some more garbage from Disqus or something. P…

Yes, Instagram is super slow because of all its useless Javascript. And it took Twitter years of optimization to make it about as fast as static HTML.

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

#38

Am I the only one that kind of thinks most websites should just be static pages? Like, I get pretty irritated when I go to read a blog post on Medium or wherever and it loads a header and a blank page, and then loads a bunch of javascript (mostly tracking and analytics frameworks), and finally goes out and gets the actual content. And then if I scroll down, it has to load some more garbage from Disqus or something. P…

I mind if it's not fast. I think everyone does. Doesn't matter if it's just or not. If it's not fast, I'll be irritated.

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

#39
post #12

Earlier quoted context omitted.

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]"?

Sorry, to be clearer, I meant it isn't HTML.

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

#40

Am I the only one that kind of thinks most websites should just be static pages? Like, I get pretty irritated when I go to read a blog post on Medium or wherever and it loads a header and a blank page, and then loads a bunch of javascript (mostly tracking and analytics frameworks), and finally goes out and gets the actual content. And then if I scroll down, it has to load some more garbage from Disqus or something. P…

You're not the only one.
Post reply on HN