Skip to content
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

Drop support for WorkboxSW's handleFetch? #1002

Closed
jeffposnick opened this issue Nov 7, 2017 · 5 comments
Closed

Drop support for WorkboxSW's handleFetch? #1002

jeffposnick opened this issue Nov 7, 2017 · 5 comments
Labels
Breaking Change Denotes a "major" semver change. workbox-build

Comments

@jeffposnick
Copy link
Contributor

Library Affected:
workbox-sw

Historically, we've supported a handleFetch option that gets passed in as part of the build process, and when set to false, disables the fetch handler that Workbox registers. The primary use case was creating a somewhat no-op-y service worker to use in development environments.

I'm debating whether to port this over to v3, as there's no longer centralized fetch handlers to control under WorkboxSW's purview, and am open to removing it.

Thoughts from other folks?

@jeffposnick jeffposnick added Breaking Change Denotes a "major" semver change. v3 workbox-build labels Nov 7, 2017
@gauntface
Copy link

Couldn't this be moved into workbox-routing?

By default register the fetch event listener and add a method disableFetch()? But also happy to remove and just recommend using Chrome DevTools.

@jeffposnick
Copy link
Contributor Author

One complication I was thinking of was that there's a separate fetch handler added by precacheAndRoute(). That, and the act of registering and then optionally de-registering the automatic fetch handler from workbox-routing/_defauly.mjs seems a little inelegant.

I could always conditionally output either precache() or precacheAndRoute() depending on the handleFetch value, and call removeEventListener() as needed, so it's not impossible.

Just wanted to get a feel for how useful folks felt this was in v3.

@gauntface
Copy link

I'm really torn to be honest.

While DevTools will just work, it's a nice developer workflow to have handleFetch in the build chain.

Arguably, for development, you could just output an empty SW, I can't imagine there is much benefit otherwise.

@jeffposnick
Copy link
Contributor Author

I'll leave it out initially and we can see if anyone asks for it to be added back during the public previews.

We've got so many different entry points/build pipelines nowadays, it's hard to know what folks will actually find useful.

@jeffposnick
Copy link
Contributor Author

Closing this since the decision was reached, and we can reopen to track handleFetch back to v3 if there's demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Denotes a "major" semver change. workbox-build
Projects
None yet
Development

No branches or pull requests

2 participants