SlideShare a Scribd company logo
ISOMORPHIC
JAVASCRIPT
Tyler Peterson
@managerJS
October 2015
AKA • Isomorphic
• Universal
– Not to be confused with a
Universal Module
• Portable
Isomorphic
JavaScript
• Narrowly: Same Code
Renders Markup on
Server and Client
– React, Rendr, Meteor
• Broadly: CodeThat Is At
Home on the Server and
the Browser.
– Superagent, lo-dash, Q
Presented by FamilySearch
Significant
Common
Ground
• JavaScript language:
prototypes, expressions,
functions as objects.
• JavaScript libs such as Math,
Date, Error, JSON, RegExp.
• Can solve a lot of problems
without running into
inconsistencies.
Libraries
Built on
Common
Ground
• The community already
has interest in creating
libs built on common
ground and easily loaded
in the browser or node.
– Ex: Q, underscore/lodash,
moment.js, Chai
Inconsistencies
In the Browser
• XMLHttpRequest()
• DOM
• Local storage et al.
In Node
• http.request()
• None/Replacement (React)
• Files and databases
Presented by FamilySearch
Fighting
Inconsistency?
• Push it up
• Push it down
• Detect and differentiate
Pushing
Inconsistency
Up
• Make your caller deal with
it
• Accept the fruits
– Example: use a hierarchy of
React components. Only at the
top do you differentiate
between React.render() and
ReactDomServer.renderToString().
Pushing
Inconsistency
Down
• Make a dependency deal
with it
• Interact with a façade
– Example: Have a service that fetches
data. Consumers act like data is
fetched uniformly. Under the covers
it uses different URLs inside the data-
center versus outside the firewall.
Lots
Already
Pushed
Down
• The community is already
attracted to pushing
inconsistency down into
universal libraries.
– Ex: superagent
Detect and
Differentiate
• if (typeof window ===
‘undefined’) you’re on the
server, bub.
• Can add sentinels,
depending on your
control
Packaging • Pick something that lets
you transparently use
modules in node or in
Browser.
– WebPack is gaining popularity
– Browserify does the job, too
Trending:
Browserify
vs.
WebPack
https://www.google.com/trends/explore#q=browserify%2C%20webpack&cmpt=q&tz=Etc%2FGMT%2B6
October 14, 2015
Setting up
WebPack
(with React)
• Check out Radu Brehar’s
instructions at
http://jslog.com/2014/10/
02/react-with-webpack-
part-1/
– Some updates in the code at
https://github.com/tylerpeterso
n/isojs
How Useful
Is This
Anyway?
• Perspective of a Library
Author
• Perspective of an App
Author
As a Lib
Author
• If meant for common use,
you should make your code
into a universal module at a
the minimum. Be kind to
your users.
• Your library might target
one environment at first
and be useful enough to
shim to work in both.
As App
Author
• Let’s you write logic once
and run in both places
– Caution: Different concerns on
client and server.
• Many new ideas haven’t
been fully explored
React
Changes
Applicability
• I’m using react in my demos
because portable UI
increases the possibilities of
universal JS.
• Now you can push
inconsistency above, below,
or into the UI and still have a
large amount of Universal
JavaScript.
Demo:
Rendering
Portability
• Example of rendering
your page entirely on
server or entirely in client.
– https://github.com/DavidWells/i
somorphic-react-example
Demo:
Request
Hand-off
• Start all the work on the
server, stream above-the-
fold content, respond to
bandwidth in a beacon
feedback loop, let client
finish up the work.
– https://github.com/tylerpeterso
n/isojs
Thank You! • Tyler Peterson
– ty@managerjs.com
– @ManagerJS

More Related Content

What's hot (20)

PPT
Hacking the way you work
Fotis Alexandrou
 
PDF
Scaling up development of a modular code base
Robert Munteanu
 
PDF
Drupal, git and sanity
Charlie Morris
 
PDF
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Conference
 
PPTX
Introduction to JS frameworks
Deepu S Nath
 
PDF
VJUG 24 - Building microservices with Vert.x
Bert Jan Schrijver
 
PPTX
Javascript Frameworks Comparison
Deepu S Nath
 
PPTX
Reusability is the goal
Red Pill Now
 
PDF
Supporting large scale React applications
Maurice De Beijer [MVP]
 
PDF
Malmberg meetup June 2018 - Building microservices with Vert.x
Bert Jan Schrijver
 
PDF
Rapidly Building and Deploying Scalable Web Architectures
Keith Fitzgerald
 
PPTX
Building large scalable mission critical business applications on the web
Maurice De Beijer [MVP]
 
