Software:Progressive web app

From HandWiki
Short description: Specific form of single page web application
PWA logo

A progressive web application (PWA), or progressive web app, is a type of application software delivered through the web, built using common web technologies including HTML, CSS, JavaScript, and WebAssembly. It is intended to work on any platform with a standards-compliant browser, including desktop and mobile devices.

Since a progressive web app is a type of webpage or website known as a web application, it does not require separate bundling or distribution. Developers can simply publish the web application online, ensure that it meets baseline installation requirements and that users will be able to add the application to their home screen. Publishing the app to digital distribution systems like Apple App Store or Google Play is optional.[1]

As of 2021, PWA features are supported to varying degrees by Google Chrome, Apple Safari, Firefox for Android, and Microsoft Edge[2][3] but not by Firefox for desktop.[4]

Browser support

Browser Support Comment
Windows macOS Linux Android iOS & iPadOS
Chromium-based Yes Yes Yes Yes N/A Includes Google Chrome, Microsoft Edge,[5] Brave, Opera, Vivaldi,[6] and others.
Firefox Partial [4] Partial [4] Partial [4] Partial No
Safari N/A Partial [7] N/A N/A Partial [8]

History

Predecessors

At Apple's Worldwide Developers Conference in 2007, Steve Jobs announced that iPhone would "run applications created with Web 2.0 Internet standards".[9] No software development kit (SDK) was required, and the apps would be fully integrated into the device through the Safari browser engine.[10] This model was later switched to the App Store, as a means of appeasing frustrated developers.[11] In October 2007 Jobs announced that an SDK would be launched the following year.[10] As a result, although Apple continued to support web apps, the vast majority of iOS applications shifted toward the App Store.

Beginning in the early 2010s dynamic web pages allowed web technologies to be used to create interactive web applications. Responsive web design, and the screen-size flexibility it provides, made PWA development more accessible. Continued enhancements to HTML, CSS, and JavaScript allowed web applications to incorporate greater levels of interactivity, making native-like experiences possible on a website.[12]

In 2013, Mozilla released Firefox OS. It was intended to be an open-source operating system for running web apps as native apps on mobile devices. Firefox OS was based on the Gecko rendering engine with a user interface called Gaia, written in HTML5. The development of Firefox OS ended in 2016,[13] and the project was completely discontinued in 2017,[14] although a fork of Firefox OS was used as the basis of KaiOS, a feature phone platform.[15]

Initial introduction

In 2015, designer Frances Berriman and Google Chrome engineer Alex Russell coined the term "progressive web apps"[16] 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 progressive web applications in their native operating system (OS). Google then put significant efforts into promoting PWA development for Android.[17][18] Firefox introduced support for service workers in 2016, and Microsoft Edge and Apple Safari followed in 2018,[19][17] making service workers available on all major systems.

By 2019, PWAs were supported by desktop versions of most browsers, including Microsoft Edge[5] (on Windows) and Google Chrome[20] (on Windows, macOS, ChromeOS, and Linux).

In December 2020, Firefox for desktop abandoned the implementation of PWAs (specifically, removed the prototype "site-specific browser" configuration that had been available as an experimental feature). A Firefox architect noted: "The signal I hope we are sending is that PWA support is not coming to desktop Firefox anytime soon."[4] Mozilla still plans to support PWAs on Android.[21]

Stores

