You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `workbox-window` package is a set of modules that are intended to run in the window context, which is to say, inside of your web pages. They're a complement to the other workbox packages that run in the service worker.
The key features/goals of workbox-window are:
To simplify the process of service worker registration and updates by helping
developers identify the most critical moments in the service worker lifecycle, and making it easier to respond to those moments.
To help prevent developers from making the most common mistakes.
To enable easier communication between code running in the service worker and code running in the window.
We should be using this as opposed to registering it directly:
The Workbox instance can then be stored in a wp.serviceWorker global. This will then allow plugins to make use of the getSW() method, with a goal to provide a reliable way for themes and plugins to access the service worker controlling the page once it is registered and active.
Workbox now makes available a
workbox-window
module:We should be using this as opposed to registering it directly:
https://github.com/xwp/pwa-wp/blob/eb4fcc12945acd7b7afbd10cfb0d91d0b3749c22/wp-includes/service-workers.php#L161-L163
The
Workbox
instance can then be stored in awp.serviceWorker
global. This will then allow plugins to make use of thegetSW()
method, with a goal to provide a reliable way for themes and plugins to access the service worker controlling the page once it is registered and active.See reference docs.
The text was updated successfully, but these errors were encountered: