SlideShare une entreprise Scribd logo
1  sur  52
Progressive Web App (PWA)
“Progressive Web Apps (PWAs) are web applications that load like regular web pages or websites but can offer the user
functionality such as working offline, push notifications, and device hardware access traditionally available only to native
mobile applications. PWAs are an emerging technology that combine the open standards of the web offered by modern
browsers to provide benefits of a rich mobile experience”
• Progressive: It works for every user(independent of browser choice ) there by reduced load time to the least possible
minimum( i.e. <3sec)
• Web App: In terms of look and feel on the choice of device. Will give the experience like an native mobile app since we
can add as an icon to home screen.
Affordable mobile web app @ no cost( in development / deployment / maintenance )
• A Progressive Web App works in the browser so there is no need for specialized development.PWA’s fit all kinds of
tablets, laptops or smartphones due to the use of responsive web design techniques..
• Works in low connectivity even when offline.
• PWA saved 88% of time to load the first content and meaningful paint and thus reduced load time less than 3 seconds.
• PWAs allow websites to be added to home screens on mobile devices and receive push notifications.
• Security is ensured in PWA since HTTPS hoisting.
• No need to download/update from app store( some apps are paid ).
HTTPS App Manifest Service Workers
• An app manifest file should describe the
resources your app will need. This includes
your app’s displayed name, icons, as well as
splash screen. If you link to the manifest file in
your index.html, browsers will detect that and
load the resources for you.
• The minimal HTML, CSS, and JavaScript and
any other static resources that provide the
structure for your page, minus the actual
content specific to the page.
{
"name": "service-worker",
"short_name": "sw-demo",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "assets/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
}, …
]
}
12
• short_name is used on the user's home screen, launcher, or other places
where space may be limited
• name is used in the app install
• theme_color is used on the user's home screen, launcher, or other places
where space may be limited•The background_color property is used on the splash screen when the
application is first launched.• display property Opens the web app to look and feel like a standalone
native app. The app runs in its own window, separate from the browser, and
hides standard browser UI elements like the URL bar, etc.
• Browser will automatically scale the icon for the device.
13
• The worker thread can perform tasks
without interfering with the user
interface.
• In addition, they can perform I/O using
XMLHttpRequest (although the
responseXML and channel attributes
are always null). Once created, a
worker can send messages to the
JavaScript code that created it by
posting messages to an event handler
specified by that code (and vice versa.)
“Web Workers is a simple means for web content to run scripts in background threads”
• We will be demoing them how
an application behaves with and
without web worker.
• Demo URL :
https://web-worker-
ff594.firebaseapp.com/
15
• Service worker could be mentioned in Offline Support, but
it really deserves its own section. Service worker provides a
programmatic way to cache app resources. Be it JavaScript
files or JSON data from a HTTP request. The programmatic
API allows developers to decide how to handle caching and
provides a much more flexible experience than other
options
• Service workers essentially act as proxy servers that sit
between web applications, the browser, and the network
(when available). They are intended, among other things,
to enable the creation of effective offline experiences,
intercept network requests and take appropriate action
based on whether the network is available, and update
assets residing on the server. They will also allow access to
push notifications and background sync APIs.
“A Service Worker is just a javascript file that runs in the background. A
service worker is a type of web worker ”
• We will develop a basic
angular app with PWA
implemented.
• Demo URL:
https://sw-demo-
236f8.firebaseapp.com/
17
18
BROW
SER
LIMIT
Chrom
e
<6% of free
space
Firefox <10% of free
space
Safari <50MB
IE10 <250MB
Edge Dependent on
volume size
“Cache-First strategy is to check the cache before going to the network.
This is great for caching on the fly and optimizing for repetitive asset
requests since it only hits the network on ‘fresh’ assets”
“All requests for assets will follow standard pattern of requesting them
from the server. Once the server responds with the asset, it will then be
cached by the Service Worker. If the request the for assets fails for
whatever reason, the Service Worker will check the cache. This is great
for assets that always need to be fresh. You may have noticed this
strategy will fail if an asset is requested and fails on the first try”
“network requests only with no cache”
“The Cache-Only strategy is a tad confusing. It only allows requests to be
served from the cache. The only way this works is if you have another
process pre-caching these resources before they are requested by your
application”
Traditionally, you’d have to build
• Desktop/mobile web + native Android + native iOS
You can, right now, in most cases, just build
• PWA + native iOS
And once iOS Safari implements push notifications, it will be just
• PWA
30
PWA
Service
Worker
HTTPS
Responsive
31
Site is served over HTTPS
To Test Use Lighthouse to verify Served
over HTTPS
To Fix Implement HTTPS and check
out letsencrypt.org to get started.
Pages are responsive on tablets & mobile devices
To Test •Use Lighthouse to verify Yes to all
of Design is mobile-friendly ,
although manually checking can
also be helpful.
•Check the Mobile Friendly Test
To Fix Look at implementing
a responsive design, or adaptively
serving a viewport-friendly site.
• Progressive - Work for every user, regardless of browser choice, because they
are built with progressive enhancement as a core tenet.
• Responsive - Fit any form factor, desktop, mobile, tablet, or whatever is next.
• Connectivity independent - Enhanced with service workers to work offline or
on low quality networks.
• App-like - Use the app-shell model to provide app-style navigation and
interactions.
• Fresh - Always up-to-date thanks to the service worker update process.
• Safe - Served via HTTPS to prevent snooping and ensure content has not been
tampered with.
• Discoverable - Are identifiable as “applications” thanks to W3C manifests and
service worker registration scope allowing search engines to find them.
• Re-engageable - Make re-engagement easy through features like push notifications.
• Installable - Allow users to “keep” apps they find most useful on their home screen
without the hassle of an app store.
• Linkable - Easily share via URL and not require complex installation.
• Lighthouse returns a Performance score between 0 and 100. 0 is the lowest
possible score and 100 is the best.
• The PWA audits are based on the Baseline PWA Checklist, which lists 14
requirements.
• Lighthouse has automated audits for 11 of the 14 requirements. The
remaining 3 can only be tested manually.
• The color-coding maps to these Performance score ranges:
• 0 to 49 (slow): Red
• 50 to 89 (average): Orange
• 90 to 100 (fast): Green
Before Implementing PWA After Implementing PWA
• We will deploy the developer angular app with PWA implemented (Exercise 2 ).
• Create Firebase Account to Deploy Angular Application
• Install the Firebase Tools using Firebase CLI
• Login and Initialize Firebase project using Firebase CLI
• Initialize your Firebase project run below command.
• Create Production Build using the AOT / JIT Compilation
• Deploying the web app in Firebase server
• Testing the hosted app in participants mobile (with / without data)
• Step by step guidance :
https://medium.com/@saleemmalikraja/deploying-an-angular-app-to-firebase-hosting-
18f99c9d5722
38
• Cross Browser Support : While Chrome, Opera, and Samsung’s android browser
supports PWA, IE, Edge and Safari are yet to extend their support.
• Limited Functionality: PWA doesn’t have support for any hardware that is not
supported by HTML5 (https://whatwebcando.today/)
• Cross Application Login Support : Native apps have the capability to talk to other
apps and authenticate logins (Facebook, Twitter, Google). As a webpage, PWA
doesn’t have the capability to communicate with other apps installed.
49
• https://medium.com/@saleemmalikraja/angular-pwa-2ddc3cccd090
• https://medium.com/dev-channel/why-progressive-web-apps-vs-native-is-the-wrong-question-to-ask-fb8555addcbb
• https://developers.google.com/web/progressive-web-apps/
• https://developers.google.com/web/showcase/2017/make-my-trip
• https://jakearchibald.github.io/isserviceworkerready/#moar
• https://jakearchibald.com/2014/offline-cookbook/
50
51
Questions ?
Progressive Web App

Contenu connexe

Tendances

Tendances (20)

Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
 
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)
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
 
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
 
