SlideShare une entreprise Scribd logo
1  sur  40
Progressive Web Apps:
Bridging The Gap
Mail Me: akintayoshedrack@gmail.com
Speaker profile.
 TECH ENTHUSIAST
 PYTHON AND JAVASCRIPT NINJA
 OBVIOUSLY, AM HUMAN
 STUDENT
 FRONT-END DEVELOPER AT CAMERAMAN.NG
 FOOD LOVER
 VSCODE ADVOCATE
WINDOWS OS NO.1 FAN
Sheddy_Nathan Github.com/hactivist123
Contents
 Overview of PWA
 Native Apps Vs PWA
 PWA Baseline Implementation
 Case Studies
 Lacking Features
 PWA - Wish lists
 Conclusion
Overview of PWA
Overview
 Progressive Web Apps are user experiences
that have the reach of the web
 Reliable - Load instantly and never show the
‘downasaur’
 Fast - Respond quickly to user interactions
 Engaging - Feel like a natural app on the device
Overview
60%
of world-wide mobile connections
are 2G
PWA Baseline Implementation
PWA Baseline Implementation
Required Recommended
o HTTPS + Service Worker
o Web App Manifest
o App shell caching
o Splash screen
o Smooth navigation
o Cross browser support
o Push notifications
o Advanced Offline Support
PWA Baseline Implementation
 Client-side proxy written in JavaScript
 Can intercept requests
 Can decide to go idle or to re-activate
themselves
 Safari and Edge support is still in Development
 Must use HTTPS
Service Workers
Service worker
Register service worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/service-
worker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ',
registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
Install service worker (service-worker.js)
var cacheName = 'Cache-name-1';
var dataCacheName = 'dataCache-name-v1';
var filesToCache = [
'/',
'/index.html',
'/app/app_client.min.js',
'/assets/css/main.css',
'/images/resources/128.png',
'/images/resources/144.png',
'/images/resources/152.png',
];
self.addEventListener('install', function(e) {
console.log('[ServiceWorker] Install');
e.waitUntil(
caches.open(cacheName).then(function(cache) {
console.log('[ServiceWorker] Caching app shell');
return cache.addAll(filesToCache);
}).then(function(){
return self.skipWaiting();
})
Update service worker
self.addEventListener('activate', function(e) {
console.log('[ServiceWorker] Activate');
e.waitUntil(
caches.keys().then(function(keyList) {
return Promise.all(keyList.map(function(key) {
if (key !== cacheName) {
console.log('[ServiceWorker] Removing old cache', key);
return caches.delete(key);
}
}));
})
);
return self.clients.claim();
});
Fetch Data
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);
}
)
);
});
PWA Baseline Implementation
 Shell is cached using service worker
 Uses cached data from indexedDB or any
other web storage
 Updates cached view with online data when
loaded
 Cached shell can load instantly on repeat
visits.
App Shell
PWA Baseline Implementation
 Rich native presence on user’s home screen
 Launch app in full-screen mode
 Control the screen orientation for optimal
viewing
 Define “splash screen” launch, theme colour
for site
Web App Manifests {
"short_name": "My Cool App",
"name": "My Totally Cool Application",
"icons":[
{"src": "launcher-icon-3x.png",
"sizes": "192x192",
"type": "image/png"},
{"src": "launcher-splash.png",
"sizes": "512x512",
"type": "image/png"}],
"start_url": "index.html",
"display": "standalone",
"background_color" : "#aeaeae",
"theme_color" : "#aeaeae",
"orientation" : "landscape"
}
PWA Baseline Implementation
 User who visits 2x in a given time
period will be prompted with “add to
home screen”
 One tap to add to home screen
 Opens full screen by showing splash
screen on load (no URL bar)
Web App Manifests
PWA Baseline Implementation
 Show content when on flaky networks
 Store data locally using service workers
 Local Stroage, WebSQL or IndexedDB
 Use an abstraction, like PouchDB
 Caching Pattern
 Cache only or Network only
 Try cache first, then network
 Try network first, then cache
