GoogleChromeLabs / pwa-wp

WordPress feature plugin to bring Progressive Web Apps (PWA) to Core
https://wordpress.org/plugins/pwa/
GNU General Public License v2.0
616 stars 97 forks source link

Adopt admin PWA logic from Gutenberg #569

Open westonruter opened 3 years ago

westonruter commented 3 years ago

In Gutenberg 11.1, experimental support for admin PWA was introduced: https://github.com/WordPress/gutenberg/pull/33102, https://github.com/WordPress/gutenberg/pull/33310, https://github.com/WordPress/gutenberg/pull/33216.

This allows for the WordPress admin to be installed to the homescreen separately for ease of access, separately from installing the frontend to the homescreen. The PWA plugin already is registering a service worker in the admin scope, but the admin is not installable as a separate PWA because there is no admin-specific web app manifest. This is what was proposed in https://github.com/GoogleChromeLabs/pwa-wp/issues/295 as mentioned in https://github.com/WordPress/gutenberg/pull/33102#issuecomment-874339487.

Only one service worker can be registered for a given scope at a time. Since the purpose of the PWA plugin's service worker is to be extensible via a WP_Scripts-esque API, it is preferable to use instead of the service worker shim in Gutenberg which is required to trigger the add-to-homescreen prompt.

westonruter commented 2 years ago

Not a priority for 0.7 since the service worker is being removed from Gutenberg in https://github.com/WordPress/gutenberg/pull/38810 which was causing a conflict.