Alex Moldovan
@alexnmoldovan
Engineering Manager @ Fortech
Co-Founder @ Cluj JavaScripters
medium.com/@alexnm
1.92s
3s - 7s
10s - 25s
420 Kb
httparchive.org
A brief history of web applications
( JavaScript vs Network )
1995
2008
2014
2018
Network
JavaScript
Ajax
SPA
SSR + SPA
SSR
UNIVERSAL APPS
Alice
Browser
App Size
JavaScript
Alice
VS
Browser
GET example.com
index.html
Time to first byte
Parse HTML
GET .css / .woff2
Dom Ready
Paint CSS
First meaningful paint
GET .js / .json
Page Interactive
Full Load
High Priority
Low Priority
<link rel="preload" href="main.css" as="style">
<link rel="preload" href="webfont.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="bg-image-narrow.png" as="image" media="(max-width: 600px)">
<link rel="preload" href="bg-image-wide.png" as="image" media="(min-width: 601px)">
Alice
VS
App Size
app.js
lib.js
minified
app.js
lib.js
minified + gzipped
679 kB
484 kB
137 kB
127 kB
app.css
156 kB
24 kB
app.css
1080px
360px
load images based on media queries
defer loading images below the fold
compress images (webp)
app.bundle.js
300 kB
app.bundle.js
150 kB
account.bundle.js
100 kB
checkout.bundle.js
100 kB
import("../pages/myAccount")
import("../pages/checkout")
Careful with dependencies like moment.js and lodash
Invest time in your custom components if needed
Understand your browser usage, don't ship polyfills blindly
react-slick (12.2 kB) -> 3.41 kB
react-date-picker (25.4 kB) -> 3.22 kB
react-tooltip (9.7 kB) -> 1.42 kB
Inferno
Alice
VS
JavaScript
jQuery
Angular.js
Backbone
React
Angular
Vue
Knockout
Vanilla *
addEventListener('touchstart', onTouchStart, {passive: true});
Alice
VS
Future
Alice
Write Code
Write Tests
Performance
Security
The ladder of software quality
UX
Alex Moldovan
@alexnmoldovan
JavaScript Ninja @ Fortech
Co-Founder @ Cluj JavaScripters
medium.com/@alexnm