The first beta release of Workbox v4 includes the following developer-visible changes from the previous alpha release.
🎉 What's New?
-
[BREAKING CHANGE] The
workbox.backgroundSync.Queue
class has been updated to give developers much control over how failed requests are replayed when async
event occurs. Previously, developers could only add requests to the queue (there was no option to remove them). Now they have low-level methods to push, pop, shift, and unshift requests. For the full list of changes and use cases, see #1710. -
[BREAKING CHANGE]
workbox-precaching
will default to confirming that allResponse
s cached during installation have a non-error (less than400
) HTTP status code. If anyResponse
s have an error code, theinstall
phase will now fail. (The next time the service worker starts up, installation will be re-attempted.) Developers who need to precacheResponse
s that have a 4xx or 5xx status code (e.g., precaching a/not-found.html
URL that is served with a status code of404
) can opt-in to allowing that by passing in a customcacheWillUpdate
plugin to theworkbox.precaching.PrecacheController
'sinstall
method. -
[BREAKING CHANGE]
workbox-range-requests
will now check to see if theResponse
object it's processing already has an HTTP status code of 206 (indicating that it contains partial content). If so, it will just pass it through unmodified. (#1721) -
workbox.routing.Router
now includes aroutes
getter method, giving developers access to the underlyingMap
of routes that have been registered for a given router. (#1714) -
Improved logging when using
workbox.routing.NavigationRoute
. When a URL matches the blacklist, there's now a message logged with higher priority when using the development builds. (#1741) -
When using
workbox-precaching
, the temporary cache is now cleaned up following service worker activation. (#1736)