SlideShare a Scribd company logo
THE HITCHHIKER’S GUIDE TO
BUILDING A PROGRESSIVE WEB APP
Chris Nguyen
@uncompiled
The Hitchhiker's Guide to Building a Progressive Web App
https://pwa.rocks
SOURCE: https://pokedex.org
POKEDEX.ORG
The Hitchhiker's Guide to Building a Progressive Web App
PROGRESSIVE WEB APPS
● Progressive
● Responsive
● Linkable
● Fresh
● App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
PROGRESSIVE
ENHANCEMENT
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
PROGRESSIVE WEB APPS
✓ Progressive
● Responsive
● Linkable
● Fresh
● App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
RESPONSIVE
WEB DESIGN
The Hitchhiker's Guide to Building a Progressive Web App
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
● Linkable
● Fresh
● App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
LINKABLE
@slightlylate: "URLs are the web's superpower." #chromedevsummit
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
● Fresh
● App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
FRESH
CREDIT: http://www.slashfilm.com
CREDIT: Android Authority
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
● App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
APP-LIKE
APP-LIKE
● Familiar interface
● Fast screen transitions
● Smooth scrolling
● Feels native
SOURCE: https://app.ft.com
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
✓ App-like
● Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
SAFE
SAFE
● Must be served using HTTPS
● Prevents snooping or MITM attacks
● Privacy and security for users
The Hitchhiker's Guide to Building a Progressive Web App
White House OMB Memorandum 15-13
SOURCE: https://https.cio.gov
White House OMB Memorandum 15-13
SOURCE: https://https.cio.gov
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
✓ App-like
✓ Safe
● Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
DISCOVERABLE
WEB APPLICATION MANIFEST
{
"name": "My Web Application",
"short_name": "My App",
"description": "A Simple Progressive Web App",
"icons": [
...
{
"src": "launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "standalone",
"orientation": "portrait"
}
<link rel="manifest" href="/manifest.json">
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
✓ App-like
✓ Safe
✓ Discoverable
● Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
INSTALLABLE
CREDIT: https://xkcd.com/1367/
INSTALLABLE
● Multiple visits
trigger prompt
● Low friction
● No app store
SOURCE: https://www.devfestdc.rocks
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
✓ App-like
✓ Safe
✓ Discoverable
✓ Installable
● Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
RE-ENGAGEABLE
The Hitchhiker's Guide to Building a Progressive Web App
https://gauntface.github.io/simple-push-demo/
PROGRESSIVE WEB APPS
✓ Progressive
✓ Responsive
✓ Linkable
✓ Fresh
✓ App-like
✓ Safe
✓ Discoverable
✓ Installable
✓ Re-engageable
● Connectivity independent
SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
CONNECTIVITY
INDEPENDENT
The Hitchhiker's Guide to Building a Progressive Web App
MOBILE NETWORKS ARE UNRELIABLE
● LTE service isn’t always LTE
● Mobile devices constantly transfer between
antennas, 3G, LTE, and Wi-Fi
● Slow response is worse than fast connection
failure
SOURCE: https://hpbn.co
The Hitchhiker's Guide to Building a Progressive Web App
LATENCY: THE NEW WEB PERFORMANCE BOTTLENECK
SOURCE: https://www.igvita.com/2012/07/19/latency-the-new-web-performance-bottleneck/
MOBILE-FIRST WEB DEVELOPMENT
● Responsive Web Design
○ Addresses the mobile user interface
● Service Worker API
○ Addresses the mobile network
● Design for slow mobile devices and slow networks
○ It’ll be ⚡ on high-end phones and fast networks
CREDIT: MTV
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
SERVICE WORKER
● Client-side programmable network proxy
● Registered against a domain & path
○ www.devfestdc.org != images.devfestdc.org
○ www.devfestdc.org != www.devfestdc.org/js
● Intercept network requests
● Gives developers control of network failure
OFFLINE SUPPORT
(USING A SERVICE WORKER)
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
DEVFESTDC.ORG: INSTALL SERVICE WORKER
● Register a service worker for www.devfestdc.org
● Install at root scope (“/”) so it can handle the entire site
if('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/sw.js')
.then(function() { console.log('Service Worker Registered'); });
}
DEVFESTDC.ORG: CACHE ASSETS
● Inside “/sw.js”, cache all the assets
● Include all HTML, CSS, and JS required to load the site
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open('devfestdc-static-v1').then(function(cache) {
return cache.addAll(['/index.html', '/js/all.min.js', ... /* etc */ ]);
});
);
});
DEVFESTDC.ORG: RESPOND WITH CACHED ASSETS
● Inside “/sw.js”, add fetch event listener
● Respond to requests for static assets using cache
self.addEventListener('fetch', function(event) {
event.respondWith(caches.open('devfestdc-static-v1').then(function(cache) {
cache.match(event.request).then(function(response) {
return response || fetch(event.request);
});
}));
});
The Hitchhiker's Guide to Building a Progressive Web App
YEAH! IT WORKED!
(BUT SHOULD WE DO IT?)
MANAGING CACHES
● Static assets (HTML/CSS/JSS) should be optimized for caching
● If we change “/schedule-day-2/”, we need to update the cache:
caches.open('devfestdc-static-v1')
● Hard to maintain
SW-PRECACHE
https://github.com/GoogleChrome/sw-precache
The Hitchhiker's Guide to Building a Progressive Web App
PRECACHE STATIC ASSETS
● sw-precache is a node module for generating a service worker that pre-caches
resources at build time
● Can be integrated into Gulp, Grunt, Webpack or CLI-based build scripts
● Install: npm install sw-precache --save-dev
PRECACHE STATIC ASSETS
● Run sw-precache at build time
● Gulp task outputs “/sw.js”:
gulp.task('generate-service-worker', function(callback) {
var swPrecache = require('sw-precache');
swPrecache.write('build/sw.js'), {
staticFileGlobs: [app/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}']
}, callback);
});
THE WAY TO PWA
AN INCREMENTAL APPROACH
WEB APPLICATION MANIFEST
{
"name": "DevFestDC 2016",
"short_name": "DevFestDC",
"icons": [
...
{
"src": "launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait"
}
<link rel="manifest" href="/manifest.json">
APP-SHELL ARCHITECTURE
● App shell is the minimal HTML, CSS, and JavaScript
required to render the user interface
● Its first load should be extremely quick, then
immediately cached (sw-precache)
SOURCE: https://www.devfestdc.rocks/
PRPL PATTERN
● Push critical resources for the initial route
● Render initial route (as fast as possible)
● Pre-cache remaining routes
● Lazy-load and create remaining routes on demand
SOURCE: https://www.polymer-project.org/1.0/toolbox/server
SW-TOOLBOX
https://github.com/GoogleChrome/sw-toolbox
RUN-TIME CACHING
● sw-toolbox provides handlers for common caching
patterns that are useful during run-time:
○ toolbox.cacheFirst
○ toolbox.networkFirst
○ toolbox.fastest
● sw-precache can configure and include sw-toolbox
SOURCE: https://github.com/GoogleChrome/sw-toolbox
LIGHTHOUSE
https://github.com/GoogleChrome/lighthouse
AUDIT PROGRESS
● lighthouse audits Progressive Web Apps
● Uses the Chrome Debugging Protocol
● Helps find problems during development
● Available from npm or as Chrome Extension
● github.com/GoogleChrome/lighthouse
The Hitchhiker's Guide to Building a Progressive Web App
The Hitchhiker's Guide to Building a Progressive Web App
PROGRESSIVE WEB APPS
● PWAs are still websites
● Progressively enhanced
● Connectivity independent
● Mobile-first & offline-first
● https://www.devfestdc.rocks/
● github.com/GoogleChrome/sw-toolbox
● github.com/GoogleChrome/sw-precache
● github.com/GoogleChrome/lighthouse
Chris Nguyen
@uncompiled
Ad

More Related Content

What's hot (20)

Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)
Abhinav Rastogi
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
Subodh Garg
 
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
 
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Ido Green
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
Antonio Peric-Mazar
 
Pwa.pptx
Pwa.pptxPwa.pptx
Pwa.pptx
Harish Karthick
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
Bartek Igielski
 
Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web App
Ido Green
 
Progressive web apps with Angular 2
Progressive web apps with Angular 2Progressive web apps with Angular 2
Progressive web apps with Angular 2
Manfred Steyer
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
Binh Bui
 
Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!
Shelly Megan
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
WSO2
 
Next Generation Mobile Web - PWA (Progressive Web App)
Next Generation Mobile Web  - PWA (Progressive Web App)Next Generation Mobile Web  - PWA (Progressive Web App)
Next Generation Mobile Web - PWA (Progressive Web App)
Nuri Cahyono
 
Architecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web AppsArchitecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web Apps
Rasheed Waraich
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
Vinci Rufus
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
Deepak Upadhyay
 
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
Abdelrahman Omran
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystified
edynamic
 
The Next Step in Responsive - RESS
The Next Step in Responsive - RESSThe Next Step in Responsive - RESS
The Next Step in Responsive - RESS
Anthony Laurence
 
Django Deployer
Django DeployerDjango Deployer
Django Deployer
Colin Su
 
Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)
Abhinav Rastogi
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
Subodh Garg
 
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
 
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Modern Web Applications Utilizing HTML5 (Dev Con TLV 06-2013)
Ido Green
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
Bartek Igielski
 
Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web App
Ido Green
 