Offline
PWA Baseline Implementation
 App can request Background Sync
 Service Worker triggers Sync Event when it is
appropriate (Network, Battery…)
 Also plans for periodic Background Sync
Background Sync
PWA Baseline Implementation
 System level notifications, like apps
 Register/Receive push notification using service worker
 Ask to notify users with specific information
 Can send notifications even when page closed
Push Notifications
Push notifications
self.addEventListener('push', function(event) {
var title = 'Hello Push Notification';
var body = 'Welcome to my website.';
var icon = '/images/resources/152.png';
var tag = 'simple-push-example-tag';
event.waitUntil(
self.registration.showNotification(title, {
body: body,
icon: icon,
tag: tag
})
);
});
PWA Baseline Implementation
 For first-time visitors, load pages in <10s on 3G connections
 For repeat visitors, instant loading of page in <500 milliseconds
 Always scrolling at 60 frames/second
 Content shouldn’t jump as images are loaded
Instant loading and smooth navigation
Case Studies
Case Studies
 3x time spent on site, from 1 minute to 3.5 minutes
 Seeing 40% visitors return week over week
 70% greater conversion rate among those arriving via “Add to
Homescreen”
 3X lower data usage
Flipkart
Case Studies
 76% more web conversions
 30% more monthly active users on Android, 14% more on iOS
 4X higher interaction rate from “Add to Homescreen”
Alibaba
Case Studies
 38% more conversions
 40% lower bounce rate
 10% longer average session
 30% faster page load
Housing.com
PWA - Wish lists
PWA - Wishlists
 Automatic grant of permissions for Push notification when added to home screen.
 Events to instrument uninstalls
 Deduping between native and web app from the same publisher (Push notification)
 Deep linking into the installed web app
 Some equivalent of Device ID
 More top browsers including progressive features
 Discoverability on the store as well on the user’s phone
Conclusion
Conclusion
If you target the Next Billion Users, PWAs are the way to go
If you are planning for a product, Traditionally, you’d have to build
You can, right now, in most cases, just build
And once Safari implements Service Worker, it will be just
Desktop/Mobile web + Native Android + Native iOS
PWA + Native iOS app
PWA
1Bmonthly mobile
Chrome users
Thank You!

Contenu connexe

Tendances

The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...Robert Nyman
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web ApplicationsBartek Igielski
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsJana Moudrá
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Abdelrahman Omran
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Zhentian Wan
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web AppBinh Bui
 
Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Robert Nyman
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystifiededynamic
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...Robert Nyman
 
Progressive web apps with polymer
Progressive web apps with polymerProgressive web apps with polymer
Progressive web apps with polymerMarcus Hellberg
 
Bruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of AppsBruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of Appsbrucelawson
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016Robert Nyman
 
My learnings on web performance optimization while building a Progressive Web...
My learnings on web performance optimization while building a Progressive Web...My learnings on web performance optimization while building a Progressive Web...
My learnings on web performance optimization while building a Progressive Web...Narendra Shetty
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web appsFastly
 

Tendances (20)

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web-App (PWA)
Progressive Web-App (PWA)Progressive Web-App (PWA)
Progressive Web-App (PWA)
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
 
Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystified
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...
 
Progressive web apps with polymer
Progressive web apps with polymerProgressive web apps with polymer
Progressive web apps with polymer
 
Bruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of AppsBruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of Apps
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016
 
My learnings on web performance optimization while building a Progressive Web...
My learnings on web performance optimization while building a Progressive Web...My learnings on web performance optimization while building a Progressive Web...
My learnings on web performance optimization while building a Progressive Web...
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 

Similaire à Progressivewebapps by sheddy nathan for isdev2017

Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App ChallengesJason Grigsby
 
Progressive Web Apps - Up & Running
Progressive Web Apps - Up & RunningProgressive Web Apps - Up & Running
Progressive Web Apps - Up & RunningSuraj Kumar
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsIgor Chiriac
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101Daniel Black
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testingKalhan Liyanage
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web AppSankalp Khandelwal
 
Building cross platform web apps
Building cross platform web appsBuilding cross platform web apps
Building cross platform web appsITEM
 
