请输入您要查询的百科知识:

 

词条 Progressive web applications
释义

  1. Background

  2. Characteristics

  3. Technologies

     Manifest  AppCache (obsolete)  Service workers  WebWorkers  WebAssembly  Indexed Database (IDB)  LocalStorage & SessionStorage  Application shell architecture 

  4. Directories and examples

  5. References

{{multiple issues|{{POV|date=September 2017}}{{original research|date=September 2017}}{{confusing|date=September 2017}}
}}Progressive web applications (PWAs) are web applications that load like regular web pages or websites but can offer the user functionality such as working offline, push notifications, and device hardware access traditionally available only to native applications. PWAs combine the flexibility of the web with the experience of a native application.[1]

Background

Since around 2005 web development technologies have shifted from static to dynamic web pages driven by server (PHP, ASP.NET) or client side (Ajax[2]) tools, and responsive web design.[3]

Despite apps based on these technologies on devices such as the 2007 iPhone, attempts at web apps failed by comparison to native apps. Native apps provided a better user experience and booted faster compared to having to load in a browser at runtime. Packaged resources and direct access to hardware allowed native apps to perform much faster to provide more features. By mid 2010, however, continued enhancements in HTML5, CSS3, and JavaScript, significantly more capable and standard-compliant web browsers, along with powerful processors such as the Apple A10 and Snapdragon 820 made hybrid-apps a viable alternative.

Characteristics

In 2015, designer Frances Berriman and Google Chrome engineer Alex Russell coined the term "progressive web apps"[4] 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). According to Google Developers,[4][5][6] these characteristics are:

  • Progressive — Work for every user, regardless of browser choice because they're built with progressive enhancement as a core tenet.
  • Responsive — Fit any form factor: desktop, mobile, tablet, or forms yet to emerge.
  • Connectivity independent — Service workers allow work offline, or on low quality networks.
  • App-like — Feel like an app to the user with app-style interactions and navigation.
  • Fresh — Always up-to-date thanks to the service worker update process.
  • Safe — Served via HTTPS to prevent snooping and ensure content hasn't been tampered with.
  • Discoverable — Are identifiable as “applications” thanks to W3C manifests[7] and service worker registration scope allowing search engines to find them.
  • Re-engageable — Make re-engagement easy through features like push notifications.
  • Installable — Allow users to “keep” apps they find most useful on their home screen without the hassle of an app store.
  • Linkable — Easily shared via a URL and do not require complex installation.

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. PWAs work in any browser, but "app-like" features such as being independent of connectivity, install to home screen & push messaging depend on browser support. As of April 2018, those features are supported to varying degrees by the Microsoft Edge, Google Chrome, Mozilla Firefox and Safari browsers, but more browsers may support the features needed in the future.[8][9]

The technical baseline criteria for a site to be considered a progressive web app by browsers were described by Russell in a follow-up post:[10]

  • Originate from a secure origin. Served over TLS and green padlock displays (no active mixed content).
  • Load while offline (even if only a custom offline page). By implication, this means that progressive web apps require service workers.
  • Reference a web app manifest with at least the four key properties: name, short_name, start_url, and display (with a value of standalone or fullscreen)
  • An icon at least 144×144 large in png format. E.g.: "icons": [ { "src": "/images/icon-144.png", "sizes": "144x144", "type": "image/png" } ]

Technologies

Commonly used technologies serve to create progressive web apps in the broad sense[11][12][13] are the following:

Manifest

The web app manifest is a W3C specification defining a JSON-based manifest[7] 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 for a number of characteristics
  • Declaration for default orientation of the web app
  • Enables 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.

AppCache (obsolete)

An earlier technology to support offline use of the web.[14]

It works adequately for the use case it was designed for (single-page application), but fails in problematic ways for wikis and other multi-page apps.[15]

Currently supported by major browsers and in use for years by some sites, but will eventually be removed.

Service workers

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.[16]

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 supply the content. They are capable of using the cache mechanisms efficiently and allow error-free behavior during offline periods.

Properties of service workers:

  1. Trigger and keep alive by the relationship to the events, not by the documents.
  2. Generic in nature
  3. Event-driven with time limit scripting contexts and running at the origin
  4. With natural endpoints for a wide range of runtime services
  5. Have a state
  6. With a script URL
  7. Containing registration
  8. Allocated ID or UUID
  9. With lifecycle events
  10. Have script resource map
  11. Can skip waiting for the flags

Benefits of service workers:

  • Capable of handling the push notification easily
  • Synchronise data in the background
  • Capable of responding to resource requests originating elsewhere
  • Receive centralized updates

WebWorkers

Allows a web app to run multiple threads of (JavaScript) code simultaneously[17]

Thus, long activities can be moved off the user-interface thread, keeping responses snappy. They have a close relationship with Service Workers, but are more widely supported.

WebAssembly

Allows precompiled code to run in a web browser, at near-native speed.

[18]

