[w3c/manifest] Add a manifest option for the declaration the "version" of the web application (Issue #1036)

Whether it is a Web Application or a PWA (Progressive Web Application), it is a type of Application. Generally, the difference from other operating systems and desktop applications is whether the installation or deployed on the server or the client. With the emergence of technologies such as HTML5 and WASM, and the development of frameworks such as NodeJS and Electron/NW.js, Web technologies are rapidly occupying the territory of client-side development. Additionally, both Google Play and Microsoft Store already support offline PWA installers.

Based on the above, as a type of Application, Web Application should also define version attributes in the develop standard just like applications of other operating systems.

We can refer to the version methods defined by other operating system applications to formulate the version identification of the Web Application:

| Platform | Host File | Keys |
| --- | --- | --- |
| MS Windows .exe | resource.rc | ProductVersion |
| Mac .app | info.plist | CFBundleShortVersionString, CFBundleVersion |
| iOS .ipa | info.plist | CFBundleShortVersionString, CFBundleVersion |
| Android .apk | AndroidManifest.xml | versionCode, versionName |
| Chrome Extension .crx | manifest.json | version |
| NodeJS | package.json | version |

And lots of people are asking questions about the PWA version online, and all kinds of weird solutions like:

- [PWA - how do I specify a version?](https://stackoverflow.com/questions/54092669/pwa-how-do-i-specify-a-version)
- [My PWA web app keep showing old version after a new release on Safari (but works fine on chrome)?](https://stackoverflow.com/questions/51435349/my-pwa-web-app-keep-showing-old-version-after-a-new-release-on-safari-but-works)
- [custom PWA version management](https://stackoverflow.com/questions/55545688/custom-pwa-version-management)
- [How to display a "new version available" for a Progressive Web App](https://deanhume.com/displaying-a-new-version-available-progressive-web-app/)
- [PWA force refresh when new version released?](https://forum.quasar-framework.org/topic/2560/solved-pwa-force-refresh-when-new-version-released/48)

Therefore, it is proposed to add a `version` attribute member object in `manifest`. The member object contains two attributes, namely `code` and `name`, where: `code` is an integer, which is incremented according to the update of the Web Application; `name` is text, which can be set by the developer to any user-friendly string, such as `1.0.0`.

Specific examples are as follows:

```
{
  "version": {
    "code": 1,
    "name": "v1.0.0"
  }
}
```

The defined version attribute can provide the Web Application with access capabilities through Web API also,  which can be used in more scenarios that developers needed, such as version display in web applications, offline PWA upgrade detection, etc.

Only by providing developers with more capabilities, Web Applications will flourish in the application ecosystem. Let’s move forward step by step!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/1036

You are receiving this because you are subscribed to this thread.

Message ID: <w3c/manifest/issues/1036@github.com>

Received on Tuesday, 19 April 2022 10:20:31 UTC