SEMINAR (pwa).pptx
SEMINAR (pwa).pptxSEMINAR (pwa).pptx
SEMINAR (pwa).pptxBasitMir10
 
PWA Talk - Smau Milano 2018
PWA Talk - Smau Milano 2018PWA Talk - Smau Milano 2018
PWA Talk - Smau Milano 2018Valerio Pisapia
 
Progressive web apps for e commerce
Progressive web apps for e commerceProgressive web apps for e commerce
Progressive web apps for e commerceShantanuApurva1
 
Progressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorProgressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorIsrael Blancas
 
Planning Your Progressive Web App
Planning Your Progressive Web AppPlanning Your Progressive Web App
Planning Your Progressive Web AppJason Grigsby
 
From AMP to PWA
From AMP to PWAFrom AMP to PWA
From AMP to PWAIdo Green
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandImran Sayed
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Imran Sayed
 

Similaire à Progressivewebapps by sheddy nathan for isdev2017 (20)

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App Challenges
 
Progressive Web Apps - Up & Running
Progressive Web Apps - Up & RunningProgressive Web Apps - Up & Running
Progressive Web Apps - Up & Running
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
 
pwa-170717082930.pdf
pwa-170717082930.pdfpwa-170717082930.pdf
pwa-170717082930.pdf
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web App
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Building cross platform web apps
Building cross platform web appsBuilding cross platform web apps
Building cross platform web apps
 
SEMINAR (pwa).pptx
SEMINAR (pwa).pptxSEMINAR (pwa).pptx
SEMINAR (pwa).pptx
 
PWA Talk - Smau Milano 2018
PWA Talk - Smau Milano 2018PWA Talk - Smau Milano 2018
PWA Talk - Smau Milano 2018
 
Checklist for progressive web app development
Checklist for progressive web app developmentChecklist for progressive web app development
Checklist for progressive web app development
 
Progressive web apps for e commerce
Progressive web apps for e commerceProgressive web apps for e commerce
Progressive web apps for e commerce
 
Progressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorProgressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejor
 
Planning Your Progressive Web App
Planning Your Progressive Web AppPlanning Your Progressive Web App
Planning Your Progressive Web App
 
From AMP to PWA
From AMP to PWAFrom AMP to PWA
From AMP to PWA
 
PWA demystified
PWA demystifiedPWA demystified
PWA demystified
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 