Since a progressive web app is a type of webpage or website known as a web application, they do not require separate bundling or distribution. In particular, there is no requirement for developers or users to install web apps via digital distribution systems like Apple App Store, Google Play, Microsoft Store, or Samsung Galaxy Store. To varying degrees, the major app stores support the publication of PWAs.[1] Google Play, Microsoft Store,[22] and Samsung Galaxy Store support PWAs, but Apple App Store does not. Microsoft Store publishes some qualifying PWAs automatically (even without app authors' request) after discovering them via Bing indexing.[23]

Characteristics

Progressive web apps are all designed to work on any browser that is compliant with the appropriate web standards. As with other cross-platform solutions, the goal is to help developers build cross-platform apps more easily than they would with native apps.[17] Progressive web apps employ the progressive enhancement web development strategy.

Some progressive web apps use an architectural approach called the App Shell Model.[24] In this model, service workers store the Basic User Interface or "shell" of the responsive web design web application in the browser's offline cache. This model allows for PWAs to maintain native-like use with or without web connectivity. This can improve loading time, by providing an initial static frame, a layout or architecture into which content can be loaded progressively as well as dynamically.[25]

Installation criteria

The technical baseline criteria for a site to be considered a progressive web app and therefore being capable of being installed by browsers were described by Russell in a follow-up post[26] and updated since:[27][28]

  • Originate from a secure origin. Served over TLS and have no active mixed content. Progressive web apps must be served via HTTPS to ensure user privacy, security, and content authenticity.
  • Register a service worker with a fetch handler. Progressive web apps must use service workers to create programmable content caches. Unlike regular HTTP web cache, which caches content after the first use and then relies on various heuristics to guess when content is no longer needed, programmable caches can explicitly prefetch content in advance before it's used for the first time and explicitly discard it when it is no longer needed.[29] This requirement helps pages to be accessible offline or on low quality networks.
  • Reference a web app manifest. The manifest must contain at least the five key properties: name or short_name, start_url, and display (with a value of standalone, fullscreen or minimal-ui), and icons (with 192px and a 512px versions). Information contained in manifest makes PWAs easily shareable via a URL, discoverable by search engines, and alleviates complex installation procedures (but PWAs still can be listed in a third-party app store).[30] Furthermore, PWAs support native app-style interactions and navigation, including being added to home screen, displaying splash screens, etc.

Comparison with native apps

In 2017, Twitter released Twitter Lite, a PWA alternative to the official native Android and iOS apps. According to Twitter, Twitter Lite consumed only 1–3% of the size of the native apps.[31] Starbucks provides a PWA that is 99.84% smaller than its equivalent iOS app. After deploying its PWA, Starbucks doubled the number of online orders, with desktop users ordering at about the same rate as mobile app users.[32]

A 2018 review published by Forbes , found that users of Pinterest's PWA spent 40% more time on the site compared to the previous mobile website. Ad revenue rates also increased by 44%, and core engagements by 60%.[33] Flipkart saw 60% of customers who had uninstalled their native app return to use the Flipkart PWA. Lancôme saw an 84% decrease in time until the page is interactive, leading to a 17% increase in conversions and a 53% increase in mobile sessions on iOS with their PWA.[34]

Technologies

There are many technologies commonly used to create progressive web apps. A web application is considered a PWA if it satisfies the installation criteria and thus can work offline and can be added to device home screen. To meet this definition, all PWAs require at minimum a service worker and a manifest.[35][36][37]

Manifest

The web app manifest[38] is a W3C specification defining a JSON-based manifest (usually labelled manifest.json)[30] to provide developers a centralized place to put metadata associated with a web application including:

  • The name of the web application
  • Links to the web app icons or image objects
  • The preferred URL to launch or open the web app
  • The web app configuration data
  • Default orientation of the web app
  • The option to set the display mode, e.g. full screen

This metadata is crucial for an app to be added to a home screen or otherwise listed alongside native apps.

iOS support

iOS Safari partially implements manifests, while most of the PWA metadata can be defined via Apple-specific extensions to the meta tags. These tags allow developers to enable full-screen display, define icons and splash screens, and specify a name for the application.[39][40]

WebAssembly

Main page: WebAssembly

WebAssembly allows precompiled code to run in a web browser, at near-native speed.[41] Thus, libraries written in languages such as C can be added to web apps.

Data storage

Progressive Web App execution contexts get unloaded whenever possible, so progressive web apps need to store majority of long-term internal state (user data, dynamically loaded application resources) in one of the following manners

Web Storage

Main page: Web storage

Web Storage is a W3C standard API that enables key-value storage in modern browsers. The API consists of two objects, sessionStorage (that enables session-only storage that gets wiped upon browser session end) and localStorage (that enables storage that persists across sessions).[42]

Indexed Database API

Main page: Indexed Database API

Indexed Database API is a W3C standard database API available in all major browsers. The API is supported by modern browsers and enables storage of JSON objects and any structures representable as a string.[43] Indexed Database API can be used with a wrapper library providing additional constructs around it.

Service workers

A service worker is a web worker that implements a programmable network proxy that can respond to web/HTTP requests of the main document. It is able to check the availability of a remote server and to cache content when that server is available, and serve that content later to the document. Service workers, like any other web workers, work separately from the main document context. Service workers can handle push notifications and synchronize data in the background, cache or retrieve resource requests, intercept network requests and receive centralized updates independently of the document that registered them, even when that document is not loaded.[44]

Service workers go through a three-step lifecycle of Registration, Installation and Activation. Registration involves telling the browser the location of the service worker in preparation for installation. Installation occurs when there is no service worker installed in the browser for the web app, or if there is an update to the service worker. Activation occurs when all of the PWA's pages are closed, so that there is no conflict between the previous version and the updated one. The lifecycle also helps maintain consistency when switching among versions of service worker since only a single service worker can be active for a domain.[44]

See also

References

  1. 1.0 1.1 "Progressive Web Apps | Software AG". https://techradar.softwareag.com/technology/progressive-web-apps/. 
  2. "Can I use pwa?". https://caniuse.com/#search=pwa. 
  3. "Is Service Worker Ready?". Jake Archibald. https://jakearchibald.github.io/isserviceworkerready/. 
  4. 4.0 4.1 4.2 4.3 4.4 Newman, Jared (2021-01-26). "Firefox just walked away from a key piece of the open web" (in en-US). https://www.fastcompany.com/90597411/mozilla-firefox-no-ssb-pwa-support. 
  5. 5.0 5.1 "Progressive Web Apps on Windows overview" (in en). 13 March 2021. https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/. 
  6. "Get your PWA on" (in en). 2021-10-07. https://vivaldi.com/blog/vivaldi-gets-more-private-delivers-an-all-new-capture-pwa-support/. 
  7. Angle, Patrick; Avenard, Jean-Yves; Caceres, Marcos; Cannon, Ada Rose; Carlson, Eric; Davidson, Garrett; Davis, Jon; Dubost, Karl et al. (2023-06-06). "News from WWDC23: WebKit Features in Safari 17 beta". https://webkit.org/blog/14205/news-from-wwdc23-webkit-features-in-safari-17-beta/. 
  8. Angle, Patrick; Caceres, Marcos; Caliman, Razvan; Davis, Jon; Eidson, Brady; Hatcher, Timothy; Niwa, Ryosuke; Simmons, Jen (2023-03-27). "WebKit Features in Safari 16.4". https://webkit.org/blog/13966/webkit-features-in-safari-16-4/. 
  9. Jobs, Steve; Apple (11 June 2007). "iPhone to Support Third-Party Web 2.0 Applications" (in en). https://www.apple.com/newsroom/2007/06/11iPhone-to-Support-Third-Party-Web-2-0-Applications/. 
  10. 10.0 10.1 Ritchie, Rene (5 March 2018). "App Store Year Zero: Unsweet web apps drove iPhone to an SDK" (in en). https://www.imore.com/history-app-store-year-zero. 
  11. "Jobs' original vision for the iPhone: No third-party native apps". 21 October 2011. https://9to5mac.com/2011/10/21/jobs-original-vision-for-the-iphone-no-third-party-native-apps/. 
  12. Marcotte, Ethan (25 May 2010). "Responsive Web Design". A List Apart. http://alistapart.com/article/responsive-web-design. 
  13. "Mozilla ends commercial Firefox OS development - gHacks Tech News" (in en-US). 2016-09-27. https://www.ghacks.net/2016/09/27/mozilla-ends-commercial-firefox-os-experiment/. 
  14. Hoffman, Chris; PCWorld | (2016-09-28). "Mozilla is stopping all commercial development on Firefox OS" (in en). https://www.pcworld.com/article/3124563/mozilla-is-stopping-all-commercial-development-on-firefox-os.html. 
  15. "KaiOS, a feature phone platform built on the ashes of Firefox OS, adds Facebook, Twitter and Google apps" (in en-US). 26 February 2018. https://social.techcrunch.com/2018/02/26/kaios-a-feature-phone-platform-built-on-the-ashes-of-firefox-os-adds-facebook-twitter-and-google-apps/. 
  16. Russell, Alex. "Progressive Web Apps: Escaping Tabs Without Losing Our Soul". https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/. 
  17. 17.0 17.1 17.2 Evans, Jonny (26 January 2018). "Apple goes back to the future with web apps" (in en). https://www.computerworld.com/article/3251173/apple-goes-back-to-the-future-with-web-apps.html. 
  18. Ladage, Aaron (17 April 2018). "Progressive Web Apps Are Here and They're Changing Everything". https://www.degdigital.com/insights/progressive-web-apps/. 
  19. "Can I use... Support tables for HTML5, CSS3, etc". https://caniuse.com/serviceworkers. 
  20. LePage, Pete (4 June 2019). "Progressive Web Apps on Desktop" (in en). https://developers.google.com/web/progressive-web-apps/desktop. 
  21. agi90 (19 December 2020). "Comment". https://www.reddit.com/r/firefox/comments/kg1jb5/firefox_giving_up_on_pwa_support/gge34eg/. "We have no plans of sunsetting PWAs on mobile that I know of." 
  22. MSEdgeTeam. "Publish your Progressive Web App to the Microsoft Store - Microsoft Edge Development" (in en-us). https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/microsoft-store. 
  23. "The first batch of Windows 10 Progressive Web Apps is here". 2018-04-07. https://www.windowscentral.com/first-batch-windows-10-progressive-web-apps-here. 
  24. "The App Shell Model". https://developers.google.com/web/fundamentals/architecture/app-shell. 
  25. Osmani, Addi. "The App Shell Model | Web Fundamentals" (in en). https://developers.google.com/web/fundamentals/architecture/app-shell. 
  26. Russell, Alex. "What, Exactly, Makes a Progressive Web App". https://infrequently.org/2016/09/what-exactly-makes-something-a-progressive-web-app/. 
  27. "What does it take to be installable?" (in en). https://web.dev/install-criteria/. 
  28. web.dev. "Progressive Web App". https://developers.google.com/web/progressive-web-apps. 
  29. "Service worker caching and HTTP caching" (in en). https://web.dev/service-worker-caching-and-http-caching/. 
  30. 30.0 30.1 W3C "Web App Manifest", Working Draft, retrieved 12 September 2016
  31. Shankland, Stephen (30 July 2020). "Twitter's app is helping stop phones from strangling the web". https://www.cnet.com/tech/mobile/twitter-shows-why-web-apps-can-work-on-your-android-phone-or-iphone/. 
  32. "12 Best Examples of Progressive Web Apps (PWAs) in 2021" (in en-US). 2021-02-22. https://www.simicart.com/blog/progressive-web-apps-examples/. 
  33. Osmani, Addy (30 November 2017). "A Pinterest Progressive Web App Performance Case Study". https://medium.com/dev-channel/a-pinterest-progressive-web-app-performance-case-study-3bd6ed2e6154. 
  34. Gazdecki, Andrew (9 March 2018). "Why Progressive Web Apps Will Replace Native Mobile Apps". https://www.forbes.com/sites/forbestechcouncil/2018/03/09/why-progressive-web-apps-will-replace-native-mobile-apps/?sh=154c9d2a2112. 
  35. "Discoverable" (in en-US). https://developer.mozilla.org/en-US/Apps/Progressive/Discoverable. 
  36. "Network independent" (in en-US). https://developer.mozilla.org/en-US/Apps/Progressive/Network_independent. 
  37. "Instant Loading Web Apps with an Application Shell Architecture" (in en). https://developers.google.com/web/updates/2015/11/app-shell. 
  38. "Web Manifest Docs on MDN". https://developer.mozilla.org/en-US/docs/Web/Manifest. 
  39. "What's new on iOS 12.2 for Progressive Web Apps". 27 March 2019. https://medium.com/@firt/whats-new-on-ios-12-2-for-progressive-web-apps-75c348f8e945. 
  40. "Configuring Web Applications". https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html. 
  41. "WebAssembly Concepts". https://developer.mozilla.org/en-US/docs/WebAssembly/Concepts. 
  42. "Web Storage API". https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API. 
  43. "Concepts behind IndexedDB". https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB. 
  44. 44.0 44.1 "Introduction to Service Worker | Web" (in en). 1 May 2019. https://developers.google.com/web/ilt/pwa/introduction-to-service-worker. 

External links