@DvdChavarri
@FranQuiJap
They are experiences that combine the best of the web and the best of apps. They are useful to users from the very first visit in a browser tab, no install required.
As the user builds a relationship with these apps through repeat use, they make the candy shell even sweeter - loading very fast on slow network connections (thanks to service worker),
sending relevant Push Notifications and having a first-class icon on the user's home screen that can load them as fullscreen app experiences.
They can also take advantage of smart web app install banners.
Progressive Web Apps are user experiences that have the reach of the web, and are:
This new level of quality allows Progressive Web Apps to earn a place on the user's home screen.
When launched from the user’s home screen, service workers enable a Progressive Web App to load instantly, regardless of the network state.
A service worker is like a client-side proxy, written in JavaScript
and puts you in control of the cache and how to respond to resource requests.
By pre-caching key resources you can eliminate the dependence on the network, ensuring an instant and reliable experience for your users.
53% of users will abandon a site if it takes longer than 3 seconds to load! And once loaded, they expect them to be fast, no janky scrolling or slow to respond interfaces.
PWA are installable and live on the users home screen, without the need for an app store. They offer an immersive full screen experience with help from a web app manifest file and can even re-engage users with web push notifications.
The Web App Manifest allows you to control how your app appears and how it's launched. You can specify icons for the home screen and splash screen which is shown while the app is loading.
Which page is loaded when the app is launched, screen orientation, even whether to show the browser chrome or not.
Lighthouse is an open-source, automated tool for improving the quality of your web apps.
Lighthouse can be run as a Chrome Extension, from the command line, or used programmatically as a Node module. You give Lighthouse a URL that you want to audit, it runs a barrage of tests against the page, and then it generates a report on how well the page did. From here you can use the failing tests as indicators on what you can do to improve your app.
In 2015, designer Frances Berriman and Google Chrome engineer Alex Russell coined the term "Progressive Web Apps" to describe apps taking advantage of new features supported by modern browsers, including Service Workers and Web App Manifests, that let users upgrade web apps to be first-class applications in their native OS.
According to Google Developers, these characteristics are:
To help teams create the best possible experiences we've put together this checklist which breaks down all the things we think it takes to be a Baseline PWA, and how to take that a step further with an Exemplary PWA by providing a more meaningful offline experience, reaching interactive even faster and taking care of many more important details.
Site is served over HTTPS
Pages are responsive on tablets & mobile devices
The start URL (at least) loads while offline
Metadata provided for Add to Home screen
First load fast even on 3G
Site works cross-browser
Page transitions don't feel like they block on the network
Each page has a URL
Indexability & social
User experience
Performance
Caching
Push Notifications
Progressive Web Apps are an enhancement of existing web technology. As such, they do not require separate bundling or distribution.
Publication of a Progressive Web App is as it would be for any other web page. As of 2016, Progressive Web Apps are implemented in the Chrome browser, but more browsers may support the features needed in the future.
The technical baseline criteria for a site to be considered a Progressive Web App:
The web app manifest is a simple JSON file that gives you, the developer, the ability to control how your app appears to the user in the areas that they would expect to see apps (for example the mobile home screen), direct what the user can launch and more importantly how they can launch it.
Using the web app manifest, your web app can:
{
"name": "Weather",
"short_name": "Weather",
"icons": [{
"src": "images/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "images/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}],
"start_url": "/index.html",
"display": "standalone",
"background_color": "#3E4EB8",
"theme_color": "#2F3BA2"
}
Tell the browser about your manifest file
Now add the following line to the bottom of the <head> element in your index.html file:
<link rel="manifest" href="/manifest.json">
Best Practices
Place the manifest link on all your site's pages, so it will be retrieved by Chrome right when the user first visits, no matter what page they land on.
The short_name is preferred on Chrome and will be used if present over the name field.
Define icon sets for different density screens. Chrome will attempt to use the icon closest to 48dp, for example, 96px on a 2x device or 144px for a 3x device.
Remember to include an icon with a size that is sensible for a splash screen and don't forget to set the background_color.
Tell the browser about your manifest file
Now add the following line to the bottom of the <head> element in your index.html file:
<link rel="manifest" href="/manifest.json">
Native mobile apps deliver rich experiences and high performance, purchased at the expense of storage space, lack of real-time updates, and low search engine visibility. Traditional web apps suffer from the inverse set of factors: lack of a native compiled executable, along with dependence on unreliable and potentially slow web connectivity. Service Workers are used in an attempt to give progressive web apps the best of both these worlds.
Technically, Service Workers provide a scriptable network proxy in the web browser to manage the web/HTTP requests programmatically. The Service Workers lie between the network and device to supplement the content. They are capable of using the cache mechanisms efficiently and allow error-free behavior during offline periods.
Service workers essentially act as proxy servers that sit between web applications, and the browser and network (when available). They are intended to (amongst other things) enable the creation of effective offline experiences, intercepting network requests and taking appropriate action based on whether the network is available and updated assets reside on the server. They will also allow access to push notifications and background sync APIs.
An application shell (or app shell) architecture is one way to build a Progressive Web App that reliably and instantly loads on your users' screens, similar to what you see in native applications.
The app "shell" is the minimal HTML, CSS and JavaScript required to power the user interface and when cached offline can ensure instant, reliably good performance to users on repeat visits. This means the application shell is not loaded from the network every time the user visits. Only the necessary content is needed from the network.
The app shell is similar to the bundle of code that you’d publish to an app store when building a native app. It is the skeleton of your UI and the core components necessary to get your app off the ground, but likely does not contain the data.
Building a PWA does not mean starting from scratch. If you are building a modern single-page app, then you are probably using something similar to an app shell already whether you call it that or not. The details might vary a bit depending upon which libraries or frameworks you are using, but the concept itself is framework agnostic.
An application shell architecture makes the most sense for apps and sites with relatively unchanging navigation but changing content. A number of modern JavaScript frameworks and libraries already encourage splitting your application logic from its content, making this architecture more straightforward to apply. For a certain class of websites that only have static content you can still follow the same model but the site is 100% app shell.
Reliable performance that is consistently fast. Repeat visits are extremely quick. Static assets and the UI (e.g. HTML, JavaScript, images and CSS) are cached on the first visit so that they load instantly on repeat visits. Content may be cached on the first visit, but is typically loaded when it is needed.
Native-like interactions. By adopting the app shell model, you can create experiences with instant, native-application-like navigation and interactions, complete with offline support.
Economical use of data. Design for minimal data usage and be judicious in what you cache because listing files that are non-essential (large images that are not shown on every page, for instance) result in browsers downloading more data than is strictly necessary. Even though data is relatively cheap in western countries, this is not the case in emerging markets where connectivity is expensive and data is costly.
The app shell should ideally:
The app shell keeps your UI local and pulls in content dynamically through an API but does not sacrifice the linkability and discoverability of the web. The next time the user accesses your app, the latest version displays automatically. There is no need to download new versions before using it.
Note: Add to Homescreen (sometimes abbreviated as A2HS) is another name for Web App Install Banners. The two terms are equivalent.
There are two types of app install banners: web app install banners and native app install banners. They let users quickly and seamlessly add your web or native app to their home screens without leaving the browser.
Adding app install banners is easy; Chrome handles most of the heavy lifting for you. You need to include a web app manifest file in your site with details about your app.
Chrome then uses a set of criteria and visit-frequency heuristics to determine when to show the banner.
Chrome automatically displays the banner when your app meets the following criteria:
Once you've got your web app manifest set up, you'll want to validate that it's defined correctly. You've got two approaches at your disposal. One is manual, and the other is automated.
To manually trigger the app install banner:
For automated testing of your app install banner, use Lighthouse. You can run it as a Chrome Extension or as a NPM module. To test your app, you provide Lighthouse with a specific page to audit. Lighthouse runs a suite of audits against the page and then provides the page's results in a report.
The two suites of Lighthouse audits in the screenshot below represent all of the tests that your page needs to pass to display an app install banner.
https://jakearchibald.com/2014/service-worker-first-draft/
https://developers.google.com/web/fundamentals/getting-started/codelabs/your-first-pwapp/
https://developers.google.com/web/fundamentals/getting-started/codelabs/debugging-service-workers/
https://developers.google.com/web/fundamentals/getting-started/codelabs/offline/
https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/
https://developer.mozilla.org/es/docs/Web/Manifest
https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android?hl=es-419#native