Pwa.pptx
Pwa.pptxPwa.pptx
Pwa.pptx
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystified
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
 
Test at Scale within your Internal Networks with BrowserStack Local Testing
Test at Scale within your Internal Networks with BrowserStack Local TestingTest at Scale within your Internal Networks with BrowserStack Local Testing
Test at Scale within your Internal Networks with BrowserStack Local Testing
 
Introduction to mobile application
Introduction to mobile applicationIntroduction to mobile application
Introduction to mobile application
 
Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
Different types of mobile apps
Different types of mobile appsDifferent types of mobile apps
Different types of mobile apps
 
Mobile application testing tutorial
Mobile application testing tutorialMobile application testing tutorial
Mobile application testing tutorial
 
NATIVE VS PWA APPS – A COMPLETE GUIDE
NATIVE VS PWA APPS – A COMPLETE GUIDENATIVE VS PWA APPS – A COMPLETE GUIDE
NATIVE VS PWA APPS – A COMPLETE GUIDE
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
Internship presentation
Internship presentationInternship presentation
Internship presentation
 

Similaire à Progressive Web App

Similaire à Progressive Web App (20)

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web Apps
 
Progressive Web Apps - NPD Meet
Progressive Web Apps - NPD MeetProgressive Web Apps - NPD Meet
Progressive Web Apps - NPD Meet
 
Service workers are your best friends
Service workers are your best friendsService workers are your best friends
Service workers are your best friends
 
The PRPL Pattern
The PRPL PatternThe PRPL Pattern
The PRPL Pattern
 
