Slide 1

Slide 1 text

High Performance Isomorphic Web Apps Ashmeet Sidhu | @ashsidhu

Slide 2

Slide 2 text

Outline • Comparison of server and client side applications • Introduction to Isomorphism • Key features of isomorphic apps • Available Open Source libraries and tooling • Real time implementation

Slide 3

Slide 3 text

Server side apps Persistence Routing layer Rendering layer Application logic DOM manipulation User Interface Client Server

Slide 4

Slide 4 text

Execute scripts Download assets Server side apps Download response Server response Client sees content <- Server Client ->

Slide 5

Slide 5 text

Client side apps Persistence Routing layer Rendering layer Application logic DOM manipulation User Interface Client Server

Slide 6

Slide 6 text

Execute scripts Download assets Client side apps Download response Server response Client sees content <- Server Client -> Fetch Data Render template

Slide 7

Slide 7 text

Server vs Client Initial load SEO User Experience Initial load SEO User Experience

Slide 8

Slide 8 text

Iso-What? Isomorphic code is simply code with 
 environment agnostic abstractions What you use: request(url) What request(url) does: 
 XMLHttpRequest on client 
 http.request on server

Slide 9

Slide 9 text

Isomorphism Abstract all the things!! Isomorphic Code Server Client

Slide 10

Slide 10 text

render() React.renderToString() React.render() Rendering abstraction abstraction Server Client

Slide 11

Slide 11 text

How about? Persistence Routing layer Rendering layer Application logic DOM manipulation User Interface Client Server Common

Slide 12

Slide 12 text

Hook into rendered app Load app logic Isomorphic apps Download response Server response Client sees content <- Server Client ->

Slide 13

Slide 13 text

Progressive enhancement • Application usable without JS on client • SEO is really easy with this approach • Client bootstraps on top of pre rendered app • Interaction powered by rich client scripts

Slide 14

Slide 14 text

Sharing app state • Server renders template corresponding to state S1 • Server sends rendered template and state S1 along • Client receives both and bootstraps app logic according to given state. • Client resumes app execution from state S1

Slide 15

Slide 15 text

• Server writes state as JSON stringified in HTML source in a script tag • Client parses JSON and bootstraps its models Sharing app state - simple

Slide 16

Slide 16 text

How?

Slide 17

Slide 17 text

Let’s get coding

Slide 18

Slide 18 text

Thank you