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
130
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
260
Design Systems and Web Components
onishiweb
1
260
Planes, Trains, and CSS Components London CSS
onishiweb
1
130
Planes, Trains, and CSS Components
onishiweb
6
410
Best viewed with - Velocity Amsterdam 2015
onishiweb
3
3k
Trophy Winning Teams - Web Dev Conf 2015
onishiweb
0
200
Trophy Winning Teams - Drupal Con 2015
onishiweb
0
54
Best viewed with... Theme Conf 2015
onishiweb
1
130
Other Decks in Technology
See All in Technology
技術ブログや登壇資料を秒で作るコツ伝授します
minorun365
PRO
23
5.3k
Envoy External AuthZとgRPC Extensionを利用した「頑張らない」Microservices認証認可基盤
andoshin11
0
210
2024年版 運用者たちのLLM
nwiizo
3
490
Javaにおける関数型プログラミンへの取り組み
skrb
7
290
分野に潜むツールの紹介
pojiro
1
350
contenteditableと向き合う
kikuchikakeru
2
250
AWSを始めた頃に陥りがちなポイントをまとめてみた
oshanqq
1
3.4k
App Router を実プロダクトで採用して見えてきた勘所をちょっとだけ紹介
marokanatani
0
710
標準ライブラリの奥深アップデートを掘り下げよう!
logica0419
2
440
20分で分かるIAM全機能 (拡大版) / 20240903-jawsug-yokohama-iam
opelab
3
140
MySQLユーザ会なにやってるの?とおさそいと / たいへんなのw
sakaik
1
130
PDF Viewer作成の今までとこれから
hunachi
0
180
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
27
8.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
Facilitating Awesome Meetings
lara
49
5.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
41
6.5k
For a Future-Friendly Web
brad_frost
174
9.3k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.8k
The Pragmatic Product Professional
lauravandoore
31
6.2k
A Modern Web Designer's Workflow
chriscoyier
691
190k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
23
1.7k
Happy Clients
brianwarren
96
6.6k
Gamification - CAS2011
davidbonilla
79
4.9k
Teambox: Starting and Learning
jrom
131
8.7k
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