Live data from Hacker News

React Server

react-server.io

141–143 of 143 posts

Re: React Server

#141

Earlier quoted context omitted.

My heuristic is: 1. Google for a blog comparing them, and eliminate any candidates with major red flags 2. Go with the one that has the most stars on it's github repo.

So if there are no blog posts (1) then we all do 2 and then we suffer from first mover lock in.

>then we all do 2 and then we suffer from first mover lock in.

I don't find JS has a "first mover lock-in" problem. If anything, it has the opposite...

Re: React Server

#142

Earlier quoted context omitted.

I have not looked at how this framework does it, but I have built a nodejs server that does similar things myself. Some advantages: - The server can render the full page in html for the client, which means the website is viewable even without js (or before js has loaded, for example on slow network) - The server can preload all data the client needs. The webapp might need to fetch data from 3 API endpoints. Having a…

I appreciate your answer, which seems to apply to the general concept of server rendering. But Django can also do all what you mention. My question was: what can React-Server do that Django could not? I hope this clarifies my original interrogation.

The difference is that a "react server" can actually render the dynamic react content. I don't know of a way to do this in django, unless you are able to run javascript code somehow. If you do this, you are kind of making your django app a "react server" though, since it renders all of your react components.

What usually happens in a react app is that the server delivers static content (html, js, css). When everything is loaded, react starts working on the browser and renders / fetches data.

If the server that delivers the html doesn't just deliver a static page, but actually fetches data and renders it first, the browser can instantly display the data and react is smart enough to know that it doesn't even need to do a new render, because the components are already rendered to html.

Re: React Server

#143

Earlier quoted context omitted.

Another universal http option is : https://github.com/matthew-andrews/isomorphic-fetch

That's the opposite of what the question is asking for. They want to call fetch('/api/foo/bar') but on the client it does an HTTP call while on the server it recognizes that /api* is on the local system and therefore invoke that local route instead of doing an unnecessary http call. That's what I'm apparently failing to describe how to accomplish :).

Oh i see, I actually accomplished that a while back by monkey patching superagent to use Hapi.js, and inject.
Post reply on HN