Thus, libraries written in languages such as C can be added to web apps. Due to the cost of passing data from JavaScript to WebAssembly, near-term uses will be mainly number-crunching (such as voice recognition and computer vision), rather than whole applications.

Indexed Database (IDB)

A NoSQL database built into modern browsers[19] Allows a PWA to immediately display content, regardless of connection status or speed.

LocalStorage & SessionStorage

Key-Value stores that largely make cookies obsolete.[20]

Application shell architecture

Some progressive web apps use an architectural approach called the App Shell Model.[21] For rapid loading, service workers store the Basic User Interface or "shell" of the responsive web design web application. This shell provides an initial static frame, a layout or architecture into which content can be loaded progressively as well as dynamically, allowing users to engage with the app despite varying degrees of web connectivity. The shell can be stored locally in the browser cache of the mobile device.[22]

Directories and examples

  • Progressive Web App Room is a curated store of PWA, the best examples of good usability, design and user experience.
  • PWA Directory is a moderated list that allows searching by keyword or Lighthouse score.[25]
  • The Microsoft Store contains "PWAs" packaged for Windows 10, but does not appear to contain links to actual on-line PWAs. It's not clear that it can list web apps separate from Windows apps.
  • Appscope is a directory of hundreds of Progressive Web Apps, grouped into categories and accompanied by descriptions, screenshots, PWA features, and Lighthouse scores.

