-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
619 lines (556 loc) · 23.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Progressive Web Apps</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-background-image="images/background.jpg" class="transparent">
<h2>
P<span class="text-very-small">rogressive</span>
W<span class="text-very-small">eb</span>
A<span class="text-very-small">pplications</span>
</h2>
<div style="font-style: italic; font-size: 0.7em;">
Przemek Suchodolski / <a href="https://twitter.com/przemuh" target="_blank">@przemuh</a> / <a href="http://przemuh.pl" target="_blank">przemuh.pl</a>
</div>
</section>
<section>
<h2>About me</h2>
<ul>
<li class="fragment">Front-End Engineer</li>
<li class="fragment">Certified Scrum Master</li>
<li class="fragment"><a href="https://www.youtube.com/user/przemuh" target="_blank">Amateur Musician</a></li>
<li class="fragment">Addicted to FIFA</li>
</ul>
</section>
<section data-background-image="images/egnyte-bg.jpg">
<a href="https://www.egnyte.com/jobs/" target="_blank"><div class="fragment transparent">is hiring</div></a>
</section>
<section>
<a href="https://sunscrapers.com/careers/jobs/javascript-developer/" target="_blank">
<div><img src="images/sunscrapers-logo.jpg" /></div>
<div class="fragment">is hiring</div>
</a>
</section>
<section>
<h2>First task</h2>
<div class="fragment">One app - three platforms</div>
<ul>
<li class="fragment">Web</li>
<li class="fragment">Android</li>
<li class="fragment">iOS</li>
</ul>
<div class="fragment lotr"></div>
</section>
<section>
<ul>
<li class="fragment">Hybrid / WebView / PhoneGap 💀</li>
<li class="fragment">Compile JS to native (React Native) 🚀</li>
<li class="fragment">PWA 🎉</li>
</ul>
</section>
<section>
<section>
<h1>Stats</h1>
</section>
<section>
<img src="images/global-digital-share.png"/>
<div class="source">
<a href="https://wearesocial.com/uk/special-reports/digital-in-2017-global-overview" target="_blank">
source: wearesocial.com
</a>
</div>
</section>
<section>
<h4>Share of Digital Media Time Spent</h4>
<canvas data-chart="pie">
<!--
{
"data": {
"labels": ["Smartphone App"," Desktop"," Tablet App"," Smartphone Web"," Tablet Web"],
"datasets": [
{
"data":[50,34,7,7,2]
}
]
},
"options": { "responsive": "true" }
}
-->
</canvas>
<div class="source">comScore Media Metrix Multi-Platform & Mobile Metrix, U.S., Total Audience, June 2017</div>
</section>
<section>
<h4>Share of Time Spent on Mobile: App vs. Web</h4>
<canvas data-chart="pie">
<!--
{
"data": {
"labels": ["Mobile Web"," Mobile App"],
"datasets": [
{
"data":[13,87]
}
]
},
"options": { "responsive": "true" }
}
-->
</canvas>
<div class="source">Source: comScore Mobile Metrix, U.S., Age 18+, June 2017</div>
</section>
<section>
<h4>Average Monthly Minutes per Visitor</h4>
<canvas data-chart="bar">
<!--
{
"data": {
"labels": ["App", "Mobile Web"],
"datasets": [
{
"label": "m",
"data": [186.9, 11.9],
"backgroundColor": ["#E42128", "#2782DA"]
}
]
},
"options": { "legend": false, "responsive": true, "scales": { "xAxes": [{ "stacked": true }], "yAxes": [{ "stacked": true }] } }
}
-->
</canvas>
<div class="source">Source: comScore Mobile Metrix, U.S., Age 18+, June 2017</div>
</section>
<section>
<h4>Average Monthly Unique Visitors (MM)</h4>
<canvas data-chart="bar">
<!--
{
"data": {
"labels": ["App", "Mobile Web"],
"datasets": [
{
"label": "MM",
"data": [7, 15.7],
"backgroundColor": ["#E42128", "#2782DA"]
}
]
},
"options": { "legend": false, "responsive": true, "scales": { "xAxes": [{ "stacked": true }], "yAxes": [{ "stacked": true }] } }
}
-->
</canvas>
<div class="source">Source: comScore Mobile Metrix, U.S., Age 18+, June 2017</div>
</section>
<section>
<h4>Every step = 20%</h4>
<canvas data-chart="bar">
<!--
{
"data": {
"labels": ["Initial", "App store page view", "Install", "Open App", "Sign up", "Create content", "Share"],
"datasets": [
{
"label": "%",
"data": [100, 80, 64, 51, 40, 32, 24]
}
]
},
"options": { "legend": false, "responsive": true, "scales": { "xAxes": [{ "stacked": true }], "yAxes": [{ "stacked": true }] } }
}
-->
</canvas>
<div class="source">
<a href="http://blog.gaborcselle.com/2012/10/every-step-costs-you-20-of-users.html" target="_blank">
http://blog.gaborcselle.com/2012/10/every-step-costs-you-20-of-users.html
</a>
</div>
</section>
<section>
<img src="images/mobile-share.png"/>
<div class="source">
<a href="https://wearesocial.com/uk/special-reports/digital-in-2017-global-overview" target="_blank">
source: wearesocial.com
</a>
</div>
</section>
</section>
<!-- End of charts !-->
<section id="history">
<h1>2015</h1>
<ul class="list">
<li class="fragment">Frances Berriman (designer)</li>
<li class="fragment">Alex Russell (Google Chrome engineer)</li>
</ul>
<br/>
<p class="fragment" style="font-size: 0.7em;"><a href="https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/" target="_blank">
Progressive Web Apps: Escaping Tabs Without Losing Our Soul
</a></p>
</section>
<section>
<section id="characteristic">
<h2>PWA characteristic</h2>
<ul class="fragment">
<li>Responsive</li>
<li>Connectivity independent</li>
<li>App-like-interactions</li>
<li>Fresh</li>
<li>Safe</li>
<li>Discoverable</li>
<li>Re-engageable</li>
<li>Installable</li>
<li>Linkable</li>
</ul>
<aside class="notes">
<ul>
<li>Responsive: to fit any form factor</li>
<li>Connectivity independent: Progressively-enhanced with Service Workers to let them work offline</li>
<li>App-like-interactions: Adopt a Shell + Content application model to create appy navigations & interactions</li>
<li>Fresh: Transparently always up-to-date thanks to the Service Worker update process</li>
<li>Safe: Served via TLS (a Service Worker requirement) to prevent snooping</li>
<li>Discoverable: Are identifiable as “applications” thanks to W3C Manifests and Service Worker registration scope allowing search engines to find them</li>
<li>Re-engageable: Can access the re-engagement UIs of the OS; e.g. Push Notifications</li>
<li>Installable: to the home screen through browser-provided prompts, allowing users to “keep” apps they find most useful without the hassle of an app store</li>
<li>Linkable: meaning they’re zero-friction, zero-install, and easy to share. The social power of URLs matters.</li>
</ul>
</aside>
</section>
<section>
<h2>PWA characteristic TL;DR</h2>
<ul>
<li class="fragment">Reliable</li>
<li class="fragment">Fast</li>
<li class="fragment">Engaging</li>
<aside class="notes">
<ul>
<li>Reliable - Load instantly and never show the downasaur, even in uncertain network conditions.</li>
<li>Fast - Respond quickly to user interactions with silky smooth animations and no janky scrolling.</li>
<li>Engaging - Feel like a natural app on the device, with an immersive user experience.</li>
</ul>
</aside>
</ul>
</section>
<section>
<h2>
<a href="https://developers.google.com/web/progressive-web-apps/checklist" target="_blank">
PWA checklist
</a>
</h2>
<ul class="fragment">
<li>Site is served over HTTPS</li>
<li>Pages are responsive on tablets & mobile devices</li>
<li>The start URL (at least) loads while offline</li>
<li>Metadata provided for Add to Home screen</li>
<li>First load fast even on 3G <br/><span class="text-small">(WebPageTest (aim for <4000 first view on Mobile 3G Nexus 5 Chrome)</span></li>
<li>Site works cross-browser</li>
<li>Page transitions don't feel like they block on the network</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Reliable / Connectivity independent</h2>
</section>
<section>
<img class="fragment" src="images/poor-signal.png"/>
</section>
<section>
<img src="images/offline-mobile.png" />
</section>
<section>
<img src="images/load-mobile.png" />
</section>
</section>
<section>
<section>
<h2>Service Worker</h2>
</section>
<section data-background-video="videos/service-worker.mp4">
<div class="source" style="height: 300px;"><a href="https://www.youtube.com/watch?v=cmGr0RszHc8" target="_blank">
Jake Archibald on Instant Loading: Building offline-first Progressive Web Apps
</a></div>
</section>
<section>
<h3>Register</h3>
<pre><code data-trim>
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js');
}
</code></pre>
</section>
<section>
<h3>Install event</h3>
<pre><code class="hljs" data-trim contenteditable>
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => {
const urlsToCache = [
"/",
"main.js",
"images/david.jpg"
];
cache.addAll(urlsToCache);
})
);
});
</code></pre>
</section>
<section>
<h3>Fetch event</h3>
<pre><code class="hljs" data-trim contenteditable>
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});
</code></pre>
</section>
<section>
<h3>
<a href="https://github.com/goldhand/sw-precache-webpack-plugin" target="_blank">
SW Precache Webpack Plugin
</a>
</h3>
<pre><code data-trim>
{ ...
plugins: [
new SWPrecacheWebpackPlugin(
{
cacheId: 'my-project-name',
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
minify: true,
navigateFallback: PUBLIC_PATH + 'index.html',
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}
),
]
...}
</code></pre>
</section>
<section>
<h1>Fresh / Background sync</h1>
</section>
<section>
<h3>Sync registration</h3>
<pre><code data-trim>
navigator.serviceWorker.ready.then(function(registration) {
registration.sync.register('outbox').then(function() {
// registration succeeded
}, function() {
// registration failed
});
});
</code></pre>
</section>
<section>
<h3>Respond to sync</h3>
<pre><code data-trim>
self.addEventListener('sync', function(event) {
if (event.tag == 'outbox') {
event.waitUntil(sendEverythingInTheOutbox());
}
});
</code></pre>
</section>
<section>
<h3>Periodical sync</h3>
<pre><code data-trim>
navigator.serviceWorker.ready.then(function(registration) {
registration.periodicSync.register({
tag: 'get-latest-news', // default: ''
minPeriod: 12 * 60 * 60 * 1000, // default: 0
powerState: 'avoid-draining', // default: 'auto'
networkState: 'avoid-cellular' // default: 'online'
}).then(function(periodicSyncReg) {
// success
}, function() {
// failure
})
});
</code></pre>
</section>
<section>
<h3>Debugging</h3>
<img src="images/service-worker-debug.png" />
</section>
</section>
<section>
<section>
<h2>Engaging / Native experience</h2>
</section>
<section data-background-image="images/push.jpg">
<h3 class="transparent">Push notification</h3>
</section>
<section>
<pre><code data-trim>
self.addEventListener('push', function(event) {
console.log('Received a push message', event);
const title = 'Yay a message.';
const body = 'We have received a push message.';
const icon = '/images/icon-192x192.png';
const tag = 'simple-push-demo-notification-tag';
event.waitUntil(
self.registration.showNotification(title, {
body: body,
icon: icon,
tag: tag
})
);
});
</code></pre>
</section>
<section data-background-image="images/homescreen.jpg">
<h3 class="transparent">Adding to home screen</h3>
</section>
<section>
<h2>Manifest.json</h2>
<pre class="fragment"><code data-trim><link rel="manifest" href="manifest.json"></code></pre>
<pre class="fragment"><code data-trim>
{
"name": "Meet Js",
"short_name": "mjs",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#f9a20c",
"background_color": "#ffffff",
"display": "standalone"
}
</code></pre>
</section>
<section>
<video src="videos/add-to-home-screen.mp4" data-autoplay></video>
</section>
<section>
<img src="images/manifest-debug.png" />
</section>
</section>
<section>
<section><h1>Fast / Performance</h1></section>
<section>
<ul>
<li class="fragment">Lib substitute</li>
<li class="fragment">Code-splitting</li>
<li class="fragment">link rel="preload"</li>
<li class="fragment"><a href="https://www.polymer-project.org/1.0/toolbox/server" target="_blank">PRPL Pattern</a></li>
<li class="fragment"><a href="https://medium.com/@addyosmani/progressive-web-apps-with-react-js-part-4-site-is-progressively-enhanced-b5ad7cf7a447" target="_blank">Progressive Enhancement</a></li>
<li class="fragment"><a href="https://medium.com/google-developers/instant-loading-web-apps-with-an-application-shell-architecture-7c0c2f10c73" target="_blank">App Shell Architecture</a></li>
</ul>
</section>
</section>
<section>
<section><h1>Case studies</h1></section>
<section data-background-iframe="https://www.youtube.com/embed/JmC0xkCMFCE?rel=0&start=65&autoplay=1"></section>
<section>
<ul>
<li><a href="https://developers.google.com/web/showcase/2017/twitter" target="_blank">Twitter</a></li>
<li><a href="https://developers.google.com/web/showcase/2016/alibaba" target="_blank">Alibaba</a></li>
<li><a href="https://developers.google.com/web/showcase/2016/aliexpress" target="_blank">Aliexpress</a></li>
</ul>
</section>
</section>
<section>
<h2>Limitations ?</h2>
<ul>
<li class="fragment">WEB !== NATIVE <a href="https://whatwebcando.today/" target="_blank">(whatwebcando.today)</a></li>
<li class="fragment">Service worker <a href="https://jakearchibald.github.io/isserviceworkerready/" target="_blank">(is service worker ready)</a></li>
</ul>
</section>
<section>
<h2>Take away</h2>
<ul>
<li class="fragment">Each step - 20% vs PWA distribution</li>
<li class="fragment">Reliable - Fast - Engaging</li>
<li class="fragment">Progressive</li>
</ul>
</section>
<section>
<h1>Thank you</h1>
<div>Questions ?</div>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
const colors = [
'#E42128',
'#2782DA',
'#FD9626',
'#63BD32',
'#BD72BE',
'rgba(255, 159, 64, 1)'
];
Reveal.initialize({
dependencies: [
{src: 'plugin/markdown/marked.js'},
{src: 'plugin/markdown/markdown.js'},
{src: 'plugin/notes/notes.js', async: true},
{src: 'plugin/chart/Chart.min.js'},
{src: 'plugin/chart/csv2chart.js'},
{
src: 'plugin/highlight/highlight.js', async: true, callback: function () {
hljs.initHighlightingOnLoad();
}
}
],
chart: {
defaults: {
global: {
title: { fontColor: "#FFF" },
legend: {
labels: { fontColor: "#FFF" },
},
},
scale: {
scaleLabel: { fontColor: "#FFF" },
gridLines: { color: "#FFF", zeroLineColor: "#FFF" },
ticks: { fontColor: "#FFF" },
}
},
bar: { backgroundColor: colors },
pie: { backgroundColor: [colors] }
}
});
Reveal.addEventListener('fragmentshown', function(e) {
function checkFragment(needle) {
return e.fragment.className.indexOf(needle) > -1
}
if (checkFragment('lotr')) {
Reveal.getCurrentSlide().dataset.background = 'https://media.giphy.com/media/1I2NwmjvSzNS0/giphy.gif';
Reveal.sync();
}
}, false);
</script>
</body>
</html>