Yours Truly, Famous Inc.
Mobile vs. Desktop
Distributing Native Software is HARD
Every Step Costs You 20% of Users
© ComScore{
"name": "Dark Sky Weather PWA",
"short_name": "Weather",
"icons": [{...}],
"start_url": "/index.html",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
{
"name": "Dark Sky Weather PWA",
"short_name": "Weather",
"icons": [{...}],
"start_url": "/index.html",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
{
"name": "Dark Sky Weather PWA",
"short_name": "Weather",
"icons": [{...}],
"start_url": "/index.html",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
{
"name": "Dark Sky Weather PWA",
"short_name": "Weather",
"icons": [{...}],
"start_url": "/index.html",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
Where should I put service-worker.js
?
...
self.addEventListener('install', (evt) => {
evt.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(FILES_TO_CACHE);
})
);
self.skipWaiting();
});
...
self.addEventListener('activate', (evt) => {
...
return Promise.all(keyList.map((key) => {
if (key !== CACHE_NAME && key !== DATA_CACHE_NAME) {
return caches.delete(key);
}
...
self.clients.claim();
...
self.addEventListener('fetch', (evt) => {
...
if (evt.request.url.includes('/forecast/')) {
return fetch(evt.request)
.then((response) => {
...
}
}
...
...
self.addEventListener('fetch', (evt) => {
...
evt.respondWith(
caches.open(CACHE_NAME).then((cache) => {
return cache.match(evt.request).then((response) => {
return response || fetch(evt.request);
});
})
);
name: Build project and Run Lighthouse CI
on: [push]
jobs:
lhci:
name: Lighthouse CI
runs-on: ubuntu-latest
steps:
...