Progressive Web Apps
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 11
Slide 11 text
Progressive Web Apps
a Service Worker ➡ Ember
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 12
Slide 12 text
Progressive Web Apps
a Service Worker ➡ Ember
ember-service-worker
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 13
Slide 13 text
Progressive Web Apps
Slide 14
Slide 14 text
Progressive Web Apps
Web apps that feel like native apps by
means of progressive enhancement
Slide 15
Slide 15 text
Service Workers Web App Manifest
&
Progressive Web Apps
Slide 16
Slide 16 text
Service Workers Web App Manifest
Progressive Web Apps
Slide 17
Slide 17 text
Service Workers Web App Manifest
Offline
Progressive Web Apps
Slide 18
Slide 18 text
Service Workers Web App Manifest
Offline
Push Notifications
Progressive Web Apps
Slide 19
Slide 19 text
Service Workers Web App Manifest
Offline
Push Notifications
Background Sync
Progressive Web Apps
Slide 20
Slide 20 text
Service Workers Web App Manifest
Offline
Push Notifications
Background Sync
Add to home screen
Progressive Web Apps
Slide 21
Slide 21 text
Service Workers Web App Manifest
Offline
Push Notifications
Background Sync
Add to home screen
Display mode
Progressive Web Apps
Slide 22
Slide 22 text
https://developers.google.com/web/showcase/
Slide 23
Slide 23 text
https://developers.google.com/web/showcase/
Slide 24
Slide 24 text
Still not convinced?
http://bit.ly/pwa-talk
Slide 25
Slide 25 text
Still not convinced?
http://bit.ly/pwa-talk
Slide 26
Slide 26 text
Still not convinced?
http://bit.ly/pwa-talk
Slide 27
Slide 27 text
Still not convinced?
http://bit.ly/pwa-talk
Slide 28
Slide 28 text
Progressive Web Apps
Slide 29
Slide 29 text
Progressive Web Apps
PWA & Ember
Slide 30
Slide 30 text
PWA & Ember
“Ember’s size disqualifies it
for mobile use”
Slide 31
Slide 31 text
PWA & Ember
EmberConf 2016:
“Instant Web Apps”
Slide 32
Slide 32 text
PWA & Ember
Slide 33
Slide 33 text
PWA & Ember
FastBoot
Slide 34
Slide 34 text
PWA & Ember
FastBoot
Svelte Builds
Slide 35
Slide 35 text
PWA & Ember
FastBoot
Svelte Builds
Engines
Slide 36
Slide 36 text
PWA & Ember
FastBoot
Svelte Builds
Engines
Service Workers
Slide 37
Slide 37 text
PWA & Ember
Image from:
EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
Slide 38
Slide 38 text
PWA & Ember
Image from:
EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
Slide 39
Slide 39 text
PWA & Ember
Deliver the raw HTML content by
server-side rendering with FastBoot
Image from:
EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
Slide 40
Slide 40 text
Image from:
EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
PWA & Ember
Load the minimum amount of JS
needed by eliminating dead code and
deferring to lazy-loading engines
Slide 41
Slide 41 text
PWA & Ember
A Service Worker makes the
application rely less on the
network by pre-loading
frequently-used data and assets
Image from:
EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
Slide 42
Slide 42 text
make css, js, fonts and logo images offline first on install
make images and other assets offline first on demand
use IndexedDB as fallback for the API
PWA & Ember
Slide 43
Slide 43 text
Progressive Web Apps
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 44
Slide 44 text
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 45
Slide 45 text
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 46
Slide 46 text
An event-driven Web Worker, which responds to
events dispatched from documents and other
sources
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 47
Slide 47 text
Not attached to a particular document, instead it
is registered to an origin and a scope
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 48
Slide 48 text
Only active while handling events, assume the
browser kills it until the next event happens
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Activate
claim documents
cleanup caches
ask for permissions
Slide 65
Slide 65 text
Fetch
Slide 66
Slide 66 text
Fetch
doug.jpg
Slide 67
Slide 67 text
Fetch
doug.jpg
Slide 68
Slide 68 text
Fetch
doug.jpg
Slide 69
Slide 69 text
Fetch
doug.jpg
Slide 70
Slide 70 text
No content
Slide 71
Slide 71 text
No content
Slide 72
Slide 72 text
No content
Slide 73
Slide 73 text
No content
Slide 74
Slide 74 text
No content
Slide 75
Slide 75 text
No content
Slide 76
Slide 76 text
Push
Slide 77
Slide 77 text
Push
Slide 78
Slide 78 text
Sync
Slide 79
Slide 79 text
Sync
Slide 80
Slide 80 text
Sync
Slide 81
Slide 81 text
Sync
Slide 82
Slide 82 text
Sync
Slide 83
Slide 83 text
Sync
Slide 84
Slide 84 text
Sync
Slide 85
Slide 85 text
Progressive Web Apps
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 86
Slide 86 text
Progressive Web Apps
a Service Worker ➡ Ember
PWA & Ember
Serv•ice Work•er (sûrˈvĭs wûrˈkər)
Slide 87
Slide 87 text
B.Y.O.
Build your own
Slide 88
Slide 88 text
public/sw.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(‘/sw.js’);
}
app/index.html
Slide 89
Slide 89 text
No
ES6+,
Modules,
Minification
Slide 90
Slide 90 text
ember-cli-build.js
Slide 91
Slide 91 text
ember-cli-build.js
Slide 92
Slide 92 text
ember-cli-build.js
plugin
Slide 93
Slide 93 text
Awww yeah!
Slide 94
Slide 94 text
Awww yeah!
Slide 95
Slide 95 text
Awww yeah!
You just wasted someone’s money
Slide 96
Slide 96 text
Awww yeah!
You just wasted someone’s money
Slide 97
Slide 97 text
Re-solving well-solved, common
problems is a waste of resources.
Slide 98
Slide 98 text
Re-solving well-solved, common
problems is a waste of resources.
- Edward Faulkner
Slide 99
Slide 99 text
Re-solving well-solved, common
problems is a waste of resources.
- Edward Faulkner
https://github.com/emberjs/rfcs/pull/143
Slide 100
Slide 100 text
Don't waste time making trivial choices. Ember.js incorporates
common idioms so you can focus on what makes your app special,
not reinventing the wheel.
http://emberjs.com
Slide 101
Slide 101 text
Shared solutions
Slide 102
Slide 102 text
Shared solutions
Slide 103
Slide 103 text
Shared solutions
Slide 104
Slide 104 text
Shared solutions
Slide 105
Slide 105 text
Shared solutions
Slide 106
Slide 106 text
Shared solutions
Slide 107
Slide 107 text
Broccoli Service Worker
Slide 108
Slide 108 text
Broccoli Service Worker
Slide 109
Slide 109 text
Broccoli Service Worker
Slide 110
Slide 110 text
No content
Slide 111
Slide 111 text
Great solution, but not
flexible enough
Broccoli Service Worker
Slide 112
Slide 112 text
Shared Solution Pyramid of Flexibility
Slide 113
Slide 113 text
Shared Solution Pyramid of Flexibility
common boilerplate
Slide 114
Slide 114 text
Shared Solution Pyramid of Flexibility
common boilerplate
common use cases
Slide 115
Slide 115 text
Shared Solution Pyramid of Flexibility
common boilerplate
common use cases
custom code
Slide 116
Slide 116 text
Shared Solution Pyramid of Flexibility
common use cases
custom code
ember
Slide 117
Slide 117 text
Shared Solution Pyramid of Flexibility
custom code
ember
addon addon addon
Slide 118
Slide 118 text
Ember Service Worker
Introducing:
Slide 119
Slide 119 text
A pluggable approach
to Service Workers
Slide 120
Slide 120 text
Ember Service Worker
common boilerplate
common use cases
custom code
Slide 121
Slide 121 text
Ember Service Worker
service worker compilation and registration
common use cases
custom code
Slide 122
Slide 122 text
Ember Service Worker
Common Boilerplate
Slide 123
Slide 123 text
Ember Service Worker
Common Boilerplate
Discover all Service Worker plugins
Slide 124
Slide 124 text
Ember Service Worker
Common Boilerplate
Discover all Service Worker plugins
Compile all SW code into one file using Babel and Rollup
Slide 125
Slide 125 text
Ember Service Worker
Common Boilerplate
Discover all Service Worker plugins
Compile all SW code into one file using Babel and Rollup
Compile the SW registration code, w Babel and Rollup
Slide 126
Slide 126 text
Ember Service Worker
Common Boilerplate
Injects Service Worker Registration into index.html
Discover all Service Worker plugins
Compile all SW code into one file using Babel and Rollup
Compile the SW registration code, w Babel and Rollup
Slide 127
Slide 127 text
No content
Slide 128
Slide 128 text
Ember Service Worker
service worker compilation and registration
common use cases
custom code
Slide 129
Slide 129 text
Ember Service Worker
service worker compilation and registration
plugin plugin plugin
custom code
Slide 130
Slide 130 text
Ember Service Worker
Plugin Examples
Slide 131
Slide 131 text
Ember Service Worker
Plugin Examples
Offline first assets
Slide 132
Slide 132 text
Ember Service Worker
Plugin Examples
Offline first assets
Push notifications
Slide 133
Slide 133 text
Ember Service Worker
Plugin Examples
Offline first assets
Offline first API with background sync
Push notifications
Slide 134
Slide 134 text
Ember Service Worker
Plugin Examples
Offline first assets
Offline first API with background sync
Push notifications
Asset Diff Patching
Slide 135
Slide 135 text
Offline first API with background sync
Slide 136
Slide 136 text
Offline first API with background sync
Slide 137
Slide 137 text
Offline first API with background sync
Slide 138
Slide 138 text
Offline first API with background sync
Slide 139
Slide 139 text
Synchronization?
Offline first API with background sync
Slide 140
Slide 140 text
Service Worker!
Offline first API with background sync
Slide 141
Slide 141 text
Ember Service Worker
service worker compilation and registration
plugin plugin plugin
custom code
Slide 142
Slide 142 text
No content
Slide 143
Slide 143 text
No content
Slide 144
Slide 144 text
Ember Service Worker
service worker compilation and registration
plugin plugin plugin
custom code
Slide 145
Slide 145 text
/service-worker
Ember Service Worker
Slide 146
Slide 146 text
/service-worker
index.js
Ember Service Worker
Slide 147
Slide 147 text
Prediction
Slide 148
Slide 148 text
Prediction
The plugin ecosystem will cover 90% of the use-cases
with little to no configuration.
Slide 149
Slide 149 text
Prediction
The plugin ecosystem will cover 90% of the use-cases
with little to no configuration.
The other 10% can be achieved by writing custom code or
building private plugins.
Slide 150
Slide 150 text
No content
Slide 151
Slide 151 text
Working with Service Workers exposes you to cache
invalidation problems. You should thoroughly test
before deploying to production.
Slide 152
Slide 152 text
The code isn't backed by a decent automated test-
suite yet, this is because testing Service Workers is a
new problem, that hasn't been done or documented
that much.
Slide 153
Slide 153 text
The addon has not been widely tested yet, please
install the addon and test it on your staging deploys
and report issues.
Slide 154
Slide 154 text
No content
Slide 155
Slide 155 text
No content
Slide 156
Slide 156 text
No content
Slide 157
Slide 157 text
Have at least a production
ready solution before Safari
ships Service Workers