| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| workbox-v3.5.0.tar.gz | 2018-09-11 | 101.4 kB | |
| workbox-v3.5.0.zip | 2018-09-11 | 157.1 kB | |
| README.md | 2018-09-11 | 2.9 kB | |
| Workbox v3.5.0 source code.tar.gz | 2018-09-11 | 529.7 kB | |
| Workbox v3.5.0 source code.zip | 2018-09-11 | 871.4 kB | |
| Totals: 5 Items | 1.7 MB | 0 | |
🎉 What's New?
More customization when generating a service worker
Developers who use Workbox to generate their service worker (using the CLI, Node interface, or webpack plugin) can now take advantage of some additional options:
-
Setting
offlineGoogleAnalytics: truewill automatically add code to initialize Workbox's offline Google Analytics support in the generated service worker. -
Both
fetchOptionsandmatchOptionscan now be used when configuring aruntimeCachingroute, and those values will be passed through when constructing the corresponding Workbox caching strategy. Many thanks to @peterjosling for contributing this in [#1608]. -
Using a custom plugin within a
runtimeCachingroute is now possible, thanks to enhancements made by @tsirlucas in [#1598].
Here's a snippet of Workbox's build configuration, showing off all of the new features:
:::javascript
{
// ... other options ...
offlineGoogleAnalytics: true,
runtimeCaching: {[
urlPattern: /abc/,
handler: 'staleWhileRevalidate',
options: {
fetchOptions: {
mode: 'no-cors',
},
matchOptions: {
ignoreSearch: true,
},
plugins: [{
cacheDidUpdate: async ({cacheName, request, oldResponse, newResponse}) => {
// Do something in your custom plugin.
},
}],
},
]},
}
Support for the PATCH method in Workbox's router
Developers who need to match HTTP PATCH requests using Workbox's router can now do so, thanks to @kevin-brotcke's change in [#1618].
Note that non-GET requests can't be added to a cache, so this is most useful when used alongside a network-only strategy configured with the Workbox background sync plugin, in order to retry failed PATCH requests once the network becomes available.
workbox.core.registerQuotaErrorCallback is now publicly visible
Due to a scoping error, the workbox.core.registerQuotaErrorCallback() function was previously not exposed. This is now public, matching the documented interface. Thanks to @Tronil for pointing out this discrepancy in [#1616].
📖 Learn More
Check out our docs @ developers.google.com/web/tools/workbox/