Dernier

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Progressivewebapps by sheddy nathan for isdev2017

  • 1. Progressive Web Apps: Bridging The Gap Mail Me: akintayoshedrack@gmail.com
  • 2. Speaker profile.  TECH ENTHUSIAST  PYTHON AND JAVASCRIPT NINJA  OBVIOUSLY, AM HUMAN  STUDENT  FRONT-END DEVELOPER AT CAMERAMAN.NG  FOOD LOVER  VSCODE ADVOCATE WINDOWS OS NO.1 FAN Sheddy_Nathan Github.com/hactivist123
  • 3. Contents  Overview of PWA  Native Apps Vs PWA  PWA Baseline Implementation  Case Studies  Lacking Features  PWA - Wish lists  Conclusion
  • 5. Overview  Progressive Web Apps are user experiences that have the reach of the web  Reliable - Load instantly and never show the ‘downasaur’  Fast - Respond quickly to user interactions  Engaging - Feel like a natural app on the device
  • 7. 60% of world-wide mobile connections are 2G
  • 9. PWA Baseline Implementation Required Recommended o HTTPS + Service Worker o Web App Manifest o App shell caching o Splash screen o Smooth navigation o Cross browser support o Push notifications o Advanced Offline Support
  • 10. PWA Baseline Implementation  Client-side proxy written in JavaScript  Can intercept requests  Can decide to go idle or to re-activate themselves  Safari and Edge support is still in Development  Must use HTTPS Service Workers
  • 12. Register service worker if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('/service- worker.js').then(function(registration) { // Registration was successful console.log('ServiceWorker registration successful with scope: ', registration.scope); }, function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }); }); }
  • 13. Install service worker (service-worker.js) var cacheName = 'Cache-name-1'; var dataCacheName = 'dataCache-name-v1'; var filesToCache = [ '/', '/index.html', '/app/app_client.min.js', '/assets/css/main.css', '/images/resources/128.png', '/images/resources/144.png', '/images/resources/152.png', ]; self.addEventListener('install', function(e) { console.log('[ServiceWorker] Install'); e.waitUntil( caches.open(cacheName).then(function(cache) { console.log('[ServiceWorker] Caching app shell'); return cache.addAll(filesToCache); }).then(function(){ return self.skipWaiting(); })
  • 14.
  • 15.
  • 16. Update service worker self.addEventListener('activate', function(e) { console.log('[ServiceWorker] Activate'); e.waitUntil( caches.keys().then(function(keyList) { return Promise.all(keyList.map(function(key) { if (key !== cacheName) { console.log('[ServiceWorker] Removing old cache', key); return caches.delete(key); } })); }) ); return self.clients.claim(); });
  • 17. Fetch Data 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); } ) ); });
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. PWA Baseline Implementation  Shell is cached using service worker  Uses cached data from indexedDB or any other web storage  Updates cached view with online data when loaded  Cached shell can load instantly on repeat visits. App Shell
  • 24. PWA Baseline Implementation  Rich native presence on user’s home screen  Launch app in full-screen mode  Control the screen orientation for optimal viewing  Define “splash screen” launch, theme colour for site Web App Manifests { "short_name": "My Cool App", "name": "My Totally Cool Application", "icons":[ {"src": "launcher-icon-3x.png", "sizes": "192x192", "type": "image/png"}, {"src": "launcher-splash.png", "sizes": "512x512", "type": "image/png"}], "start_url": "index.html", "display": "standalone", "background_color" : "#aeaeae", "theme_color" : "#aeaeae", "orientation" : "landscape" }
  • 25. PWA Baseline Implementation  User who visits 2x in a given time period will be prompted with “add to home screen”  One tap to add to home screen  Opens full screen by showing splash screen on load (no URL bar) Web App Manifests
  • 26. PWA Baseline Implementation  Show content when on flaky networks  Store data locally using service workers  Local Stroage, WebSQL or IndexedDB  Use an abstraction, like PouchDB  Caching Pattern  Cache only or Network only  Try cache first, then network  Try network first, then cache Offline
  • 27. PWA Baseline Implementation  App can request Background Sync  Service Worker triggers Sync Event when it is appropriate (Network, Battery…)  Also plans for periodic Background Sync Background Sync
  • 28. PWA Baseline Implementation  System level notifications, like apps  Register/Receive push notification using service worker  Ask to notify users with specific information  Can send notifications even when page closed Push Notifications
  • 29. Push notifications self.addEventListener('push', function(event) { var title = 'Hello Push Notification'; var body = 'Welcome to my website.'; var icon = '/images/resources/152.png'; var tag = 'simple-push-example-tag'; event.waitUntil( self.registration.showNotification(title, { body: body, icon: icon, tag: tag }) ); });
  • 30. PWA Baseline Implementation  For first-time visitors, load pages in <10s on 3G connections  For repeat visitors, instant loading of page in <500 milliseconds  Always scrolling at 60 frames/second  Content shouldn’t jump as images are loaded Instant loading and smooth navigation
  • 32. Case Studies  3x time spent on site, from 1 minute to 3.5 minutes  Seeing 40% visitors return week over week  70% greater conversion rate among those arriving via “Add to Homescreen”  3X lower data usage Flipkart
  • 33. Case Studies  76% more web conversions  30% more monthly active users on Android, 14% more on iOS  4X higher interaction rate from “Add to Homescreen” Alibaba
  • 34. Case Studies  38% more conversions  40% lower bounce rate  10% longer average session  30% faster page load Housing.com
  • 35. PWA - Wish lists
  • 36. PWA - Wishlists  Automatic grant of permissions for Push notification when added to home screen.  Events to instrument uninstalls  Deduping between native and web app from the same publisher (Push notification)  Deep linking into the installed web app  Some equivalent of Device ID  More top browsers including progressive features  Discoverability on the store as well on the user’s phone
  • 38. Conclusion If you target the Next Billion Users, PWAs are the way to go If you are planning for a product, Traditionally, you’d have to build You can, right now, in most cases, just build And once Safari implements Service Worker, it will be just Desktop/Mobile web + Native Android + Native iOS PWA + Native iOS app PWA