Progressive web apps with Angular 2
Progressive web apps with Angular 2Progressive web apps with Angular 2
Progressive web apps with Angular 2
Manfred Steyer
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
Binh Bui
 
Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!
Shelly Megan
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
WSO2
 
Next Generation Mobile Web - PWA (Progressive Web App)
Next Generation Mobile Web  - PWA (Progressive Web App)Next Generation Mobile Web  - PWA (Progressive Web App)
Next Generation Mobile Web - PWA (Progressive Web App)
Nuri Cahyono
 
Architecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web AppsArchitecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web Apps
Rasheed Waraich
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
Vinci Rufus
 
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
Abdelrahman Omran
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystified
edynamic
 
The Next Step in Responsive - RESS
The Next Step in Responsive - RESSThe Next Step in Responsive - RESS
The Next Step in Responsive - RESS
Anthony Laurence
 
Django Deployer
Django DeployerDjango Deployer
Django Deployer
Colin Su
 

Similar to The Hitchhiker's Guide to Building a Progressive Web App (20)

GDG Ibadan #pwa
GDG Ibadan #pwaGDG Ibadan #pwa
GDG Ibadan #pwa
Gbolahan Alli
 
GWT and PWA
GWT and PWAGWT and PWA
GWT and PWA
Manuel Carrasco Moñino
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
pwapresentation1-180803034649.pptxwebapps
pwapresentation1-180803034649.pptxwebappspwapresentation1-180803034649.pptxwebapps
pwapresentation1-180803034649.pptxwebapps
nagasukanya494
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
David Amend
 
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Philipp Burgmer
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Unfold UI
 
