About a year ago, we started using Progressive Web Apps (PWAs). The idea behind PWA was to replace native mobile apps. In this talk, I will show you what is possible to build with PWA, what kind of limitations exist, and what we learned in our journey. Along the way, you will see where progressive web apps can be a good fit for your own projects.
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
A year with progressive web apps! #webinale
1. A year with progressive web
apps!
Antonio Perić-Mažar, Locastic
06.04.2019., #webinale
2. Antonio Perić-Mažar
CEO @ Locastic
Co-Founder @ Tinel Meetup
Co-Founder @ Blockada
antonio@locastic.com
@antonioperic
3. Locastic
• We help clients create amazing web and mobile apps (since 2011)
• mobile development
• web development
• UX/UI
• Training and Consulting
• Shift Conference, Symfony Croatia
• www.locastic.com t: @locastic
17. “I don't care how many kick-ass Visio architecture diagrams
you have; as far as the user is concerned, the UI is the
application. I know UI US HARD, but you have to build an
impressive UI if you want to be taken seriously. Give your UI
the high priority it deserves.”
Jeff Atwood, Coding Horror blog
18. “I don't care how many kick-ass Visio architecture diagrams
you have; as far as the user is concerned, the UI is the
application. I know UI US HARD, but you have to build an
impressive UI if you want to be taken seriously. Give your UI
the high priority it deserves.”
Jeff Atwood, Coding Horror blog
21. “A Progressive Web App uses
modern web capabilities to deliver
an app-like user experience.”
22. “A Progressive Web App uses
modern web capabilities to deliver
an app-like user experience.”
23. PWA is:
• Progressive - Works for every user, regardless of browser choice because it's
built with progressive enhancement as a core tenet.
• Responsive - Fits 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 - Feels like an app, because the app shell model separates the
application functionality from application content .
• Fresh - Always up-to-date thanks to the service worker update process.
24. PWA is:
• Safe - Served via HTTPS to prevent snooping and to ensure content hasn't been
tampered with.
• Discoverable - Is identifiable as an "application" thanks to W3C manifest and
service worker registration scope, allowing search engines to find it.
• Re-engageable - Makes re-engagement easy through features like push
notifications.
• Installable - Allows users to add apps they find most useful to their home
screen without the hassle of an app store.
• Linkable - Easily share the application via URL, does not require complex
installation.
34. Integrated
• User should not reach browser to reach your app
• They should be able to interact same as with any other
app on their device
• They expect to have all possibilities as other apps
• Users should be able to start app from their home
screen
40. Broken experience
• Required user interaction
• Where it will start?
• Would it work offline?
https://medium.com/@saigeleslie/how-to-create-a-progressive-web-app-with-react-in-5-mins-or-less-3aae3fe98902
41. Web manifest
• Simple JSON file
• Tell browsers about your app and how it should behave once
app is ‘installed’
• Having manifest is required to show add to home screen pop-up
• Works for desktop and mobile apps (chrome)
• https://manifest-validator.appspot.com/
• https://app-manifest.firebaseapp.com/
62. Reliable
• The quality of a network connection can be affected by a number of factors such as:
• Poor coverage of a provider.
• Extreme weather conditions.
• Power outages.
• Users travelling into “dead zones” such as buildings that block their network
connections.
• Travelling on a train and going through a tunnel.
• Internet connection is managed by a third party and time boxed when it will be
active or inactive like in an airport or hotel.
• Cultural practises that require limited or no internet access at specific times or days.
63. Reliable
• We need instant loading offline
• 60% of mobile connection is 2G
• Fast Application is UX
• 14 sec to load average website on 4g
• 19 sec to load average website on 3G
68. Service Workers
• Script that browser runs in background, separated
from web page
• It is Javascript worker, so it cannot access to DOM
directly
• Service worker is a programmable network proxy,
allowing you to control how network requests from
your page are handled.
69. Service Workers
• It's terminated when not in use, and restarted when
it's next needed, so you cannot rely on global state
within a service worker's onfetch and onmessage
handlers.
• Service workers make extensive use of promises
• Service worker is for second load
71. Register a Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration)
{
// Registration was successful
console.log('ServiceWorker registration successful with scope: ',
registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
72.
73. Service workers Events
• On install - as a dependency
• On install - not as a dependency
• On activate
• On user interaction
• On network response
• Stale-while-revalidate
• On push message
• On background-sync
77. Update Service Worker
• Update your service worker JavaScript file. When the user navigates to your
site, the browser tries to redownload the script file that defined the service
worker in the background. If there is even a byte's difference in the service
worker file compared to what it currently has, it considers it new.
• Your new service worker will be started and the install event will be fired.
• At this point the old service worker is still controlling the current pages so the
new service worker will enter a waiting state.
• When the currently open pages of your site are closed, the old service worker
will be killed and the new service worker will take control.
• Once your new service worker takes control, its activate event will be fired.
84. SW: Serving suggestions - responding to requests
• Cache only
• Network only
• Cache, falling back to network
• Cache & network race
• Network falling back to cache
• Cache then network
• Generic fallback
95. Reliable conclusion
• Think how you design for the success, failure and instability of a
network connection
• Data may be expensive, so be considerate to the user
• Make sure performance is part of your design process and UX
• Try to provide offline by default if your app doesn't require much
data
• Inform users of their current state and of changes in states
• https://serviceworke.rs/ - different examples
99. Engaging
• Charming and Attractive
• Shift way how we think in patterns and designs from
web patterns to some native patterns
• Push notifications (browser doesn’t need to be
opened)
• Push Notification API
118. Cut load times from 11.91 to 4.69
seconds
90% smaller than Native Android App
https://medium.com/@addyosmani/a-tinder-progressive-web-app-performance-
case-study-78919d98ece0
Tinder