SlideShare a Scribd company logo
1 of 40
Progressive Web Apps:
A Gentle Introduction
About Me
Auwal Muhammad Samu
Developer | Tech Evangelist | Community
Organiser| Lover of JS | Fan of Python |
Tweet @auwalms_
What are Progressive
Web Apps?
4
“
PWAs are apps that leverage on modern
web APIs to deliver app like user
experience
“
Progressive Web Apps are apps built with
modern web technologies, basically HTML,
CSS and JavaScript but delivers app like
features.
Features of PWA5
Features of PWA includes:
◉Progressive
◉Installable
◉Reliable
◉Fast
◉Engaging
◉Safe
◉Fresh
◉Linkable
Why build PWA?6
Save Users from
Downasaur / Dinosaur Lie-Fi
Image Source: Google Developers
Why Build PWA?
◉Work reliably, no matter the network
conditions
◉Saved Data/Memory Usage
◉Easily Updatable
◉App communication is secured.
Components of PWA?7
What you need:
◉Application Shell
◉Service Worker
◉Manifest
Application Shell8
“
An app "shell" is the minimal HTML, CSS and
JavaScript required to power the user interface and
when cached offline can ensure instant, reliably
good performance to users on repeat visits
- Google Developers
Source: Google Developers
Service Worker9
“
A service worker is a script that your browser runs in the
background, separate from a web page, opening the door to
features that don't need a web page or user interaction.
Today, they already include features like push
notifications and background sync.
- Google Developers
“
Service workers essentially act as proxy servers that sit
between web applications, and the browser and network
(when available). They are intended to (amongst other
things) enable the creation of effective offline experiences,
intercepting network requests and taking appropriate action
based on whether the network is available and updated
assets reside on the server.
- Mozilla Developer Network
Source: Google Developers
Service Worker is for the second
load
Life Cycle of a Service Worker
Installing the Service Worker
1st Page Load
install
idle
Life Cycle of a Service Worker
Installing the Service Worker
2nd Page Load
activated check for update
Life Cycle of a Service Worker
Updating a Service Worker
2nd Page Load
activated check for update
install
idle
Registering a Service Worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js')
.then(function(reg) {
console.log('Service Worker Registered', reg);
})
.catch(function(err) {
console.log('Error registering Service Worker', err);
});
}
Pre-fetch the App Resources
var cacheName = 'app-shell-cache-v1';
var filesToCache = ['/', '/index.html', ...]; //add path to resource here
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(cacheName).then(function(cache) {
return cache.addAll(filesToCache);
}).then(function() {
return self.skipWaiting();
})
);
});
Add and activate the SW
self.addEventListener('activate', function(e) {
e.waitUntil(
caches.keys().then(function(keyList) {
return Promise.all(keyList.map(function(key) {
if (key !== cacheName) {
return caches.delete(key);
}
}));
})
);
return self.clients.claim();
});
Add a ‘fetch’ Event Handler
self.addEventListener('fetch', function(e) {
e.respondWith(
caches.match(e.request).then(function(response) {
return response || fetch(e.request);
})
);
});
Caching Resource
Cache and Network Race
Generic Fallback
You may check this out!
App Manifest9
“
The web app manifest is a simple JSON file that gives you,
the developer, the ability to control how your app appears to
the user in the areas that they would expect to see apps (for
example the mobile home screen), direct what the user can
launch and more importantly how they can launch it.
- Google Developers
Web Manifest Structure
{
"name": “Konga EZ",
"short_name": “Konga EZ",
"icons": [ {
"src": "img/icon-48x48.png",
"sizes": "48x48",
"type": "image/png“,
"src": "img/icon-72x72.png",
"sizes": “72x72",
"type": "image/png“,
"src": "img/icon-48x48.png",
"sizes": “96x96",
"type": "image/png“,
}],
"start_url":"index.html?launcher=true",
"theme_color": "#29629E",
"background_color": "#29629E",
"display": "standalone“
}
<link rel="manifest" href="/manifest.json">
Splash screen to be
added
App Installation
Using Manifest, the
user is prompted to
“Add to Home
Screen” serving the
same purpose as
installing apps from
store
Push Notification
To keep users
engaged, developers
can prompt for
permission to send
push notification to
their users.
Extra
Resources:
◉Progressive Web Apps - https://developers.google.com/web/progressive-web-
apps
◉Udacity: Intro to PWA - https://www.udacity.com/course/intro-to-progressive-web-
apps--ud811
◉PWA[Mozilla Dev Network] - https://developer.mozilla.org/en-
US/docs/Web/Apps/Progressive
◉Google IO17 Talk on PWA - https://events.google.com/io/schedule/?section=may-
17&sid=943de475-c3f2-4069-8d07-435686e6b217&track=mobileweb
◉The offline cookbook - https://jakearchibald.com/2014/offline-cookbook/
Any Question(s)?
◉ Tweet: @auwalms_
Thanks!

