-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workbox-webpack-plugin v5 interface #1591
Comments
Hmm. Not sure what I should be looking for. Is some functionality going to be removed? Or is this """just""" an API breaking change? |
There's some new functionality (making it so that options like It's a combination of the new interface (any naming concerns, etc.) along with the list of issues that are on our radar that we're looking for feedback on. |
|
Yes! Just came to the issues to "complain" about the fact Here's my use case. Following is a simplified Next.js precache manifest (based on the webpack emitted files): self.__precacheManifest = [
{
"revision": "29c0a6405b762b2ed86f",
"url": "static/style-3518e9dc77a50a7a733511fc53c5f981.css"
},
{
"url": "static/commons/main-29c0a6405b762b2ed86f.js"
},
{
"revision": "8d205d627155bcada52d",
"url": "bundles/pages/signin.js"
},
{
"revision": "7df5921f82befca27ca2",
"url": "bundles/pages/index.js"
},
{
"revision": "cd541d001d7a4e98c326",
"url": "bundles/pages/_error.js"
},
{
"revision": "f254703bdcbdcd928292",
"url": "bundles/pages/_app.js"
},
{
"revision": "88201f6df194e5ca3129373100147939",
"url": "build-manifest.json"
}
]; Problem 1: As you see, some of the assets are already hashed, so I'd like to not revision those. Some others are not hashed at build time, but are served/exported with a hash in the url. E.g. dontCacheBustUrlsMatching: /$(bundles\/pages|static)/ Problem 2: As hinted above, files are served on different paths than their location in the filesystem. E.g. the modifyUrlPrefix: {
'bundles/pages': join(assetPrefix, `/_next/${buildId}/page`),
chunks: join(assetPrefix, '/_next/webpack/chunks'),
static: join(assetPrefix, '/_next/static'),
} Problem 3 and 4:
I want to use the Next.js As such, I'd like to use: manifestTransforms: [
originalManifest => {
const manifest = originalManifest
.filter(entry => entry.url !== 'build-manifest.json')
.map(({ url, revision }) => ({ url, revision: revision && buildId }));
return { manifest };
},
] This seemed a very reasonable use case and was happy to see Hope this helps. |
Came here after looking at #1513 |
After chatting with @developit a bit, we might end up going with an approach that eliminated the We wanted to float that idea here and see if there were strong feelings one way or another. |
Interested parties who have been following this issue should take a look at @developit's proposal, detailed at #1854, which addresses a few of the issues outlined in this meta-issue. |
This should be addressed by the current Workbox v5.0.0 alpha. |
Background
The team is planning on addressing the various issues and pain points raised against the
workbox-webpack-plugin
with a number of breaking changes to the interface and behavior in an upcoming v4.0.0 release.We're looking to gather feedback from the community prior to starting on the implementation, so please feel free to reply if you've got any concerns.
Open issues
These are categorized, but not prioritized, based on the open issues. It gives a good overview of the general areas in which feedback has been concentrated.
We won't be able to address all of these issues in the initial v4.0.0 release. Our goal is to address many of them that require an incompatible API surface or a significant change in behavior in at once, to minimize the number of major releases with breaking changes.
Filesystem paths
URL paths
Asset pipeline
chunks
option in conflict with precachingindex.html
(workbox-webpack-plugin -chunks
option in conflict with precachingindex.html
#1556)Parity with "glob" configuration
templatedUrls
option ([workbox-webpack-plugin] proposal to add support Webpack assets intemplatedUrls
option #1384)dontCacheBustUrlsMatching
ignored in Workbox v3? (dontCacheBustUrlsMatching
ignored in Workbox v3? #1373)Developer experience
Proposed v5 plugin interface
This interface will apply to both
InjectManifest
andGenerateSW
. (swSrc
is the only option that's limited toInjectManifest
.)I'll keep this example up-to-date as folks add feedback to the issue thread.
The text was updated successfully, but these errors were encountered: