Hacker News new | ask | show | jobs
by Lazare 4008 days ago
Meteor's story for backend rendering is the spiderable package, which works as follows: "When a spider requests an HTML snapshot of a page the Meteor server runs the client half of the application inside phantomjs, a headless browser, and returns the full HTML generated by the client code."

That's not really a good solution for all the obvious reasons. (Speed, resource usage, dependencies.) Plus, by that logic every client-side webapp supports being rendered on the server, so that's not even a meteor-specific advantage.

Conversely, React actually does supports true universal (aka isomorphic) apps; you can pre-render the app on the server using node (without needing a headless browser), ship it to the client, and rehydrate it. (Ember is working on shipping the same functionality under the name FastBoot.) Meteor doesn't have anything like that.

I'm sure meteor+react has some advantages over pouchdb+react, but it's not because of server side rendering. :)

(Well, as far as I know. I haven't been paying much attention to Meteor development, so it's possible the story has changed in the last few months. But last I checked, true server-side rendering was easy with react, but not really possible with meteor.)

2 comments

React integration should make implementing good server-side rendering much easier. There is already a discussion and community project around this: https://github.com/meteor/react-packages/issues/15
That's good to hear!
Thanks, I had no idea React was building this out. So in node, you can use the pouchdb API to connect to a full couchdb, allowing you to use the exact same code on the frontend and backend. Going to try this on my next project!