The following list includes progressive web apps together with their scores from Google Chrome's PWA audit powered by Lighthouse.[23] The audit validates the aspects of a PWA, as specified by Google's [https://developers.google.com/web/progressive-web-apps/checklist baseline PWA Checklist] and ranges from 0 (worst) to 100 (best).

List of PWAs
Name DescriptionLink Audit score
ReSTbasis Web Starter Kit. [https://restbasis.com/] 100
The Air Horner An Air horn. [https://airhorner.com/] 100
chromestatus Chrome Platform Status [https://www.chromestatus.com/features] 100
Serene Notes text & picture notes, retrievable by context [https://serenenotes.hominidsoftware.com/] 100
Dev.Opera Web features and implementations [https://dev.opera.com/] 73
4slack Funny pics & videos [https://www.4slack.com/] 100
Appscope Directory of PWAs [https://appsco.pe/] 100
Bet Calculator Online bet calculator [https://www.betvictor.com/bet-calculator/] 91
emojoy [https://jakearchibald-gcm.appspot.com/] 82
Expense Manager Example expense manager [https://demo.vaadin.com/expense-manager/]
Firefox Platform Status Roadmap for web platform features [https://platform-status.mozilla.org/]
Flipkart Lite Online shopping   55
GitHub Explorer [https://github-e.com/]
Google I/O [https://events.google.com/io2016/] 82
Guitar Tuner Tune a guitar [https://guitar-tuner.appspot.com/] 82
Instant Website Maker Make A Website [https://lpk7.com/] 100
Kite OnAir network Kite Network [https://kiteonair.com]
koolsol solitaire card game [https://www.koolsol.com/] 100
localcities.ch 2222 Swiss Municipalities [https://www.localcities.ch/]
Memory Game PWA [https://pwa-memory-game.surge.sh/] 91
MotoPlaces Biker App [https://motoplaces.co.uk] 73
Notepad Offline Notes [https://www.amitmerchant.com/notepad/]
Paytm Lite [https://paytm.com/] 91
Pokedex [https://www.pokedex.org/] 91
Polymon by Polymer [https://polymon.polymer-project.org]
Progressive Beer [https://deanhume.github.io/beer/] 82
Progressive Web App.Store A PWA Store [https://progressivewebapp.store/] 100
QR Code Scanner Offline QR code scanner [https://qrcodescan.in/] 100
React HN [https://react-hn.appspot.com]
Remember GPS logging [https://paulhoughton.github.io/remember/] 73
Resume Nation [https://resume-nation.github.io] 91
SVGOMG SVG editor [https://jakearchibald.github.io/svgomg/] 82
Smaller Pictures [https://smaller-pictures.appspot.com]
Soundslice [https://www.soundslice.com] 64
SplittyPie [https://splittypie.com]
sv-ginger WebGL Morph Demo [https://sv-ginger.appspot.com/] 91
SuperPWA PWA Software [https://superpwa.com] 100
Taskade [https://www.taskade.com]
TeamGrid [https://www.teamgridapp.com]
Twitter [https://mobile.twitter.com] 82
Uber [https://m.uber.com] 82
VallettaCoin WalleteWallet for VallettaCoins[https://pay.valletta-coin.com]95
voice-memos [https://voice-memos.appspot.com/]
Washington Post [https://www.washingtonpost.com/pwa/] 55
Wave-PD1 Synthesizer with Web Audio API [https://alexgibson.github.io/wavepad/] 73
Web Bluetooth (Intel® Edison demo) [https://edison-webbt.appspot.com/] 100
Web NFC enabled shopping cart [https://webnfc-shoppingcart.appspot.com] 100
Wiki Offline [https://wiki-offline.jakearchibald.com/] 73
X Sound [https://korilakkuma.github.io/X-Sound/] 45
Pitchers App Night life planner   100

The following apps are or were claimed to be PWAs but fail to register an obligatory service worker:

Broken progressive web apps
NameLink Audit score
abc.xyz [https://abc.xyz] 55
AMP project [https://www.ampproject.org] 64
DevSpace [https://app.devspace.io/] 55
Housing   64
Medium [https://medium.com/] 55
Topple Trump! [https://toppletrump.com/] 45
Web Bluetooth (Intel® Edison demo) [https://edison-webbt.appspot.com/] 100

References

1. ^{{cite web|url=https://www.topsinfosolutions.com/blog/progressive-web-apps-web-mobile-apps/|title=Progressive Web Apps - Blurring the Lines between Web and Mobile Apps|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
2. ^{{cite web|url=http://adaptivepath.org/ideas/ajax-new-approach-web-applications/|title=Ajax: A New Approach to Web Applications|ref=1|last1=Garrett|first1=Jesse James|accessdate=February 18, 2005|archivedate=January 29, 2016}}
3. ^{{cite web|url=http://alistapart.com/article/responsive-web-design|title=Responsive Web Design|ref=2|last1=Marcotte|first1=Ethan|accessdate=May 25, 2010|archivedate=January 29, 2016}}
4. ^{{cite web|last1=Russell|first1=Alex|title=Progressive Web Apps: Escaping Tabs Without Losing Our Soul|url=https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/|accessdate=June 15, 2015|ref=4|archivedate=January 29, 2016}}
5. ^{{Cite web|url=https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/?hl=en|title=Your First Progressive Web App {{!}} Web Fundamentals - Google Developers|website=Your First Progressive Web App {{!}} Web Fundamentals - Google Developers|access-date=2016-07-17}}
6. ^{{cite web|last1=Google Developers|title=Progressive Web App|url=https://developers.google.com/web/progressive-web-apps|accessdate=June 15, 2015|ref=3|archivedate=January 29, 2016}}
7. ^W3C [https://www.w3.org/TR/appmanifest/ “Web App Manifest”, Working Draft], retrieved 12 September 2016
8. ^{{cite web |url=https://caniuse.com/#search=pwa | title = Can I use pwa? | website=CanIUse |accessdate=14 August 2018}}
9. ^{{cite web |title=Is Service Worker Ready? |url=https://jakearchibald.github.io/isserviceworkerready/ |publisher=Jake Archibald}}
10. ^{{cite web|last1=Russell|first1=Alex|title=What, Exactly, Makes a Progressive Web App|url=https://infrequently.org/2016/09/what-exactly-makes-something-a-progressive-web-app/|accessdate=October 18, 2016|ref=4}}
11. ^{{Cite web|url=https://developer.mozilla.org/en-US/Apps/Progressive/Discoverable|title=Discoverable|website=Mozilla Developer Network|language=en-US|access-date=2017-04-24}}
12. ^{{Cite web|url=https://developer.mozilla.org/en-US/Apps/Progressive/Network_independent|title=Network independent|website=Mozilla Developer Network|language=en-US|access-date=2017-04-24}}
13. ^{{Cite web|url=https://developers.google.com/web/updates/2015/11/app-shell|title=Instant Loading Web Apps with an Application Shell Architecture|last=|first=|date=|website=Google Developers|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-04-24}}
14. ^{{cite web |title=Using the application cache |url=https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache |website=MDN |publisher=Mozilla |accessdate=14 August 2018}}
15. ^{{cite web |title=Application Cache is a Douchebag |url=https://alistapart.com/article/application-cache-is-a-douchebag |website=A List Apart |accessdate=14 August 2018}}
16. ^{{Cite web|url=http://www.htmlpanda.com/blog/learn-everything-about-progressive-web-apps/|title=Learn Everything About Progressive Web Apps|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
17. ^{{cite web |title=Worker |url=https://developer.mozilla.org/en-US/docs/Web/API/Worker |website=MDN |accessdate=14 August 2018}}
18. ^{{cite web |title=WebAssembly Concepts |url=https://developer.mozilla.org/en-US/docs/WebAssembly/Concepts |website=MDN |accessdate=14 August 2018}}
19. ^{{cite web |title=Concepts behind IndexedDB |url=https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB |website=MDN |accessdate=14 August 2018}}
20. ^{{cite web |title=Web Storage API |url=https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API |website=MDN |accessdate=14 August 2018}}
21. ^{{Cite web|url=https://developers.google.com/web/fundamentals/architecture/app-shell|title=The App Shell Model|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
22. ^{{Cite web|url=https://indylogix.com/progressive-web-apps/|title=Progressive Web Apps – a Quality Mix of Web and Mobile|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
23. ^{{cite web |url=https://developers.google.com/web/tools/lighthouse/ |title= Lighthouse - Google Developers |author=}}

2 : Web applications|Words and phrases introduced in 2015

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/28 17:22:07