| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| workbox-v3.2.0.zip | 2018-05-02 | 148.2 kB | |
| workbox-v3.2.0.tar.gz | 2018-05-02 | 94.9 kB | |
| README.md | 2018-05-02 | 3.0 kB | |
| Workbox v3.2.0 source code.tar.gz | 2018-05-02 | 515.9 kB | |
| Workbox v3.2.0 source code.zip | 2018-05-02 | 840.4 kB | |
| Totals: 5 Items | 1.6 MB | 0 | |
🎉 What's New?
A new workbox-streams module
The workbox-streams module provides an easy-to-use wrapper on top of the Streams API, allowing you to create a streaming response from a sequence of multiple sources.
The new module offers a convenience workbox.streams.strategy() method that can be used as a strategy in a workbox.routing configuration, allowing you to respond to matching requests with a stream:
:::js
const apiStrategy = workbox.strategies.staleWhileRevalidate();
const streamsStrategy = workbox.streams.strategy([
() => caches.match('start.html'),
() => `<p>Here's an API call, using a stale-while-revalidate strategy:</p>`,
({event}) => apiStrategy.makeRequest({
event,
request: '/api/date',
}),
() => caches.match('end.html'),
]);
workbox.routing.registerRoute(
new RegExp('/index'),
streamsStrategy
);
For more information and usage examples, please see the documentation and the live demo. (#1439)
Improved resiliency during unexpected cache misses
If a cache entry that would normally be used to fulfill a request is unexpectedly missing, workbox.routing.registerNavigationRoute() will now fall back to the network to obtain that response. Previously, this would lead to a failed navigation. (#1460)
precacheAndRoute() now accepts options in injectManifest mode
Previously, when using injectManifest mode with workbox-build or workbox-cli, the default regular expression would look for precacheAndRoute([]) inside of your swSrc file, and use that [] as the point at which to inject the manifest.
We've relaxed the default regular expression so that, in addition to supporting the previous usage, it will also work with precacheAndRoute([], {...}), where {...} are the options that you might want to pass in to configure precaching behavior. (#1459)
Changes to swSrc will trigger a new webpack dev server build
When using workbox-webpack-plugin's InjectManifest mode inside of a webpack dev server environment, making updates to the swSrc file will now trigger a fresh build. Thanks to @green-arrow for the contribution! (#1432)
🐛 What's Fixed?
- Resolved an issue with
workbox.strategies.staleWhileRevalidate()andworkbox.strategies.cacheFirst()in the Samsung Internet browser. (#1457) - Moved to using the public
compiler.inputFileSystemAPI when working with thewebpackfilesystem. Thanks to @DorianGrey for the contribution! (#1437)
📖 Learn More
Check out our docs @ developers.google.com/web/tools/workbox/