The latest RC release of Workbox v4 includes the following developer-visible changes, in addition to all the changes from the previous pre-releases.
🎉 What's New?
workbox-window
-
The
workbox-window
package now ships with a few different build options, to help make it as easy as possible for people to include it in to their existing tool chain [#1895, #1899]. Here's what's currently supported: -
Requiring
workbox-window
in node (or any or environment that doesn't support native modules):
// Imports a UMD version with ES5 syntax
const {Workbox} = require('workbox-window');
- Importing
workbox-window
via webpack or Rollup in a context where your build does not automatically transpile anything innode_modules
:
// Imports the module version with ES5 syntax
import {Workbox} from 'workbox-window';
- Importing
workbox-window
via webpack or Rollup in a context where you can handle transpiling yourself (or you don't need to transpile to ES5):
// Imports the module version with ES2015+ syntax
import {Workbox} from 'workbox-window/Workbox.mjs';
Note: option 3 above will usually result in the smallest file size, so it's recommend to do that if your build supports it.
🐛 What's Fixed?
workbox-routing
- The
setCatchHandler()
andsetDefaultHandler()
methods were not properly migrated as part of the bundling changes in #1831. This has been fixed, and these method now work as they did before [#1898].