GoogleChromeLabs / sw-precache

[Deprecated] A node module to generate service worker code that will precache specific resources so they work offline.
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
5.22k stars 388 forks source link

feat(pattern): add glob exclusion support #349

Closed Osirisxxl closed 6 years ago

Osirisxxl commented 6 years ago

This PR is an attempt to introduce negative glob pattern to exclude files from pre-caching.

This need has already been mentioned in #97 and would be of great use in our project. It is inspired by what's commonly done in gulp.

TODO:

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
googlebot commented 6 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

googlebot commented 6 years ago

CLAs look good, thanks!

googlebot commented 6 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

googlebot commented 6 years ago

So there's good news and bad news.

:thumbsup: The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

:confused: The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

Osirisxxl commented 6 years ago

@jeffposnick, Could you take some time to tell us what you think about this PR ? What can we adjust to make it mergeable ?

jeffposnick commented 6 years ago

Hello @Osirisxxl—First off, thanks for the time you spent on this contribution.

Our team's recent focus has been on the Workbox set of libraries, and while we will continue to patch sw-precache due to any compatibility issues or newly discovered bugs, we're not looking to add in additional functionality at this time. There's more info at https://github.com/GoogleChromeLabs/sw-precache#support

I'd encourage you to take a look at this Workbox migration guide. Workbox has support for both white- and blacklisting glob patterns.

Osirisxxl commented 6 years ago

Thanks for following up @jeffposnick. We indeed missed workbox when implementing our asset pre-caching policy. Thanks for pointing us towards it. We'll consider it in a second time, probably when digging deeper into PWA.

I'll add a comment in #97 to state an attempt to add excluding globs is available on our repository without your approval, just in case somebody still needs it !