SlideShare a Scribd company logo
BUILDING A PWA
F O R E V E R Y O N E W H O I S S C A R E D TO. . .
FOOD TIPS
DO EAT GUMBO
• Chicken and Sausage
• Seafood
EAT BOUDIN!
DON’T GOOGLE
BOUDIN!
JUST EAT IT!
T R U S T M E !
RAYMOND CAMDEN
• Senior Developer Advocate for Auth0 Extend
• Auth0 Extend, serverless, web and Enterprise Cat
demos
• Blogging at raymondcamden.com
• Tweeting at @raymondcamden
THE PLAN
• Cover the basics of PWAs
• Show an example
• Do this in <50 minutes
THE GUIDE
• By: Tal Ater
• http://shop.oreilly.com/product/06
36920052067.do
WHAT THE HECK IS PWA?
Progressive Web App
OK - BUT *WHAT* IS IT?
• A term
• Coined by Frances Berriman and Alex Russell in 2015
• Set of Guidelines
• Technical Baseline
GUIDELINES
• Progressive
• Responsive
• Works offline, or in poor network conditions
• App-like
• Fresh
• Safe
• Discoverable
• Re-engageable
• Installable
• Linkable
Source: https://en.wikipedia.org/wiki/Progressive_web_app
THE TECH STACK
• Manifest
• Service Workers
• App Shell
MANIFEST
• "Web App Manifest"
• Just a JSON file (woot!)
• Allows for "installable" web apps
• Controls behavior when launched
MANIFEST
• The name (as it appears in the shortcut)
• Icons (of various sizes)
• Splash screen and colors (bg and toolbar)
• Chrome
• Forced Orientation
• The starting URL (handy for passing a param to note the launch)
– https://(something)/index.html?utm_source=homescreen
ADDING TO HTML
• <link rel="manifest" href="/manifest.json">
SAMPLE
DEMO
• Show manifest1 and 2
(AUTO) ADD TO HOME
• AKA Web Install Banners
• *Current* criteria is:
– manifest with short_name, name, 192x192 icon (png only), start_url
– service worker
– https
– "Meets a site engagement heuristic defined by Chrome (this is regularly being changed)."
• Event is fired: beforeinstallprompt
• Details: https://developers.google.com/web/fundamentals/app-install-banners/
OLD SCHOOL ADD TO HOMESCREEN
WHAT IT LOOKS LIKE
THANKS IOS
• Doesn't support manifest :(
• But you can configure...
• https://developer.apple.com/library/content/doc
umentation/AppleApplications/Reference/Safari
WebContent/ConfiguringWebApplications/Confi
guringWebApplications.html
SERVICE
WORKERS
SERVICE WORKERS - INTRO
• JavaScript
• A script registered via a script
• Now - forget everything you know about <script>
"REGULAR" JS
• You load foo.html
• foo.html is all like <script src="ftw_js_is_awesome_unicorns.js"></script>
• Code executes while the tab (window) is "alive"
• Close the tab and ftw_js_is_awesome_unicorns.js goes bye bye
SERVICE WORKER JS
• Runs in parallel to pages in it's scope
• Can't actually do anything the first time it loads
• Can run when you're not even on the page
• Can intercept every single network request (to be clear, not just XHR)
• Can work with the browser cache
• Can fire off notifications while you're away (and you totally won't abuse this)
• Can respond to push notifications (and you totally won't abuse this)
• Can help you sync data
• Can't touch the DOM
MORE SERVICE WORKER
• You can (and must) check for support
• Requires https, but localhost is ok
• They have a life cycle
• Devtools will be very, very helpful
INSTALLING THE SW
DEMO
• Show sw1, debugging
CACHING!
• CacheStorage API (LINK)
• Keyed by name (this is how you version)
• Ability to add one or multiple URLs
• Ability to read from the cache (and delete)
EXAMPLE
Source: https://developers.google.com/web/fundamentals/primers/service-workers
EXAMPLE
Source: https://developers.google.com/web/fundamentals/primers/service-workers
DEMO
• Show sw2 (just fetch handler) and sw3
EXCEPT...
• You want to change a file
• You only want to use the cache if offline
• You want some mix of things where you use the cache first then network but then
sometimes you want to hit the network first and then cache and oh yeah maybe you
want to use the cache and that's cool but maybe you want to hit the network in the
background and passively update stuff and oh my god does this end?
GOOD NEWS/BAD NEWS
• Good News: Caching Strategies exist
• Bad News: You're responsible for figuring it out
• See "The Offline Cookbook" -
https://developers.google.com/web/fundamentals/instant-and-offline/offline-
cookbook/
EXCEPT ROUND TWO...
• iOS - no support for Service Workers
• But officially "in development" for WebKit
• AppCache
BACKGROUND SYNC
• Another ServiceWorker feature
• App js tells SW js - "hey, start syncing Foo"
• SW says - "Ok, no problem. I'll get around to it."
• SW will try to do Foo (you write the logic)
• If it fails, it will try again (and again...)
• Finally, it will try one last time and *tell* you as well
• https://developers.google.com/web/updates/2015/12/background-sync
EXAMPLE
EXAMPLE
PUSH NOTIFICATIONS
• Two APIs - Push and Notification
• Notification - https://developer.mozilla.org/en-US/docs/Web/API/notification
• Request permission to show a notification
• You can show it
EXAMPLE
NOTIFICATIONS
NOTIFICATIONS
PUSH
• User subscribes to push messaging (two step process)
• Your server sends a message to central Message server
• Messaging server talks to Service Worker
• Service Worker does whatever (probably Notification)
THANKS APPLE!
• https://developer.apple.com/notifications/safari-push-notifications/
EXAMPLE (MINUS 99%)
STUFF I DIDN'T COVER
• ServiceWorker to browser communication
• Client-side storage
RESOURCES
• https://developer.mozilla.org/en-US/Apps/Progressive
• https://developers.google.com/web/progressive-web-apps/
• https://jakearchibald.github.io/isserviceworkerready/
• https://developers.google.com/web/tools/lighthouse/
• https://pwastats.com
• https://pwa.rocks/
LIGHTHOUSE
JUST BUY THIS
LAST
DEMO
C O N F E R E N C E S
CONFERENCE "APPS"
• Web, not native
• Because - duh
• No marketing, just text
• Works offline
• That's it.
H T T P S : / / C F J E D I M A S T E R . G I T H U B . I O /
I C E C O N F D E M O /
T H E M O S T AW E S O M E D E M O E V E R
SO – ABOUT THE
APPLE IN THE
ROOM...
SAFARI AND PWAS
• Supported in betas for macOS (really, we’re calling it this now?) and iOS
• Service Workers (Caching) and App Manifests
• No Push or Sync
• And it gets better: https://medium.com/@firt/pwas-are-coming-to-ios-11-3-cupertino-
we-have-a-problem-2ff49fd7d6ea
ANY QUESTIONS?
• Email me at raymondcamden@gmail.com
• Visit my awesome blog at raymondcamden.com
• Follow my awesome Twitter account at @raymondcamden

More Related Content

What's hot

What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
Susan Winters
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
Stewart Ritchie
 
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Eddie Lau
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Pablo Godel
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!
Hans Kuijpers
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
Derek Jacoby
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker Caching
Chris Love
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)Nicholas Zakas
 
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nlJoomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Philip Locke
 
