Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Best viewed with... SOTB5
Search
Adam Onishi
September 12, 2015
Technology
1
140
Best viewed with... SOTB5
My updated Best viewed with talk from State of the Browser 5
Adam Onishi
September 12, 2015
Tweet
Share
More Decks by Adam Onishi
See All by Adam Onishi
Help! My client is a WebPerf meetup!
onishiweb
2
220
Help! My client is a WebPerf meetup!
onishiweb
0
280
Design Systems and Web Components
onishiweb
1
270
Planes, Trains, and CSS Components London CSS
onishiweb
1
130
Planes, Trains, and CSS Components
onishiweb
6
440
Best viewed with - Velocity Amsterdam 2015
onishiweb
3
3k
Trophy Winning Teams - Web Dev Conf 2015
onishiweb
0
220
Trophy Winning Teams - Drupal Con 2015
onishiweb
0
57
Best viewed with... Theme Conf 2015
onishiweb
1
130
Other Decks in Technology
See All in Technology
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
3
940
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
850
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
5
230
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
500
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
.NET 9 のパフォーマンス改善
nenonaninu
0
1.1k
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
570
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
360
生成AIのガバナンスの全体像と現実解
fnifni
1
200
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
190
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
How GitHub (no longer) Works
holman
311
140k
Writing Fast Ruby
sferik
628
61k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Why Our Code Smells
bkeepers
PRO
335
57k
How STYLIGHT went responsive
nonsquared
95
5.2k
Gamification - CAS2011
davidbonilla
80
5.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Building Applications with DynamoDB
mza
91
6.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
@onishiweb Best viewed with… Adam Onishi State of the Browser
- September 2015
@onishiweb A long time ago…
@onishiweb @onishiweb
@onishiweb
@onishiweb “Browser wars!”
@onishiweb @onishiweb
@onishiweb – a website in 2015 “For best results view
this page in Chrome.”
@onishiweb Chrome Firefox IE Safari Opera UC Browser Safari (iOS)
Opera Mini Android Browser Amazon Silk YaBrowser Maxthon Iron Nokia Browser Sea Monkey Avant Camino Epiphany OmniWeb Konqueror Galeon Swiftfox Edge
@onishiweb Chrome (v44) - Cache.add() - Request.context() - Notification.data Edge
- img srcset - CSS Regions - Arrow functions Firefox (v40) - Improved Dev tools - IndexedDB transactions - Fetch API (v39) Safari (v9) - Backdrop filters - CSS scroll snapping - Content blocking
@onishiweb
@onishiweb A moratorium http://www.quirksmode.org/blog/archives/2015/07/stop_pushing_th.html
@onishiweb Developer-first development
@onishiweb Cake or Death?
@onishiweb Progressive enhancement
@onishiweb “Vague, but exciting”
@onishiweb Photo by Simon Collison - https://flic.kr/p/pbRdFm @onishiweb
@onishiweb Photo by Pedro Ribeiro Simões - https://flic.kr/p/bvCA8 @onishiweb
@onishiweb – Paul Robert Lloyd “By making fewer assumptions about
context and interface, focusing more on users’ tasks and goals, we can create more adaptable products.” http://alistapart.com/article/thinking-responsively-a- framework-for-future-learning
@onishiweb @onishiweb
@onishiweb Control
@onishiweb Defensive design
@onishiweb What we do know
@onishiweb Baseline
@onishiweb Performance
@onishiweb Perceived Performance
@onishiweb
@onishiweb
@onishiweb Progressively enhanced performance
@onishiweb Render blocking assets
@onishiweb CSS, JS, & Fonts
@onishiweb CSS
@onishiweb CSS is still an enhancement
@onishiweb CSS as an enhancement
@onishiweb Critical Path CSS
@onishiweb Tooling
@onishiweb https://github.com/addyosmani/critical
@onishiweb https://github.com/pocketjoso/penthouse
@onishiweb loadCSS https://github.com/filamentgroup/loadCSS/
@onishiweb Progressively enhancing CSS delivery
@onishiweb Fonts
@onishiweb We ❤ web fonts
@onishiweb
@onishiweb
@onishiweb 3s 3s 3s ∞ -
@onishiweb Asynchronous font loading
@onishiweb Font loading API
@onishiweb var f = new FontFace("open_sansbold", "url(/fonts/ opensans-bold-webfont.woff)", {}); f.load().then(function
(loadedFace) { document.fonts.add(loadedFace); document.body.style.fontFamily = "open_sansbold, serif"; });
@onishiweb var f = new FontFace("open_sansbold", "url(/fonts/ opensans-bold-webfont.woff)", {}); f.load().then(function
(loadedFace) { document.body.className += ' fonts—loaded'; }); /* CSS */ p { visibility: hidden; } .fonts-loaded p { visibility: visible; }
@onishiweb Progressively enhancing font loading
@onishiweb Font loading API http://caniuse.com/#feat=font-loading 41 43 31 ❌ ❌
@onishiweb CSS Font Rendering http://tabatkins.github.io/specs/css-font-rendering/
@onishiweb JavaScript
@onishiweb – Peter Herlihy, GDS Team “1.1% of people aren’t
getting JavaScript enhancements (1 in 93).”
@onishiweb http://kryogenix.org/code/browser/everyonehasjs.html
@onishiweb
@onishiweb – Jeremy Keith “Brilliant easter egg in the newly-
redesigned nasa.gov — if JavaScript fails, you are immersed in the experience of deep space”
@onishiweb Frameworks
@onishiweb – Jake Archibald “Nothing should have a JavaScript dependant
first render, it only punishes the user.”
@onishiweb Is there a better way?
@onishiweb Universal JavaScript
@onishiweb Server Side rendering with Node.js
@onishiweb React
@onishiweb React.renderToString();
@onishiweb app.get('/', function(req, res){ // React.renderToString takes your component //
and generates the markup ReactApp = React.createFactory( require('../ components/index.js') ); reactHtml = React.renderToString( ReactApp({}) ); // Output html rendered by react res.render('index.ejs', { reactOutput: reactHtml }); });
@onishiweb Client side too
@onishiweb GoCardless
@onishiweb – Jack Franklin, GoCardless “If you visit it in
a ‘good’ browser with JS on, you get an incredibly snappy React app, if not, you hit the server on every click.”
@onishiweb Progressively enhancing JavaScript frameworks
@onishiweb Control
@onishiweb The Network
@onishiweb Assumption
@onishiweb @onishiweb Photo by Paul Robertson - https://flic.kr/p/9qSizG
@onishiweb Mobile connectivity
@onishiweb Cake or Death?
@onishiweb Enter Service Worker
@onishiweb Web vs Native!
@onishiweb The web is going offline!
@onishiweb Browser cache
@onishiweb @onishiweb
@onishiweb Register service worker Cache content Response Request Render Usable
website
@onishiweb Cache Request Render Usable website Service worker Network
@onishiweb if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/worker.js') .then(function(registration) { //
Registration was successful console.log('ServiceWorker registered: ', registration.scope); }) .catch(function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }); }
@onishiweb if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/worker.js') .then(function(registration) { //
Registration was successful console.log('ServiceWorker registered: ', registration.scope); }) .catch(function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }); }
@onishiweb if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/worker.js') .then(function(registration) { //
Registration was successful console.log('ServiceWorker registered: ', registration.scope); }) .catch(function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }); }
@onishiweb self.addEventListener('install', function(event) { // Perform install steps event.waitUntil( caches.open(‘content-cache-v1’)
.then(function(cache) { return cache.addAll([ '/index.html', '/css/main.min.css', '/main.js' ]);
@onishiweb self.addEventListener('install', function(event) { // Perform install steps event.waitUntil( caches.open(‘content-cache-v1')
.then(function(cache) { return cache.addAll([ '/index.html', '/css/main.min.css', '/main.js' ]);
@onishiweb self.addEventListener('install', function(event) { // Perform install steps event.waitUntil( caches.open(‘content-cache-v1’)
.then(function(cache) { return cache.addAll([ '/index.html', '/css/main.min.css', '/main.js' ]);
@onishiweb self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache
hit - return response if (response) { return response; } return fetch(event.request); } ) ); });
@onishiweb self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache
hit - return response if (response) { return response; } return fetch(event.request); } ) ); });
@onishiweb self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache
hit - return response if (response) { return response; } return fetch(event.request); } ) ); });
@onishiweb self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache
hit - return response if (response) { return response; } return fetch(event.request); } ) ); });
@onishiweb
@onishiweb https://jakearchibald.com/2014/offline-cookbook/
@onishiweb Tricky bits
@onishiweb Development flow https://www.chromium.org/blink/serviceworker/getting-started#TOC- Development-flow
@onishiweb chrome://inspect/#service-workers @onishiweb
@onishiweb chrome://serviceworker-internals/ @onishiweb
@onishiweb HTTPS only
@onishiweb – MDN “Having modified network requests wide open to
man in the middle attacks would be really bad.”
@onishiweb How much can I cache?
@onishiweb Progressively enhancing the network
@onishiweb Browser support…
@onishiweb https://jakearchibald.github.io/isserviceworkerready/
@onishiweb Return of the browser wars
@onishiweb Not really
@onishiweb Stop assuming
@onishiweb – Bruce Lawson “It never pays to make too
many assumptions about your users.”
@onishiweb Be defensive
@onishiweb Improve performance
@onishiweb New shiny!
@onishiweb @onishiweb Thanks