Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Isomorphic Web Apps with React

Building Isomorphic Web Apps with React

Is an isomorphic web app right for you? React and the Virtual DOM make it possible to write code once that will run on the server and the browser. This has many potential benefits from SEO to performance to code maintainability. We will discuss the benefits and challenges present in building an isomorphic web application. Some of the challenges we will discuss will include how to handle asynchronous data with React's render cycle, synchronizing data and state between the server and browser and knowing when to write browser or server specific code. We will cover how to use React with Node and webpack to solve these problems.

Elyse Kolker Gordon

September 25, 2015
Tweet

More Decks by Elyse Kolker Gordon

Other Decks in Programming

Transcript

  1. • Single Page Application (SPA) • React (vs .14) •

    React Router (vs 1.0) • Browser Sync to serve/update the file In the Browser
  2. Folder structure - server - app.js (server entry) - routes.js

    - client - main.js (client entry) - routes.js - shared - routes.js - components - app.jsx - home.jsx
  3. Webpack lets you: • Build for each environment • Include

    environment specific code • Chunk code into smaller downloadable files
  4. Gulp + Browser Sync • Replaced webpack dev server •

    Gulp makes it easy to run browser sync
  5. Pros of building an isomorphic App • Serve crawlers and

    bots • Initial load times are very fast • Code reuse between server and client
  6. Cons of building an isomorphic app • Server render performance

    • Multiple environments = complications
  7. The future of isomorphic • Relay • Virtual dom starting

    to appear more places - Ember • Virtual DOM optimizations • Meteor works with react
  8. Recommendations • React • React Router • Webpack • Gulp

    & Browser Sync • Entry points not abstraction • Relay