State of the resource timing api
State of the resource timing apiState of the resource timing api
State of the resource timing api
Aaron Peters
 
Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015 Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015
Maurizio Pelizzone
 
Getting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workersGetting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workers
Flumes
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
Alex S
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesSteve Souders
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
Steve Souders
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web SitesSteve Souders
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
욱진 양
 
Design+Performance Velocity 2015
Design+Performance Velocity 2015Design+Performance Velocity 2015
Design+Performance Velocity 2015
Steve Souders
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
Derek Jacoby
 

What's hot (20)

What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
 
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker Caching
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
 
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nlJoomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
 
State of the resource timing api
State of the resource timing apiState of the resource timing api
State of the resource timing api
 
Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015 Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015
 
Getting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workersGetting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workers
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web Sites
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
 
Design+Performance Velocity 2015
Design+Performance Velocity 2015Design+Performance Velocity 2015
Design+Performance Velocity 2015
 
Oscon 20080724
Oscon 20080724Oscon 20080724
Oscon 20080724
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 

Similar to Building a PWA - For Everyone Who Is Scared To

Into the Box 2018 Building a PWA
Into the Box 2018 Building a PWA Into the Box 2018 Building a PWA
Into the Box 2018 Building a PWA
Ortus Solutions, Corp
 
Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011
Brian Ritchie
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Stapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San FranciscoStapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San Francisco
Christian Heilmann
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
Jeremy Likness
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so good
Chris Love
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
Sander Mangel
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
George Wilson
 
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
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
John McCaffrey
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
Excella
 
