16 April 2016

React Amsterdam 2016: Mastering Server-rendered Apps

Speaker: @svenardocom

Book written by de speaker: ReactJS Blueprints

Server-rendered Apps were previously known as isomorphic. Nowadays universal is a more common name, but still has a different meaning to different people. Proposal: shared.

Why server rendering?

  • Page loading is too slow (less sales)
  • Google Cache / Internet Archive
  • User cannot run JS

When JavaScript is slow?

  • User uses old hardware
  • User has a slow connection (mobile)

Demonstrates: reactjsblueprints-shared.herokuapp.com

Solution: ReactDOMServer.renderToString


Demonstrates use of ReactDOMServer.renderToString.

Good:
  • Fast
  • Reuse of frontend code
  • Works when no JS on the frontend
Bad:
  • Complex server files
  • Need to rely on a fetch method before render
  • Relative slow due to lack of optimisations (like caching)


Improved solution: react-dom-stream


Demonstrates use of react-dom-stream.

Out of the box solution: fluxible.io


Mentions: fluxible.io