More Related Content

What's hot

Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineAlexander Zamkovyi
 
Building React CRUD app in minutes?
Building React CRUD app in minutes?Building React CRUD app in minutes?
Building React CRUD app in minutes?Tomasz Bak
 
Service workers
Service workersService workers
Service workersjungkees
 
Building Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSBuilding Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSFITC
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaWordCamp Kyiv
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...Applitools
 
Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleJay Harris
 
The web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goThe web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goRobert Nyman
 
Asp.net life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depthsonia merchant
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloudAndy Bosch
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application DevelopmentFITC
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application DeploymentMathew Byrne
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events51 lecture
 
Progressive Web Apps - Tips
Progressive Web Apps - TipsProgressive Web Apps - Tips
Progressive Web Apps - TipsRainmaker Ho
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.jsMatthew Beale
 

What's hot (20)

Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App Engine
 
Building React CRUD app in minutes?
Building React CRUD app in minutes?Building React CRUD app in minutes?
Building React CRUD app in minutes?
 
Service workers
Service workersService workers
Service workers
 
Building Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOSBuilding Progressive Web Apps for Android and iOS
Building Progressive Web Apps for Android and iOS
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin Nikita
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
 
Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life Cycle
 
The web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goThe web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must go
 
Asp.net life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depth
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloud
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application Development
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
 
AngularJS
AngularJSAngularJS
AngularJS
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events
 
Progressive Web Apps - Tips
Progressive Web Apps - TipsProgressive Web Apps - Tips
Progressive Web Apps - Tips
 
Apache maven
Apache mavenApache maven
Apache maven
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.js
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
 

Similar to Progressive Web Apps 101

Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesWindows Developer
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "FDConf
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsUnfold UI
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsAnjaliTanpure1
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!Chang W. Doh
 
Service workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsService workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsMukul Jain
 
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
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - MozillaRobert Nyman
 
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-appsJSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-appsMukul Jain
 

Similar to Progressive Web Apps 101 (20)

Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Service workers
Service workersService workers
Service workers
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devices
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
GDG Ibadan #pwa
GDG Ibadan #pwaGDG Ibadan #pwa
GDG Ibadan #pwa
 
Mean stack Magics
Mean stack MagicsMean stack Magics
Mean stack Magics
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web Apps
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
 