Frontend State of the union
Frontend State of the unionFrontend State of the union
Frontend State of the union
Filip Bruun Bech-Larsen
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest API
Brian Layman
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
Andreas Grabner
 
SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)
Matthew J. Bailey , MCT
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
Julian Simpson
 
Freelancer Weapons of mass productivity
Freelancer Weapons of mass productivityFreelancer Weapons of mass productivity
Freelancer Weapons of mass productivity
Gregg Coppen
 
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Marie Smith
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
Nick Josevski
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
edm00se
 

Similar to Building a PWA - For Everyone Who Is Scared To (20)

Into the Box 2018 Building a PWA
Into the Box 2018 Building a PWA Into the Box 2018 Building a PWA
Into the Box 2018 Building a PWA
 
Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Stapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San FranciscoStapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San Francisco
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so good
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 
Frontend State of the union
Frontend State of the unionFrontend State of the union
Frontend State of the union
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest API
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
 
SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)SharePoint Framework 101 (SPFx)
SharePoint Framework 101 (SPFx)
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Freelancer Weapons of mass productivity
Freelancer Weapons of mass productivityFreelancer Weapons of mass productivity
Freelancer Weapons of mass productivity
 
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 

More from Raymond Camden

Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
Raymond Camden
 
Rapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoopRapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoop
Raymond Camden
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
Raymond Camden
 
Hybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirstHybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirst
Raymond Camden
 
Introduction to Cordova
Introduction to CordovaIntroduction to Cordova
Introduction to Cordova
Raymond Camden
 
Static Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 BackStatic Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 Back
Raymond Camden
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
Raymond Camden
 
The Other Dev Tools
The Other Dev ToolsThe Other Dev Tools
The Other Dev Tools
Raymond Camden
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
Raymond Camden
 
ColdFusion 10
ColdFusion 10ColdFusion 10
ColdFusion 10
Raymond Camden
 

More from Raymond Camden (10)

Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Rapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoopRapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoop
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 
Hybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirstHybrid Mobile Development and MobileFirst
Hybrid Mobile Development and MobileFirst
 
Introduction to Cordova
Introduction to CordovaIntroduction to Cordova
Introduction to Cordova
 
