Progressive web apps: Better than ever
Progressive web apps (PWAs) are a great idea that hasn't caught on, but there is still hope.
On mobile devices, they look and behave like apps, but they are actually websites with a small app stub on the device. Because they are web apps, they can run on any device with a browser.
PWAs haven't made a splash in the market in the couple years since we first looked at them, but progress is being made on them, mostly at Google. Recently, Microsoft and Google released tools to make it easy to write PWAs that run on Windows, Android, and Chrome OS.
There are many significant advantages to choosing the progressive web model over the native app model, including:
- Updating the application generally involves changing files on the servers under your control. Apple and Google don't need to be involved at all. Changes go out to all users at once (assuming the users are online). In this way, they put more of the application and the management of the application in the cloud and under the direct control of its authors.
- PWAs can (usually, see caveats below) be installed, like native apps, from the app store. But they may also be installable from the browser itself, without an app store. (Why bother with the app store? A lot of users search for and find apps there.)
- The programming model is standards-based, not controlled by one vendor.
This last point is technically accurate, and yet it raises an important issue and the main problem with adopting progressive web apps today: The driving force behind PWAs is Google. The standards it is developing are all open, but some companies might view them as coming with a "not invented here" taint. Even the idea of progressive web apps was introduced by a Google software engineer, about five years ago.
In terms of market share, the companies that matter in this regard are Google, Apple, and, to a lesser degree, Microsoft. By adopting Chromium for its browser earlier this year, Microsoft went all-in with Google on PWAs, and not just by implication. Below I describe tools and operating system features Microsoft is creating to improve the PWA experience.
And then there's Apple. Apple has been adding the APIs PWA developers need to the Safari browser, as measured by the Can I Use website, but they are consistently behind Chrome and even the fading Firefox browser.
The real Apple problem for PWA developers is getting their app into the Apple App Store. Officially, Apple happily welcomes your PWA to the store; in practice, developers report roadblocks (like this, this, and this) that make it difficult to get the app approved. Apple also imposes technical limitations, such as a 50 MB caching limit, that make the PWA experience inferior. The common way to throw in the towel and get your app in the store appears to be to write a native app wrapper, often with Apache Cordova, around it.
And if you go to Apple for information about it, don't search for PWA. It considers it a Google term. PWA dev guru Max Firtman says Apple uses the terms HTML5 Apps and Homescreen webapps.
But Apple's lagging and unenthusiastic support is clearly a problem if you want to write a PWA.
Trusted Web Activities
Google has also taken non-standard measures to improve support for PWAs where it can. The main example is Trusted Web Activities (TWAs), which ease the process of making a PWA run in a full-screen window, like an app, on Android. They are specific to Chromium and Android and thus don't help developers who want PWAs to run on iOS. On a non-Chromium browser, you can still run a PWA using other programming constructs, probably a WebView, which is a web browser control embedded inside a native app.
TWAs use the Chromium browser on the system, not a separate web control embedded in the app. To update the WebView control you distributed with your app, you have to issue an update to the app. But when Chrome gets updated, either to fix bugs or add features, TWA apps automatically use the new version. It also both uses and extends Chrome's state, such as history and saved passwords.
The TWA will cryptographically verify that the app author is the content owner using Digital Asset Links, which verify that the app has rights to use the content.
Web shortcuts are menus, defined in the app manifest, that the app launcher can display to give the user options on loading the app. For instance, the Twitter PWA has shortcuts for New Tweet, Explore, Notifications, and Direct Messages. Not a major feature, but it is interesting that Windows 10 has added support for shortcuts on installed PWAs.
As an example of what this means, if you pin a PWA to the taskbar in Windows 10 and right-click on the icon, you see these menu options. This makes them more like native apps, such as Microsoft Outlook, which offers New Email Message, New Appointment, etc., when you right-click. Windows offers these options whether you install the app from Chrome or the new Chromium-based Edge. Support began with Chromium version 84, but initially, the support is turned off in a series of flags. It will default to on in a future version.
Where do PWAs come from?
How does one get a PWA onto their device?
Back in the old days (circa 2018), you could install a PWA only through the web browser, and that's probably still the main way people get at them. If the site offers a PWA, the browser should offer an icon on the address bar (the plus sign in Chrome) to install the app. Alternatively, there may be an Install option in the main browser settings menu.
You can install PWAs directly to Windows 10 from Google Chrome or Chromium Edge. In this article, Microsoft explains how to make Microsoft 365 (formerly known as Office 365) web-based apps install on your device as PWAs from either Google Chrome or Chromium Edge. You can also make them available in the Microsoft Store.
Better PWA tools
Microsoft has also sponsored an open source project on GitHub called PWABuilder. It allows a developer to take a website and package it up as a PWA, and provides components (e.g., People Picker, Contact Graph) that can be added to the apps. The PWA Builder site itself is an installable PWA.
A Microsoft engineer recently wrote on Medium about how PWABuilder uses Google's Bubblewrap command-line tool behind the scenes to create PWA packages for deployment on the Google Play Store. Microsoft also has its own enthusiastic developer resources for PWA authors.
PWABuilder has added support for web shortcuts and all options available for Trusted Web Activities, such as changing the appearance of the Android status and nav bars, customizing the splash screen, changing the name of the launcher (the icon on the device for the app), and a lot more technical features.
Bright future or dead end?
PWAs have so much going for them that they might seem an inevitable dominant force, if not for Apple's attitude. It may be that the work you do to make the best PWA you can will never be worth it on iOS, but even in that case, it's worth it for all the other platforms.
Progressive web apps: Lessons for leaders
- Development of PWAs holds the promise of broader platform support and more focused development efforts.
- Apple makes writing PWAs a pain, but not impossible.
- Applications that run across platforms give organizations flexibility in device deployment.
- How low-code/no-code platforms may reinvent DevOps
- Say yes to the progressive web
- Windows cross-platform client software is hard to do
This article/content was written by the individual writer identified and does not necessarily reflect the view of Hewlett Packard Enterprise Company.