Notes de l'éditeur

  1. Có đến 60% thiết bị mobile là kết nối 2G. Vậy chìa khóa cho giải pháp này là Service Worker.
  2. Nó không tiêu tốn tài nguyên hệ thống nào. Nó được hoạt động khi có event nào được gọi. Nó còn được gọi khi trình duyệt đã được đóng. Khi sw được đăng ký thì nó sẽ kích hoạt event install, mà có thể tìm nạp và cache những dữ liệu. Nó kiểm soát cache tới mức tệp tin và nó được cập nhật. Khi nó được kích hoạt thì nó bắt đầu kiểm soát các hệ thống và cung cấp các dịch vụ cho user. Lần đầu tiên nó vẫn load từ mạng, sw chỉ hoạt động khi ở lần load thứ 2. Nó hoạt động như thế này : Lần đầu nó sẽ đăng ký và install, sau đó thì nó ở trạng thái tĩnh, không làm gì cả. Khi reload lại trang thì sw được kích hoạt và sẵn sàng xử lý các event Sau khi giải quyết xong các event thì nó chuyển sang trại thái tĩnh và sẵn sàng cho lần nạp tiếp theo. Nếu bạn có sự thay đổi cho sw thì ở lần load sau đó server sẽ update lại sw.
  3. Đặt vào trong file index.html hoặc trong file main.js
  4. Khi sw được install lần đầu thì nó không kiểm soát trang ngay mà phải đợi reload lại trang. Bạn muốn bỏ qua việc này và muốn nó làm việc ngay trong khi đợi thì dùng skipWaiting. Tìm nạp trước các tài nguyên mà site cần và cache lại trong local cache, đảm bảo rằng các tệp nó có thể tải ngay. Sau đó open file cache, sử dụng cache.addAll để lấy tất cả tài nguyên trong filesToCache đã liệt kê lưu vào bộ nhớ cache trình duyệt. Lưu ý : nếu trong số các file cache fail khi tải xuống thì toàn bộ sự kiện sẽ không thành công và sw không được activated. Sau khi add xong thì gọi skipWaiting để sw có quyền kiểm soát ngay. waitUntil để đảm bảo rằng sw không bị doán đoạn.
  5. Bật f12 để xem Dev Tool, vào tag Application->service worker.
  6. Dung lượng cache nó phụ thuộc vào sự cho phép của CPU và RAM.
  7. Sau khi sw đã cache xong và chuyển sang trạng thái active thì clean up cache cũ. So sánh danh sách cache cũ với danh sách mới, cái nào khác thì nó xóa đi. Sau đó gọi client.claim để chạy lại. Nhưng nếu tới đây bạn tắt mạng và reload lại thì sao ?
  8. Khi nhận được yêu cầu mạng từ site thì sw sẽ được gọi và fetch được kích hoạt. Sau đó kiểm tra xem dữ liệu có được cache chưa, có trả về dữ liệu trong cache, nếu không thì yêu cầu kết nối mạng hoặc trả lại yêu cầu.
  9. Load page khi lần đầu load.
  10. Sau khi load site nó sẽ vào trong cache trước và show ra trước sau khi mạng có thì bắt đầu tải các tài nguyên còn lại. Nếu dữ liệu cache nào đã được thay đổi thì thông qua mạng nó sẽ cache lại. Thông thường đối với trường hợp offline thì mình thông báo cho user biết là đang ở trạng thái offline.
  11. Có đến 1 tỷ người sử dụng chrome trên mobile. Năm 2014 mới có khoảng 400 triệu người dùng chrome trên mobile. Trung bình mỗi tháng, người dùng chrome trên android ghé thăm 100 trang mỗi tháng. (Nguồn : google developer)