Static Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 BackStatic Sites - Bringing Web 1.0 Back
Static Sites - Bringing Web 1.0 Back
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
The Other Dev Tools
The Other Dev ToolsThe Other Dev Tools
The Other Dev Tools
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
ColdFusion 10
ColdFusion 10ColdFusion 10
ColdFusion 10
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Building a PWA - For Everyone Who Is Scared To

  • 1. BUILDING A PWA F O R E V E R Y O N E W H O I S S C A R E D TO. . .
  • 2.
  • 4.
  • 5. DO EAT GUMBO • Chicken and Sausage • Seafood
  • 6.
  • 9. JUST EAT IT! T R U S T M E !
  • 10. RAYMOND CAMDEN • Senior Developer Advocate for Auth0 Extend • Auth0 Extend, serverless, web and Enterprise Cat demos • Blogging at raymondcamden.com • Tweeting at @raymondcamden
  • 11. THE PLAN • Cover the basics of PWAs • Show an example • Do this in <50 minutes
  • 12. THE GUIDE • By: Tal Ater • http://shop.oreilly.com/product/06 36920052067.do
  • 13. WHAT THE HECK IS PWA? Progressive Web App
  • 14. OK - BUT *WHAT* IS IT? • A term • Coined by Frances Berriman and Alex Russell in 2015 • Set of Guidelines • Technical Baseline
  • 15. GUIDELINES • Progressive • Responsive • Works offline, or in poor network conditions • App-like • Fresh • Safe • Discoverable • Re-engageable • Installable • Linkable Source: https://en.wikipedia.org/wiki/Progressive_web_app
  • 16. THE TECH STACK • Manifest • Service Workers • App Shell
  • 17. MANIFEST • "Web App Manifest" • Just a JSON file (woot!) • Allows for "installable" web apps • Controls behavior when launched
  • 18. MANIFEST • The name (as it appears in the shortcut) • Icons (of various sizes) • Splash screen and colors (bg and toolbar) • Chrome • Forced Orientation • The starting URL (handy for passing a param to note the launch) – https://(something)/index.html?utm_source=homescreen
  • 19. ADDING TO HTML • <link rel="manifest" href="/manifest.json">
  • 22. (AUTO) ADD TO HOME • AKA Web Install Banners • *Current* criteria is: – manifest with short_name, name, 192x192 icon (png only), start_url – service worker – https – "Meets a site engagement heuristic defined by Chrome (this is regularly being changed)." • Event is fired: beforeinstallprompt • Details: https://developers.google.com/web/fundamentals/app-install-banners/
  • 23. OLD SCHOOL ADD TO HOMESCREEN
  • 25.
  • 26. THANKS IOS • Doesn't support manifest :( • But you can configure... • https://developer.apple.com/library/content/doc umentation/AppleApplications/Reference/Safari WebContent/ConfiguringWebApplications/Confi guringWebApplications.html
  • 28. SERVICE WORKERS - INTRO • JavaScript • A script registered via a script • Now - forget everything you know about <script>
  • 29. "REGULAR" JS • You load foo.html • foo.html is all like <script src="ftw_js_is_awesome_unicorns.js"></script> • Code executes while the tab (window) is "alive" • Close the tab and ftw_js_is_awesome_unicorns.js goes bye bye
  • 30. SERVICE WORKER JS • Runs in parallel to pages in it's scope • Can't actually do anything the first time it loads • Can run when you're not even on the page • Can intercept every single network request (to be clear, not just XHR) • Can work with the browser cache • Can fire off notifications while you're away (and you totally won't abuse this) • Can respond to push notifications (and you totally won't abuse this) • Can help you sync data • Can't touch the DOM
  • 31. MORE SERVICE WORKER • You can (and must) check for support • Requires https, but localhost is ok • They have a life cycle • Devtools will be very, very helpful
  • 33. DEMO • Show sw1, debugging
  • 34. CACHING! • CacheStorage API (LINK) • Keyed by name (this is how you version) • Ability to add one or multiple URLs • Ability to read from the cache (and delete)
  • 37. DEMO • Show sw2 (just fetch handler) and sw3
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43. EXCEPT... • You want to change a file • You only want to use the cache if offline • You want some mix of things where you use the cache first then network but then sometimes you want to hit the network first and then cache and oh yeah maybe you want to use the cache and that's cool but maybe you want to hit the network in the background and passively update stuff and oh my god does this end?
  • 44. GOOD NEWS/BAD NEWS • Good News: Caching Strategies exist • Bad News: You're responsible for figuring it out • See "The Offline Cookbook" - https://developers.google.com/web/fundamentals/instant-and-offline/offline- cookbook/
  • 45. EXCEPT ROUND TWO... • iOS - no support for Service Workers • But officially "in development" for WebKit • AppCache
  • 46. BACKGROUND SYNC • Another ServiceWorker feature • App js tells SW js - "hey, start syncing Foo" • SW says - "Ok, no problem. I'll get around to it." • SW will try to do Foo (you write the logic) • If it fails, it will try again (and again...) • Finally, it will try one last time and *tell* you as well • https://developers.google.com/web/updates/2015/12/background-sync
  • 49. PUSH NOTIFICATIONS • Two APIs - Push and Notification • Notification - https://developer.mozilla.org/en-US/docs/Web/API/notification • Request permission to show a notification • You can show it
  • 53. PUSH • User subscribes to push messaging (two step process) • Your server sends a message to central Message server • Messaging server talks to Service Worker • Service Worker does whatever (probably Notification)
  • 56. STUFF I DIDN'T COVER • ServiceWorker to browser communication • Client-side storage
  • 57. RESOURCES • https://developer.mozilla.org/en-US/Apps/Progressive • https://developers.google.com/web/progressive-web-apps/ • https://jakearchibald.github.io/isserviceworkerready/ • https://developers.google.com/web/tools/lighthouse/ • https://pwastats.com • https://pwa.rocks/
  • 60. LAST DEMO C O N F E R E N C E S
  • 61. CONFERENCE "APPS" • Web, not native • Because - duh • No marketing, just text • Works offline • That's it.
  • 62. H T T P S : / / C F J E D I M A S T E R . G I T H U B . I O / I C E C O N F D E M O / T H E M O S T AW E S O M E D E M O E V E R
  • 63. SO – ABOUT THE APPLE IN THE ROOM...
  • 64. SAFARI AND PWAS • Supported in betas for macOS (really, we’re calling it this now?) and iOS • Service Workers (Caching) and App Manifests • No Push or Sync • And it gets better: https://medium.com/@firt/pwas-are-coming-to-ios-11-3-cupertino- we-have-a-problem-2ff49fd7d6ea
  • 65. ANY QUESTIONS? • Email me at raymondcamden@gmail.com • Visit my awesome blog at raymondcamden.com • Follow my awesome Twitter account at @raymondcamden

