Isomorphic Development with JavaScript
Creating universal web applications
Elyse Kolker Gordon
  • MEAP began November 2016
  • Publication in Fall 2017 (estimated)
  • ISBN 9781617294396
  • 250 pages (estimated)
  • printed in black & white

You used to have two options for web app architecture: backend server-rendered in response to requests, or frontend browser-rendered, single page applications. Now you have a new choice: isomorphic apps, which let you take advantage of the best of both worlds. They render the HTML page on the server, deliver rendered markup to the browser, and behave like a single page application in the browser. You get server rendering benefits such as SEO-compatible stacks, fast page loads, improved performance, and the ability to take advantage of caching. And you get single page application advantages including no server interaction after the initial load, common UX patterns like modals, and fast response to user interactions. Node and React make isomorphic apps practical and simpler to build. Now you can write code that runs on the server and the client as well as effectively executing the handoff from the server to the client.

Isomorphic Development with JavaScript teaches web developers to build isomorphic web applications using JavaScript, NodeJS, and React. You'll begin by learning the difference between isomorphic, single page, and server rendered web applications as well as the advantages and challenges of isomorphic web applications. Then you'll get hands-on and build an isomorphic web application. You'll learn how to render views, fetch data with Redux, handle requests on the server, and serialize and deserialize data. This book covers isomorphic app basics, like React, Redux and Webpack. The last part shows you how to apply isomorphic architecture with frameworks like Angular 2 and Ember. By the end, you'll be able to build a high performance content site that will support your users' needs and your SEO goals.

Table of Contents detailed table of contents

Part 1: First steps

1. Introduction to Isomorphic Web Application Architecture

1.1. Isomorphic Web App Overview

1.1.1. How it works

1.1.2. Building our stack

1.2. Architecture Overview

1.2.1. Application Flow

1.2.2. Handling the server-side request

1.2.3. Rendering in the Browser

1.3. Advantages of Isomorphic App Architecture

1.3.1. SEO Benefits

1.3.2. Performance Benefits

1.3.3. No JavaScript? No problem!

1.3.4. Maintenance and developer benefits

1.3.5. Challenges and Tradeoffs

1.4. Building the view with React

1.4.1. Understanding the Virtual DOM

1.5. Business Logic and Model: Redux

1.5.1. One Way Data Flow

1.6. Building the app: webpack

1.7. Summary

2. A Sample Isomorphic App

2.1. What we'll build in this chapter: Recipes Example App

2.2. Tools

2.2.1. Environment Setup and Package Install

2.2.2. Run the server

2.2.3. Building the code for the browser with webpack

2.3. The view

2.3.1. React & Components

2.3.2. Using JSX

2.3.3. App Wrapper Component

2.3.4. Building Child Components

2.3.5. HTML Container

2.4. App State: Redux

2.4.1. Actions: Fetching the recipes data

2.4.2. React and Redux

2.5. Server Rendering

2.5.1. Setting up a basic route on the server with middleware

2.5.2. Fetching the data

2.5.3. Rendering the view & serializing/injecting the data

2.6. Browser Rendering

2.6.1. Deserializing the data& hydrating the DOM

2.7. Summary

Part 2: Isomorphic App Basics

3. React Overview

3.1. Overview of React

3.1.1. Basic rendering

3.2. Virtual DOM

3.3. Todo App Overview

3.4. Your First React Component

3.4.1. JSX Basics

3.4.2. Building a reusable component

3.4.3. Using Props

3.4.4. Functional components

3.4.5. Conditionals and Looping

3.5. Interactive components: React state

3.5.1. Using Classes

3.5.2. React State

3.6. Summary

4. Applying React

4.1. React-Router

4.1.1. Setting up an app with React Router

4.1.2. Adding Child Routes

4.1.4. The router lifecycle

4.2. Component Lifecycle

4.2.1. Hooking into mounting and updating to detect user status

4.2.2. Adding Timers

4.3. Component Patterns

4.3.1. Higher-Order Components

4.3.2. Component Types: Presentation and Container

4.4. Summary

5. Tools: Webpack and Babel

5.1. Webpack Overview

5.1.1. Getting started with webpack cli

5.2. Babel overview

5.2.1. Getting started with Babel

5.2.2. The Babel CLI

5.3. The App Code

5.4. Webpack Config with Loaders

5.4.1. Configure the Babel loader

5.4.2. Configuring the CSS loader

5.5. Bundling for Dev and Production

5.5.1. Webpack plugins

5.5.2. Creating Globals

5.5.3. Sourcemaps

5.5.4. Preparing the build for production

5.6. Summary

6. Redux

6.1. Introduction to Redux

6.1.1. Getting Started with Notifications Example App

6.1.2. Redux Overview

6.2. Redux and Flux: Architecture Patterns

6.3. Managing Application State

6.3.1. Reducers: Updating the State

6.3.2. Actions: Triggering State Updates

6.4. Applying Middleware to Redux

6.4.1. Middleware basics: debugging

6.4.2. Handling Asynchronous Actions

6.5. Using Redux with React components

6.5.1. Wrapping your app with Provider

6.5.2. Subscribing to the store from React

6.6. Summary

7. Building the Server

8. Isomorphic View Rendering

9. Testing isomorphic apps

10. Handling Differences in Environments

11. Performance Optimizations

Part 3: Applying Isomorphic Architecture with Other Tools

12. Angular 2.0

13. Ember 2

14. More about Isomorphic Web Apps

What's inside

  • Rendering pages with React
  • Handling user sessions on both server and the browser
  • Using Webpack and Babel for a modern JavaScript workflow
  • Combining server rendered and SPA architecture
  • Handling real-word caching and performance
  • Putting together JavaScript libraries: Redux and React Router
  • Debugging and testing in isomorphic environments

About the reader

This book is for mid-level web developers with JavaScript experience.

About the author

Elyse Kolker Gordon has been building web applications for five years and is a Technical Lead at Vevo, where she solves challenges with isomorphic apps every day. She writes technical articles and speaks about JavaScript at meetups and conferences. In her free time, she plays the drums and travels.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $39.99 pBook + eBook
MEAP eBook $31.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks