SlideShare a Scribd company logo
Modern UI
Development
With Node.js
@bittersweetryan
Modern UI Development With Node.js
Modern UI Development With Node.js
1990 1991
Sir Tim Berners-Lee
writes HTML, URI, and
HTTP
Worlds first web page
launched
CSS
Re
2011
e Brehm coins the
m “isomorphic”
om/isomorphic-javascript-future-web-apps/
2015
Michael Jackson says
“universal” is better
https://medium.com/@mjackson/universal-javascript-4761051b7ae9
<code>
Step	
  0
Use. Modules.
http://mattsbrickgallery.tumblr.com/post/48739663720
An IIFE is not a
module!
ES6 or CommonJS
ES6 Modules
ECMA spec
browsers will (eventually) implement
strict mode default
named exports and imports
ES6 Modules
spec had been under churn
browser support coming along slowly
transpolation can get messy
cannot conditionally load them
CommonJS
Node.js default module system
A single syntax for all the modules
conditional loading
CommonJS
No strict mode default
different syntax for browser and node
conditional loading is a double edge sword
The code you
write today is
the code that will
be copied tomorrow.
https://pixabay.com/p-26556/?no_redirect
ES6
ES2015
What is the first thing developers do
when they start coding in a new
project?
Modern UI Development With Node.js
⌘+c
⌘+v
⌘+c
Babel now!
classes
ui components as classes
Modern UI Development With Node.js
Modern UI Development With Node.js
These aren’t even mixins!
They should be modules!
UI components are modules
Modern UI Development With Node.js
Modern UI Development With Node.js
Modern UI Development With Node.js
<build>
The build
pipeline is the
foundation
modern UI
projects are
built on.
http://mdti.net/wp-content/uploads/2014/10/exterior-wall-crack-cropped.jpg
Your build chain is your development lifeline.
Treat it accordingly
Each step is a module.
Each module does one thing
(demo)
If you have to require more than one
plugin you might want to create another module.
Rule of thumb
Tip!
Save your globs in a separate JSON file and
require them into your build modules.
Use your build
tool to automate
mundane tasks.
http://www.companiesandmarkets.com/Content/DynamicMedia/cms-uploaded/X-20140605161048330.jpg
testing
just do it
Test as you code
Test as you code
Test before you push
Test as you code
Test before you push
Test in you CI Server
Tip!
Make testing easy and people will do it.
Easy is…
fast
automated
easy to bootstrap
having a culture of testing
Code	
  Quality
eslint
Why lint?
catch common errors
catch oops moments (console.log, debugger)
Why eslint?
Style checker
Pluggable
Future friendly: ES6, JSX
configure rules [ignore, warn, error]
csslint
Nesting
is the worst thing to happen to CSS.
You should never see this in css!
Don’t let
lint errors in your
repos.
https://odetojoandkatniss.files.wordpress.com/2013/12/gc-nope.png
How?
push hooks
http://www.sitepoint.com/introduction-git-hooks/
pre-commit
pre-push
pre-rebase
commit-msg
post-update
post-checkout
post-merge
For GIT
Add these files to your .git directory’s hooks folder
http://www.sitepoint.com/introduction-git-hooks/
pre-commit
pre-push
pre-rebase
commit-msg
post-update
post-checkout
post-merge
This is your “Nope” button
git push --no-verify
Modern UI Development With Node.js
Continuously Lint & Test
Add your testing and linting
as part of the build process and in your CI tool.
Public shaming is
a great motivator.
Automate Adding Hooks
Modern UI Development With Node.js
<serve>
business logic, maybe some sql
business logic, maybe some sql
php/jsp/asp/erb/etc
business logic, maybe some sql
php/jsp/asp/erb/etc
run some JS on the client
RESTful API’s
RESTful API’s
JS template on the server
RESTful API’s
JS template on the server
interactive JS on the client
There is a large cost to context switching.
Proceed with Caution!
Let node do what it’s good at, nothing more.
Don’t block
Don’t implement business logic
fire & forget, take advantage of the message queue
Make calls to async services
Compose a template
Send the response
Some things have to be
synchronous.
Keep as many of those at startup as you can.
Be aware of the “hot”
path!
Code that will run with EVERY request.
Keep your functional programming
off the hot path.
But what if?
RESTful API’s
RESTful API’s
JavaScript
Isomorphic!
Unimorphic!
Isomorual!
Universal!
Don’t let the demos fool you!
Universal JS is hard!
Calling a template with some data to
produce HTML is easy
De-hydrating data in Node and
re-hydrating client in the browser is
HARD.
Getting your data can
be really hard.
Don’t
Do
Use meta data to tell other modules what data the UI needs.
In React, statics are perfect for this.
Modern UI Development With Node.js
Bind Falkor paths
Load i18n strings
Webpack &
Browserify
Modern UI Development With Node.js
Eac
Node code vs Browser code
Client code is bundled, node code isn’t.
Why not run bundles in Node?
It only takes a few configuration tweaks
http://jlongster.com/Backend-Apps-with-Webpack--Part-I
0) Collect your node_modules
Modern UI Development With Node.js
Not a “hot” code path
1) Add another config to webpack.config.js
Export an array
Have multiple targets
2) Tell web pack to ignore your requires for node_modules
AND your CSS
No Node node_modules
No css
$> node build/server.js
Next level
Stuff
Weback dev server & hot module
swapping.
(demo)
Last thoughts…
Start Small When Transitioning
There are lots of learnings to be had from a single page
Legacy
ServiceServiceService
Routing Layer
( /path match )
Node
Iterate on Modules
Modules don’t have to be perfect at first
learn & refactor
Keep your code clean
Don’t let bad code infect your repository.
Automate
People are lazy. They will do the easy things and
ignore the hard things.
http://webdesign.tutsplus.com/articles/a-brief-history-of-the-world-wide-
web--webdesign-8710
http://www.evolutionoftheweb.com/
http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/
http://jlongster.com/Backend-Apps-with-Webpack--Part-I
References
Questions?
Thank You.
ranklam@netflix.com
ryan.anklam@gmail.com