Editor's Notes

  1. Note - I'll share more resources at the end
  2. Progressive is a fancy way of saying we add features that enhance the experience for people who support it and do NOT break for people who don't. The "net result" for that is we can use kick butt new features for the browsers because we know - absolutely - that if you don't support them - you can still use the site w/o any problem at all. I'm an old guy and I can remember years of "oh, this browser supports X but I can't use it because it's only available 15% of the time" - and I love being able to kinda say "so what" to that. Web - I really hope I don't have to explain what the web is. App - and here's the part where I disagree - strongly. I dislike the fact that a lot - not all - but a lot of discussions about PWAs focus on "web apps". Things like To Do lists or maybe your banking account. You can absolutely make use of PWA principles for non "appy" type stuff. So for example, the app I'm demonstrating at the end is a content site. Not an "app" at all. And that's totally fine. Basically I want you to think of the things we're covering today as improvements you can do to *any* site.
  3. a term! yes - that's probably kinda dumb, but in some ways, this is a bit like how "Ajax apps" and "web 2.0" was a thing for a while. We used it as a way of describing apps that used certain technologies (like XHR) to make for better sites Two people There are a set of guidelines that a PWA *should* follow and I'll discuss them in the next slide On top of that - there is also a set of 4 baselines that Russel used later as a "must" have. I'm probably not going to cover that because I don't want you to go ino this thinking, wow I did 3 of the 4 things and I don't have a PWA - I am a horrible, horrible, person. Heck no. If you do ONE thing to make your site better than you should be very HAPPY about that and don't use an arbitrary list as a marker for failure or success.
  4. Progressive - we covered this already - basically don't break for older browsers (legacy) Responsive - looks good on mobile Works offline - multiple thing here to consider but note the bold text - there is MORE than just online, offline App-like - im going to kinda throw my hands up here and say "take that as you will" - I've already discussed my thoughts about "app vs content" sites and I think if your PWA looks like a blog because it IS a blog, that's ok with me Fresh - basically not serving stale content - we'll talk about that when we cover network crap and service workers in a ssec Safe - https. Done. DO it. It's free. Just - do it. And the tech I'm discussing today simply doesn't work on http. Period (although note you can run it on localhost) Discoverable refers to manifest files that identy a PWA to the system as something the user can add to their home screen - that's a tech we'll cover called manifests Re-Enagleable simply means the PWA brings you back and that's done via push Installable means being able to add to the home screen which comes back to manifests Linkable - URLs - the good ole tech - in theory you don't even have to think about this. If you ARE building an app though you need to think about app state and things like - if Im on tab 2 of my app - can I share that URL with you and when you load you get tab 2 as well..
  5. So what does our tech stack look like? The first is the manifest - a simple JSON file that describes our app at a meta level. This is what will allow us to "add to desktop" and get things like icons and the such. Service Workers are the main way we'll work with the network. This is INCREDIBLY powerful. I'll be describing how they work, what they can do, but there is no way in heck I'll be able to go over every single aspect of it. Rather I'm going to give you the lay of the land so to speak. To be honest, that's more appropriate anyway right? As a developer, I want to do know I can do X with Y and I'll Google for the actual code when I need it later. And then App Shell.... so again - I've made my feelings known on this. If you are building an app and using a modern framework like React, Angular, or Vue, then you have this baked in (technically not with Vue, you have to add stuff above the base support, but that's ok cuz Vue is awesome). So going back to what your working with - if it is an app - you will want to ensure the base HTML, CSS< etc loads immediately and content loads into the shell as you request stuff.
  6. technically the web app manifest luckily - just a JSON file that you'll link to from your html It allows you to create an "installable" web app. Now installable is in quotes for a reason. Your web site isn't being "installed" like a native app on your device. Rather, it's like a "super" bookmark - you have control over how the web page runs when launched from the manifest - by control I'm talking mainly about how it looks - it's not magically adding native like features ala Apache Cordova or Ionic.
  7. In terms of what you can control with the manifest first is the name as it will appear on the home screen of the device, so your blog may be: The Many Wonderful Adventures of Raymond Camden and his too many kids - but you probably want something like "Ray Camden" when saved to the home scree you can also specify icons for different device type resolutions splash CHrome of what you see - not the browser - basically two choices with the default being a regular browse experience or full screen (what the manifest calls 'standalone') finally - you can specify a starting url - and the typical use case here is to add a query param like
  8. Ok, I've got two demos here. Show manifest1 and manifest2 SHow manifest one, show Chrome dev tools
  9. Unfortunately - this isn't enough to get to the "Add to Home Screen" functionality event lets you determine if the user added it or did not, AND actually lets you defer it. So if you don't want Chrome to auto prompt, you can actually save the event and fire it yourself later, like via a button click
  10. To be clear - this is for a MANUAL test
  11. First off - it's JavaScript. woot! We all know JS, right? Secondly - this is a script (written in JS) that is registered via a script (written in JS). So basically what this means is you'll use your regular JS, like your app.js that you have for your site, and you'll say, over here I have serviceworkerawesome.js, I want you to use this as a SW Notice I have the script tag - cuz we're not talking about some new language - instead were talking about JS that behaves in a way you aren't used to
  12. SW have an idea of scope, basically a way of saying, I want to use a sw for ALL of foo.com, which is what you would normally do, but you CAN, if you choose, use them in a subdirectory, like /app or somesuch. But here's the thing - when registered, they always run And if you leave your site and go to CNN.com, they still live. this is how stuff like push notifications can work to be clear, it is NOT persistent - so you can't store data in a persistent way there (but the browser already supports that) they are -in essence - a proxy server flip side is - they can't touch the DOM - there's ways around this
  13. progressive - dont forget it chump Second thing to note is - they have a life cycle you load a SW - and it becomes after you edit the SW to add some function you reload - and the new SW does NOT become available immediately- that's cuz you have one installed already that was running when the page loaded. It will only load when you've closed down the browser or navigated *away* from the site (technically scope) You CAN use devtools to get around that - thank god
  14. Reminder about it being in your 'main' JS
  15. SHow sw1, show the debugging of the SW It does nothing but it's there - woot
  16. First demo sw2 OFFLINE purpose is - showing the proxy effect then show sw3 showing it working show add to homescreen in desktop
  17. Great! We have a cache It works offline
  18. Tags are registered ONCE only
  19. Notification - NOT just a PWA thing Request permission Show a modal
  20. icon buttons vibration tag == silent update (plus renotify - shake) stuff not supported - wake screen, sound, silent
  21. Note - I'll share more resources at the end