DevOps for Hackathons: DevOps without the Ops
DevOps for Hackathons: DevOps without the OpsDevOps for Hackathons: DevOps without the Ops
DevOps for Hackathons: DevOps without the Ops
Or Rosenblatt
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web App
Robert Robinson
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
Evan Mullins
 
Service workers
Service workersService workers
Service workers
Pavel Zhytko
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Gbolahan Alli
 
Google Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG BelgaumGoogle Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG Belgaum
sandeephegde
 
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
MarcinStachniuk
 
Flutter for web
Flutter for webFlutter for web
Flutter for web
rihannakedy
 
Progressive Web Apps - deep dive
Progressive Web Apps - deep diveProgressive Web Apps - deep dive
Progressive Web Apps - deep dive
Kenneth Rohde Christiansen
 
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo MeetupWordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
rtCamp
 
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
 
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
 
Progressive Web Apps - Overview & Getting Started
Progressive Web Apps - Overview & Getting StartedProgressive Web Apps - Overview & Getting Started
Progressive Web Apps - Overview & Getting Started
Gaurav Behere
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
pwapresentation1-180803034649.pptxwebapps
pwapresentation1-180803034649.pptxwebappspwapresentation1-180803034649.pptxwebapps
pwapresentation1-180803034649.pptxwebapps
nagasukanya494
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
David Amend
 
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Philipp Burgmer
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Unfold UI
 