A year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUA year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMU
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Checklist for progressive web app development
Checklist for progressive web app developmentChecklist for progressive web app development
Checklist for progressive web app development
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
SEMINAR PRESENTATION.pptx
SEMINAR PRESENTATION.pptxSEMINAR PRESENTATION.pptx
SEMINAR PRESENTATION.pptx
 
A year with progressive web apps! #webinale
A year with progressive web apps! #webinaleA year with progressive web apps! #webinale
A year with progressive web apps! #webinale
 
PWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran KasireddyPWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
 
PWAs overview
PWAs overview PWAs overview
PWAs overview
 
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
 
WTF R PWAs?
WTF R PWAs?WTF R PWAs?
WTF R PWAs?
 
20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 

Dernier

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 

Progressive Web App

  • 2.
  • 3.
  • 4.
  • 5.
  • 6. “Progressive Web Apps (PWAs) are web applications that load like regular web pages or websites but can offer the user functionality such as working offline, push notifications, and device hardware access traditionally available only to native mobile applications. PWAs are an emerging technology that combine the open standards of the web offered by modern browsers to provide benefits of a rich mobile experience” • Progressive: It works for every user(independent of browser choice ) there by reduced load time to the least possible minimum( i.e. <3sec) • Web App: In terms of look and feel on the choice of device. Will give the experience like an native mobile app since we can add as an icon to home screen. Affordable mobile web app @ no cost( in development / deployment / maintenance ) • A Progressive Web App works in the browser so there is no need for specialized development.PWA’s fit all kinds of tablets, laptops or smartphones due to the use of responsive web design techniques.. • Works in low connectivity even when offline. • PWA saved 88% of time to load the first content and meaningful paint and thus reduced load time less than 3 seconds. • PWAs allow websites to be added to home screens on mobile devices and receive push notifications. • Security is ensured in PWA since HTTPS hoisting. • No need to download/update from app store( some apps are paid ).
  • 7.
  • 8.
  • 9. HTTPS App Manifest Service Workers
  • 10.
  • 11. • An app manifest file should describe the resources your app will need. This includes your app’s displayed name, icons, as well as splash screen. If you link to the manifest file in your index.html, browsers will detect that and load the resources for you. • The minimal HTML, CSS, and JavaScript and any other static resources that provide the structure for your page, minus the actual content specific to the page.
  • 12. { "name": "service-worker", "short_name": "sw-demo", "theme_color": "#1976d2", "background_color": "#fafafa", "display": "standalone", "scope": "/", "start_url": "/", "icons": [ { "src": "assets/icons/icon-72x72.png", "sizes": "72x72", "type": "image/png" }, … ] } 12 • short_name is used on the user's home screen, launcher, or other places where space may be limited • name is used in the app install • theme_color is used on the user's home screen, launcher, or other places where space may be limited•The background_color property is used on the splash screen when the application is first launched.• display property Opens the web app to look and feel like a standalone native app. The app runs in its own window, separate from the browser, and hides standard browser UI elements like the URL bar, etc. • Browser will automatically scale the icon for the device.
  • 13. 13
  • 14. • The worker thread can perform tasks without interfering with the user interface. • In addition, they can perform I/O using XMLHttpRequest (although the responseXML and channel attributes are always null). Once created, a worker can send messages to the JavaScript code that created it by posting messages to an event handler specified by that code (and vice versa.) “Web Workers is a simple means for web content to run scripts in background threads”
  • 15. • We will be demoing them how an application behaves with and without web worker. • Demo URL : https://web-worker- ff594.firebaseapp.com/ 15
  • 16. • Service worker could be mentioned in Offline Support, but it really deserves its own section. Service worker provides a programmatic way to cache app resources. Be it JavaScript files or JSON data from a HTTP request. The programmatic API allows developers to decide how to handle caching and provides a much more flexible experience than other options • Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs. “A Service Worker is just a javascript file that runs in the background. A service worker is a type of web worker ”
  • 17. • We will develop a basic angular app with PWA implemented. • Demo URL: https://sw-demo- 236f8.firebaseapp.com/ 17
  • 18. 18
  • 19.
  • 20. BROW SER LIMIT Chrom e <6% of free space Firefox <10% of free space Safari <50MB IE10 <250MB Edge Dependent on volume size
  • 21.
  • 22.
  • 23. “Cache-First strategy is to check the cache before going to the network. This is great for caching on the fly and optimizing for repetitive asset requests since it only hits the network on ‘fresh’ assets”
  • 24. “All requests for assets will follow standard pattern of requesting them from the server. Once the server responds with the asset, it will then be cached by the Service Worker. If the request the for assets fails for whatever reason, the Service Worker will check the cache. This is great for assets that always need to be fresh. You may have noticed this strategy will fail if an asset is requested and fails on the first try”
  • 25. “network requests only with no cache”
  • 26. “The Cache-Only strategy is a tad confusing. It only allows requests to be served from the cache. The only way this works is if you have another process pre-caching these resources before they are requested by your application”
  • 27.
  • 28. Traditionally, you’d have to build • Desktop/mobile web + native Android + native iOS You can, right now, in most cases, just build • PWA + native iOS And once iOS Safari implements push notifications, it will be just • PWA
  • 29.
  • 30. 30
  • 31. PWA Service Worker HTTPS Responsive 31 Site is served over HTTPS To Test Use Lighthouse to verify Served over HTTPS To Fix Implement HTTPS and check out letsencrypt.org to get started. Pages are responsive on tablets & mobile devices To Test •Use Lighthouse to verify Yes to all of Design is mobile-friendly , although manually checking can also be helpful. •Check the Mobile Friendly Test To Fix Look at implementing a responsive design, or adaptively serving a viewport-friendly site.
  • 32.
  • 33. • Progressive - Work for every user, regardless of browser choice, because they are built with progressive enhancement as a core tenet. • Responsive - Fit any form factor, desktop, mobile, tablet, or whatever is next. • Connectivity independent - Enhanced with service workers to work offline or on low quality networks. • App-like - Use the app-shell model to provide app-style navigation and interactions. • Fresh - Always up-to-date thanks to the service worker update process.
  • 34. • Safe - Served via HTTPS to prevent snooping and ensure content has not been tampered with. • Discoverable - Are identifiable as “applications” thanks to W3C manifests and service worker registration scope allowing search engines to find them. • Re-engageable - Make re-engagement easy through features like push notifications. • Installable - Allow users to “keep” apps they find most useful on their home screen without the hassle of an app store. • Linkable - Easily share via URL and not require complex installation.
  • 35.
  • 36. • Lighthouse returns a Performance score between 0 and 100. 0 is the lowest possible score and 100 is the best. • The PWA audits are based on the Baseline PWA Checklist, which lists 14 requirements. • Lighthouse has automated audits for 11 of the 14 requirements. The remaining 3 can only be tested manually. • The color-coding maps to these Performance score ranges: • 0 to 49 (slow): Red • 50 to 89 (average): Orange • 90 to 100 (fast): Green
  • 37. Before Implementing PWA After Implementing PWA
  • 38. • We will deploy the developer angular app with PWA implemented (Exercise 2 ). • Create Firebase Account to Deploy Angular Application • Install the Firebase Tools using Firebase CLI • Login and Initialize Firebase project using Firebase CLI • Initialize your Firebase project run below command. • Create Production Build using the AOT / JIT Compilation • Deploying the web app in Firebase server • Testing the hosted app in participants mobile (with / without data) • Step by step guidance : https://medium.com/@saleemmalikraja/deploying-an-angular-app-to-firebase-hosting- 18f99c9d5722 38
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49. • Cross Browser Support : While Chrome, Opera, and Samsung’s android browser supports PWA, IE, Edge and Safari are yet to extend their support. • Limited Functionality: PWA doesn’t have support for any hardware that is not supported by HTML5 (https://whatwebcando.today/) • Cross Application Login Support : Native apps have the capability to talk to other apps and authenticate logins (Facebook, Twitter, Google). As a webpage, PWA doesn’t have the capability to communicate with other apps installed. 49
  • 50. • https://medium.com/@saleemmalikraja/angular-pwa-2ddc3cccd090 • https://medium.com/dev-channel/why-progressive-web-apps-vs-native-is-the-wrong-question-to-ask-fb8555addcbb • https://developers.google.com/web/progressive-web-apps/ • https://developers.google.com/web/showcase/2017/make-my-trip • https://jakearchibald.github.io/isserviceworkerready/#moar • https://jakearchibald.com/2014/offline-cookbook/ 50

Notes de l'éditeur

  1. Src: https://www.slideshare.net/mywipl/why-use-https-instead-of-http
  2. Src : https://it.goodbarber.com/blog/progressive-web-app-tutto-quello-che-bisogna-sapere-a575/
  3. https://www.pwastats.com/
  4. Src: https://ionicframework.com/docs/developer-resources/progressive-web-apps/
  5. https://www.pwastats.com/
  6. Src: https://ionicframework.com/docs/developer-resources/progressive-web-apps/
  7. https://www.pwastats.com/
  8. https://developers.google.com/web/showcase/2017/ola
  9. https://developers.google.com/web/showcase/2017/ola
  10. Src: https://medium.com/dev-channel/a-pinterest-progressive-web-app-performance-case-study-3bd6ed2e6154
  11. Src:https://14islands.com/blog/2017/10/25/pwa-what-why-and-how/
  12. https://www.pwastats.com/
  13. Src : https://it.goodbarber.com/blog/progressive-web-app-tutto-quello-che-bisogna-sapere-a575/
  14. Src:https://14islands.com/blog/2017/10/25/pwa-what-why-and-how/