Isomorphic goodness in
your web app
- shifa khan
Isomorphic goodness in
your web app
What ?
Isomorphic JS
Means you can run the same Javascript code
on the server as well as the client (aka the
web browser).
Once upon a time..
These guys competed to be
the beloved poster child of web apps
Ruby on Rails
PHP + ‘x’ framework
Python + Django
They had a distinct divide between the
backend and frontend
Ruby / PHP
/ Python
HTML, CSS
& JS
Node allowed Javascript code on both
backend and frontend
JS
HTML, CSS
& JS
Node JS
Next Logical step seems obvious..
backend and frontend
JS
Html,
css
js
Isomorphic JS
Why ?
Angular Stapes
Spine
Ember
Meteor
Flight
Riot
Can
Sammy
Backbone
Agility
Volt
Yay! Faster
Snappy Apps!
Drawbacks ?
➔ Slow Initial Load Times
➔ Difficult SEO
➔ Logic Duplication
How to?
backend and frontend
Isomorphic JS
backend and frontend
Isomorphic JS
Business/
Application Logic
backend and frontend
Isomorphic JS
Routing
backend and frontend
Isomorphic JS
Views
Isomorphic JS
Views
Business/
Application Logic
Routing
Problems:
Not a lot of Documentation/ guidelines... Yet.
Increased Complexity
What’s in it for me ?
backend and frontend
Isomorphic JS
Views
backend and frontend
Isomorphic JS
Views
React JS
React
➔ Isomorphic JS Library
➔ For Views/ UI components (V in MVC)
➔ Backed and used by Facebook, Instagram
➔ Virtual DOM concept
➔ Renders on both server and client
gem ‘react-rails’
➔ Helper methods for react components
➔ Integrates with turbolinks
➔ No need for templates (mustache, etc)
Sample app
Code - https://github.com/shifakhan/react_hello
What you’ll miss about rails views
➔ Helper methods - current_user, simple form
Thank You !

Isomorphic js - React in Rails