DevOps for Hackathons: DevOps without the Ops
DevOps for Hackathons: DevOps without the OpsDevOps for Hackathons: DevOps without the Ops
DevOps for Hackathons: DevOps without the Ops
Or Rosenblatt
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web App
Robert Robinson
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
Evan Mullins
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Gbolahan Alli
 
Google Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG BelgaumGoogle Cloud Developer Challenge - GDG Belgaum
Google Cloud Developer Challenge - GDG Belgaum
sandeephegde
 
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w ...
MarcinStachniuk
 
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo MeetupWordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
rtCamp
 
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
 
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
 
Progressive Web Apps - Overview & Getting Started
Progressive Web Apps - Overview & Getting StartedProgressive Web Apps - Overview & Getting Started
Progressive Web Apps - Overview & Getting Started
Gaurav Behere
 
Ad

Recently uploaded (20)

The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Ad

The Hitchhiker's Guide to Building a Progressive Web App

  • 1. THE HITCHHIKER’S GUIDE TO BUILDING A PROGRESSIVE WEB APP Chris Nguyen @uncompiled
  • 6. PROGRESSIVE WEB APPS ● Progressive ● Responsive ● Linkable ● Fresh ● App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 14. PROGRESSIVE WEB APPS ✓ Progressive ● Responsive ● Linkable ● Fresh ● App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 17. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ● Linkable ● Fresh ● App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 19. @slightlylate: "URLs are the web's superpower." #chromedevsummit
  • 20. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ● Fresh ● App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 23. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ● App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 25. APP-LIKE ● Familiar interface ● Fast screen transitions ● Smooth scrolling ● Feels native SOURCE: https://app.ft.com
  • 28. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ✓ App-like ● Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 29. SAFE
  • 30. SAFE ● Must be served using HTTPS ● Prevents snooping or MITM attacks ● Privacy and security for users
  • 32. White House OMB Memorandum 15-13 SOURCE: https://https.cio.gov
  • 33. White House OMB Memorandum 15-13 SOURCE: https://https.cio.gov
  • 34. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ✓ App-like ✓ Safe ● Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 36. WEB APPLICATION MANIFEST { "name": "My Web Application", "short_name": "My App", "description": "A Simple Progressive Web App", "icons": [ ... { "src": "launcher-icon-4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": "/index.html", "display": "standalone", "orientation": "portrait" } <link rel="manifest" href="/manifest.json">
  • 37. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ✓ App-like ✓ Safe ✓ Discoverable ● Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 39. INSTALLABLE ● Multiple visits trigger prompt ● Low friction ● No app store SOURCE: https://www.devfestdc.rocks
  • 40. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ✓ App-like ✓ Safe ✓ Discoverable ✓ Installable ● Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 44. PROGRESSIVE WEB APPS ✓ Progressive ✓ Responsive ✓ Linkable ✓ Fresh ✓ App-like ✓ Safe ✓ Discoverable ✓ Installable ✓ Re-engageable ● Connectivity independent SOURCE: https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/
  • 47. MOBILE NETWORKS ARE UNRELIABLE ● LTE service isn’t always LTE ● Mobile devices constantly transfer between antennas, 3G, LTE, and Wi-Fi ● Slow response is worse than fast connection failure SOURCE: https://hpbn.co
  • 49. LATENCY: THE NEW WEB PERFORMANCE BOTTLENECK SOURCE: https://www.igvita.com/2012/07/19/latency-the-new-web-performance-bottleneck/
  • 50. MOBILE-FIRST WEB DEVELOPMENT ● Responsive Web Design ○ Addresses the mobile user interface ● Service Worker API ○ Addresses the mobile network ● Design for slow mobile devices and slow networks ○ It’ll be ⚡ on high-end phones and fast networks
  • 55. SERVICE WORKER ● Client-side programmable network proxy ● Registered against a domain & path ○ www.devfestdc.org != images.devfestdc.org ○ www.devfestdc.org != www.devfestdc.org/js ● Intercept network requests ● Gives developers control of network failure
  • 56. OFFLINE SUPPORT (USING A SERVICE WORKER)
  • 59. DEVFESTDC.ORG: INSTALL SERVICE WORKER ● Register a service worker for www.devfestdc.org ● Install at root scope (“/”) so it can handle the entire site if('serviceWorker' in navigator) { navigator.serviceWorker .register('/sw.js') .then(function() { console.log('Service Worker Registered'); }); }
  • 60. DEVFESTDC.ORG: CACHE ASSETS ● Inside “/sw.js”, cache all the assets ● Include all HTML, CSS, and JS required to load the site self.addEventListener('install', function(event) { event.waitUntil( caches.open('devfestdc-static-v1').then(function(cache) { return cache.addAll(['/index.html', '/js/all.min.js', ... /* etc */ ]); }); ); });
  • 61. DEVFESTDC.ORG: RESPOND WITH CACHED ASSETS ● Inside “/sw.js”, add fetch event listener ● Respond to requests for static assets using cache self.addEventListener('fetch', function(event) { event.respondWith(caches.open('devfestdc-static-v1').then(function(cache) { cache.match(event.request).then(function(response) { return response || fetch(event.request); }); })); });
  • 63. YEAH! IT WORKED! (BUT SHOULD WE DO IT?)
  • 64. MANAGING CACHES ● Static assets (HTML/CSS/JSS) should be optimized for caching ● If we change “/schedule-day-2/”, we need to update the cache: caches.open('devfestdc-static-v1') ● Hard to maintain
  • 67. PRECACHE STATIC ASSETS ● sw-precache is a node module for generating a service worker that pre-caches resources at build time ● Can be integrated into Gulp, Grunt, Webpack or CLI-based build scripts ● Install: npm install sw-precache --save-dev
  • 68. PRECACHE STATIC ASSETS ● Run sw-precache at build time ● Gulp task outputs “/sw.js”: gulp.task('generate-service-worker', function(callback) { var swPrecache = require('sw-precache'); swPrecache.write('build/sw.js'), { staticFileGlobs: [app/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}'] }, callback); });
  • 69. THE WAY TO PWA AN INCREMENTAL APPROACH
  • 70. WEB APPLICATION MANIFEST { "name": "DevFestDC 2016", "short_name": "DevFestDC", "icons": [ ... { "src": "launcher-icon-4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": "index.html", "display": "standalone", "orientation": "portrait" } <link rel="manifest" href="/manifest.json">
  • 71. APP-SHELL ARCHITECTURE ● App shell is the minimal HTML, CSS, and JavaScript required to render the user interface ● Its first load should be extremely quick, then immediately cached (sw-precache) SOURCE: https://www.devfestdc.rocks/
  • 72. PRPL PATTERN ● Push critical resources for the initial route ● Render initial route (as fast as possible) ● Pre-cache remaining routes ● Lazy-load and create remaining routes on demand SOURCE: https://www.polymer-project.org/1.0/toolbox/server
  • 74. RUN-TIME CACHING ● sw-toolbox provides handlers for common caching patterns that are useful during run-time: ○ toolbox.cacheFirst ○ toolbox.networkFirst ○ toolbox.fastest ● sw-precache can configure and include sw-toolbox SOURCE: https://github.com/GoogleChrome/sw-toolbox
  • 76. AUDIT PROGRESS ● lighthouse audits Progressive Web Apps ● Uses the Chrome Debugging Protocol ● Helps find problems during development ● Available from npm or as Chrome Extension ● github.com/GoogleChrome/lighthouse
  • 79. PROGRESSIVE WEB APPS ● PWAs are still websites ● Progressively enhanced ● Connectivity independent ● Mobile-first & offline-first ● https://www.devfestdc.rocks/ ● github.com/GoogleChrome/sw-toolbox ● github.com/GoogleChrome/sw-precache ● github.com/GoogleChrome/lighthouse Chris Nguyen @uncompiled