More Related Content

What's hot (20)

PPTX
ReactJs presentation
nishasowdri
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PDF
Intro to Git and GitHub
Panagiotis Papadopoulos
 
PPTX
Introduction to Git and GitHub Part 1
Omar Fathy
 
PDF
Tailwind CSS - KanpurJS
Naveen Kharwar
 
PDF
Git & GitHub for Beginners
Sébastien Saunier
 
PPTX
Git 101 for Beginners
Anurag Upadhaya
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PPTX
Intro to React
Justin Reock
 
PDF
Git - Level 2
민태 김
 
PPTX
Introduction to git and github
Aderemi Dadepo
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PDF
Github - Git Training Slides: Foundations
Lee Hanxue
 
PPTX
React js programming concept
Tariqul islam
 
PPTX
Introduction to angular with a simple but complete project
Jadson Santos
 
PDF
Introducing GitLab (September 2018)
Noa Harel
 
PPTX
Tailwind CSS.11.pptx
Harish Verma
 
PPTX
Using Git and BitBucket
Medhat Dawoud
 
PDF
Angular
Lilia Sfaxi
 
PPTX
Jenkins tutorial for beginners
BugRaptors
 
ReactJs presentation
nishasowdri
 
Intro to git and git hub
Venkat Malladi
 
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Introduction to Git and GitHub Part 1
Omar Fathy
 
Tailwind CSS - KanpurJS
Naveen Kharwar
 
Git & GitHub for Beginners
Sébastien Saunier
 
Git 101 for Beginners
Anurag Upadhaya
 
Its time to React.js
Ritesh Mehrotra
 
Intro to React
Justin Reock
 
Git - Level 2
민태 김
 
Introduction to git and github
Aderemi Dadepo
 
Git One Day Training Notes
glen_a_smith
 
Github - Git Training Slides: Foundations
Lee Hanxue
 
React js programming concept
Tariqul islam
 
Introduction to angular with a simple but complete project
Jadson Santos
 
Introducing GitLab (September 2018)
Noa Harel
 
Tailwind CSS.11.pptx
Harish Verma
 
Using Git and BitBucket
Medhat Dawoud
 
Angular
Lilia Sfaxi
 
Jenkins tutorial for beginners
BugRaptors
 

Similar to Modern UI Development With Node.js (20)

PDF
Front end-modernization
ColdFusionConference
 
PDF
Front end-modernization
devObjective
 
PDF
Front-End Modernization for Mortals
cgack
 
PPTX
Professionalizing the Front-end
Jordi Anguela
 
PPTX
Adding a modern twist to legacy web applications
Jeff Durta
 
PDF
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Máté Nádasdi
 
PDF
Frontend as a first class citizen
Marcin Grzywaczewski
 
PDF
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
FITC
 
PPT
Node js
Chirag Parmar
 
PDF
Full Stack Developer Course | Infinite Graphix Technologies
Infinite Graphix Technologies
 
PDF
Server Side JavaScript - You ain't seen nothing yet
Tom Croucher
 
PDF
Learning Node Moving to the Server Side Early Release Shelley Powers 2024 sc...
vaciorabad2u
 
PDF
Download full ebook of Learning Node Shelley Powers instant download pdf
zeitsloyerqy
 
PPTX
Isomorphic JavaScript – future of the web
Sigma Software
 
PDF
GoPro, Inc. Case study: Dive into the details of our web applications
Andrew Maxwell
 
PPTX
Progressive Web Apps and React
Mike Melusky
 
PPTX
Nodejs web service for starters
Bruce Li
 
PDF
Learning Nodejs For Net Developers Harry Cummings
coeldiad
 
PPTX
Web summit.pptx
171SagnikRoy
 
PPTX
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
Front end-modernization
ColdFusionConference
 
Front end-modernization
devObjective
 
Front-End Modernization for Mortals
cgack
 
Professionalizing the Front-end
Jordi Anguela
 
Adding a modern twist to legacy web applications
Jeff Durta
 
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Máté Nádasdi
 
Frontend as a first class citizen
Marcin Grzywaczewski
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
FITC
 
Node js
Chirag Parmar
 
Full Stack Developer Course | Infinite Graphix Technologies
Infinite Graphix Technologies
 
Server Side JavaScript - You ain't seen nothing yet
Tom Croucher
 
Learning Node Moving to the Server Side Early Release Shelley Powers 2024 sc...
vaciorabad2u
 
Download full ebook of Learning Node Shelley Powers instant download pdf
zeitsloyerqy
 
Isomorphic JavaScript – future of the web
Sigma Software
 
GoPro, Inc. Case study: Dive into the details of our web applications
Andrew Maxwell
 
Progressive Web Apps and React
Mike Melusky
 
Nodejs web service for starters
Bruce Li
 
Learning Nodejs For Net Developers Harry Cummings
coeldiad
 
Web summit.pptx
171SagnikRoy
 
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
Ad

Recently uploaded (20)

PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Ad

Modern UI Development With Node.js