Service workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsService workers and the role they play in modern day web apps
Service workers and the role they play in modern day 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...
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-appsJSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Progressive Web Apps 101

  • 1. Progressive Web Apps: A Gentle Introduction
  • 2. About Me Auwal Muhammad Samu Developer | Tech Evangelist | Community Organiser| Lover of JS | Fan of Python | Tweet @auwalms_
  • 4. “ PWAs are apps that leverage on modern web APIs to deliver app like user experience
  • 5. “ Progressive Web Apps are apps built with modern web technologies, basically HTML, CSS and JavaScript but delivers app like features.
  • 7. Features of PWA includes: ◉Progressive ◉Installable ◉Reliable ◉Fast ◉Engaging ◉Safe ◉Fresh ◉Linkable
  • 9. Save Users from Downasaur / Dinosaur Lie-Fi Image Source: Google Developers
  • 10. Why Build PWA? ◉Work reliably, no matter the network conditions ◉Saved Data/Memory Usage ◉Easily Updatable ◉App communication is secured.
  • 12. What you need: ◉Application Shell ◉Service Worker ◉Manifest
  • 14. “ An app "shell" is the minimal HTML, CSS and JavaScript required to power the user interface and when cached offline can ensure instant, reliably good performance to users on repeat visits - Google Developers
  • 17. “ A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction. Today, they already include features like push notifications and background sync. - Google Developers
  • 18. “ Service workers essentially act as proxy servers that sit between web applications, and the browser and network (when available). They are intended to (amongst other things) enable the creation of effective offline experiences, intercepting network requests and taking appropriate action based on whether the network is available and updated assets reside on the server. - Mozilla Developer Network
  • 20.
  • 21. Service Worker is for the second load
  • 22. Life Cycle of a Service Worker Installing the Service Worker 1st Page Load install idle
  • 23. Life Cycle of a Service Worker Installing the Service Worker 2nd Page Load activated check for update
  • 24. Life Cycle of a Service Worker Updating a Service Worker 2nd Page Load activated check for update install idle
  • 25. Registering a Service Worker if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js') .then(function(reg) { console.log('Service Worker Registered', reg); }) .catch(function(err) { console.log('Error registering Service Worker', err); }); }
  • 26. Pre-fetch the App Resources var cacheName = 'app-shell-cache-v1'; var filesToCache = ['/', '/index.html', ...]; //add path to resource here self.addEventListener('install', function(event) { event.waitUntil( caches.open(cacheName).then(function(cache) { return cache.addAll(filesToCache); }).then(function() { return self.skipWaiting(); }) ); });
  • 27. Add and activate the SW self.addEventListener('activate', function(e) { e.waitUntil( caches.keys().then(function(keyList) { return Promise.all(keyList.map(function(key) { if (key !== cacheName) { return caches.delete(key); } })); }) ); return self.clients.claim(); });
  • 28. Add a ‘fetch’ Event Handler self.addEventListener('fetch', function(e) { e.respondWith( caches.match(e.request).then(function(response) { return response || fetch(e.request); }) ); });
  • 32. You may check this out!
  • 34. “ The web app manifest is a simple JSON file that gives you, the developer, the ability to control how your app appears to the user in the areas that they would expect to see apps (for example the mobile home screen), direct what the user can launch and more importantly how they can launch it. - Google Developers
  • 35. Web Manifest Structure { "name": “Konga EZ", "short_name": “Konga EZ", "icons": [ { "src": "img/icon-48x48.png", "sizes": "48x48", "type": "image/png“, "src": "img/icon-72x72.png", "sizes": “72x72", "type": "image/png“, "src": "img/icon-48x48.png", "sizes": “96x96", "type": "image/png“, }], "start_url":"index.html?launcher=true", "theme_color": "#29629E", "background_color": "#29629E", "display": "standalone“ } <link rel="manifest" href="/manifest.json"> Splash screen to be added
  • 36. App Installation Using Manifest, the user is prompted to “Add to Home Screen” serving the same purpose as installing apps from store
  • 37. Push Notification To keep users engaged, developers can prompt for permission to send push notification to their users. Extra
  • 38.
  • 39. Resources: ◉Progressive Web Apps - https://developers.google.com/web/progressive-web- apps ◉Udacity: Intro to PWA - https://www.udacity.com/course/intro-to-progressive-web- apps--ud811 ◉PWA[Mozilla Dev Network] - https://developer.mozilla.org/en- US/docs/Web/Apps/Progressive ◉Google IO17 Talk on PWA - https://events.google.com/io/schedule/?section=may- 17&sid=943de475-c3f2-4069-8d07-435686e6b217&track=mobileweb ◉The offline cookbook - https://jakearchibald.com/2014/offline-cookbook/
  • 40. Any Question(s)? ◉ Tweet: @auwalms_ Thanks!

Editor's Notes

  1. Keep your users in mind and save them from the lie and dinosaur disasters.
  2. Wga
  3. On first load, deliver and cache this basic resources, serve it on next visit instead of fetching the server. Now how do we fetch and cache for next visit?
  4. Wga
  5. SW serves a intermediary between web apps and web servers.
  6. When a service worker is first registered, it fires an "install" event which you can then use to pre-fetch and cache the resources your app needs. SWs goes into the idle mode if no in use and then get called into ‘active’ mode by the browser on need or get terminated when not needed.
  7. it’s important to understand that the FIRST time you load the page, it’s still going to be loading from the network - the index page has already been retrieved from the network, of course, and the page’s resources will kick off downloading normally. The Service Worker will come into play on subsequent loads, not the first load.
  8. Since we've already been to the page, the service worker is already installed and is immediately activated. Then, just like before, the browser checks with the server to see if the service worker has changed and if it does it saves this new resources to the cache.
  9. We are registering SW using this code snippet.
  10. We are registering SW using this code snippet.
  11. There are plenty of ways to do this, but in this case, we iterate over the list of keys from the cache, then delete any caches that don't match the current cache name. And there's one more thing we need to do. By calling self.clients.claim, we tell the browser that we want THIS service worker to take control of all of the clients that it controls. That means we don't have to wait until any other service workers that are running terminate, we're ready to go immediately!
  12. We’ll assume that every required resource for our app is already in the cache; but if it is not we'll just go out to the network to fetch it. When a network request is made from our web page our Service Worker wakes up and the `fetch` event is triggered.
  13. So what are the ways are we going to use to store our downloaded resources? Either use cache before network, network before cache or cache then network.
  14. You could also do a generic fallback solution where a request is made first to the cache, then the network, and if both of them fail, a second request is made to the cache for a generic page.
  15. You could also do a generic fallback solution where a request is made first to the cache, then the network, and if both of them fail, a second request is made to the cache for a generic page.
  16. Wga
  17. User gets prompted to add app to home screen after spending some time in the site.
  18. Users can be asked for permission to allow push notification from the site/app .