PPTX
Microfrontends Monoreops & Trunkbased based
Vinci Rufus
 
PPT
Front-End Tools and Workflows
Sara Vieira
 
PDF
Creating Hyper Performant Web Apps with React
Jp DeVries
 
PPTX
Introduction to Web Technology Stacks
Prakarsh -
 
PDF
Dublin JUG February 2018 - Building microservices with Vert.x
Bert Jan Schrijver
 
PDF
Vert.x NL meetup October 2017 - Building microservices with Vert.x
Bert Jan Schrijver
 
PPTX
Don't worry with bower
Frank van der Linden
 
PPTX
An evening with React Native
Mike Melusky
 
Hacking the way you work
Fotis Alexandrou
 
Scaling up development of a modular code base
Robert Munteanu
 
Drupal, git and sanity
Charlie Morris
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Conference
 
Introduction to JS frameworks
Deepu S Nath
 
VJUG 24 - Building microservices with Vert.x
Bert Jan Schrijver
 
Javascript Frameworks Comparison
Deepu S Nath
 
Reusability is the goal
Red Pill Now
 
Supporting large scale React applications
Maurice De Beijer [MVP]
 
Malmberg meetup June 2018 - Building microservices with Vert.x
Bert Jan Schrijver
 
Rapidly Building and Deploying Scalable Web Architectures
Keith Fitzgerald
 
Building large scalable mission critical business applications on the web
Maurice De Beijer [MVP]
 
Microfrontends Monoreops & Trunkbased based
Vinci Rufus
 
Front-End Tools and Workflows
Sara Vieira
 
Creating Hyper Performant Web Apps with React
Jp DeVries
 
Introduction to Web Technology Stacks
Prakarsh -
 
Dublin JUG February 2018 - Building microservices with Vert.x
Bert Jan Schrijver
 
Vert.x NL meetup October 2017 - Building microservices with Vert.x
Bert Jan Schrijver
 
Don't worry with bower
Frank van der Linden
 
An evening with React Native
Mike Melusky
 

Similar to Isomorphic JavaScript with Node, WebPack, and React (20)

PDF
Modern UI Development With Node.js
Ryan Anklam
 
PDF
Kharkiv JS 2015 - Creating isomorphic applications in React (en)
Viktor Turskyi
 
PDF
General Assembly Workshop: Advanced JavaScript
Spike Brehm
 
PDF
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
PPTX
Isomorphic JavaScript – future of the web
Sigma Software
 
PDF
Matheus Marsiglio - Isomorphic React + Redux App
React Conf Brasil
 
PDF
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Spike Brehm
 
KEY
Let's run JavaScript Everywhere
Tom Croucher
 
PPTX
JS digest. Mid-Summer 2017
ElifTech
 
PDF
Building Isomorphic Apps (JSConf.Asia 2014)
Spike Brehm
 
PDF
Server Side JavaScript - You ain't seen nothing yet
Tom Croucher
 
PDF
React server side rendering performance
Nick Dreckshage
 
PDF
Review on React JS
ijtsrd
 
PPTX
Building isomorphic java script apps faster with next.js
Madhav Chaturvedi
 
PPTX
React js basics
Maulik Shah
 
PDF
why_choose_react_js_development_for_building_websites_in_2023.pdf
sarah david
 
PDF
Isomorphic web application
Oliver N
 
PDF
Nodejs vs react js converted
Sovereign software solution
 
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
PDF
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
Modern UI Development With Node.js
Ryan Anklam
 
Kharkiv JS 2015 - Creating isomorphic applications in React (en)
Viktor Turskyi
 
General Assembly Workshop: Advanced JavaScript
Spike Brehm
 
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
Isomorphic JavaScript – future of the web
Sigma Software
 
Matheus Marsiglio - Isomorphic React + Redux App
React Conf Brasil
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Spike Brehm
 
Let's run JavaScript Everywhere
Tom Croucher
 
JS digest. Mid-Summer 2017
ElifTech
 
Building Isomorphic Apps (JSConf.Asia 2014)
Spike Brehm
 
Server Side JavaScript - You ain't seen nothing yet
Tom Croucher
 
React server side rendering performance
Nick Dreckshage
 
Review on React JS
ijtsrd
 
Building isomorphic java script apps faster with next.js
Madhav Chaturvedi
 
React js basics
Maulik Shah
 
why_choose_react_js_development_for_building_websites_in_2023.pdf
sarah david
 
Isomorphic web application
Oliver N
 
Nodejs vs react js converted
Sovereign software solution
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
Ad

Recently uploaded (20)

PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Ad

Isomorphic JavaScript with Node, WebPack, and React