workbox icon indicating copy to clipboard operation
workbox copied to clipboard

Make workbox-sw npm package CDN-friendly

Open jeffposnick opened this issue 2 years ago • 2 comments

The workbox-sw package that's published to npm is of very limited usefulness; it's primarily loaded via importScripts() using our "official" CDN URLs, like https://storage.googleapis.com/workbox-cdn/releases/6.4.2/workbox-sw.js

Third parties, like the Nuxt community, have attempted to make workbox-sw-style loading play nicely with npm mirror CDNs via packages like https://www.npmjs.com/package/workbox-cdn

We should revisit what we actually publish to npm for the workbox-sw package, and see if we can release something that will play nicely with npm mirror CDNs out of the box.

Long term, we still want to steer developers towards creating their own custom bundles, but we plan on continuing to support workbox-sw as an option. Making this change will at least set us up to stop publishing to the storage.googleapis.com host at some point in the future, if jsdelivr.com, unpkg.com, etc. can fill that role officially.

jeffposnick avatar Dec 14 '21 19:12 jeffposnick

Let us know if the jsDelivr team can help with anything! We already serve more than 5 billion requests per month https://www.jsdelivr.com/package/npm/workbox-cdn

jimaek avatar Dec 15 '21 15:12 jimaek

Let us know if the jsDelivr team can help with anything! We already serve more than 5 billion requests per month https://www.jsdelivr.com/package/npm/workbox-cdn Seems to be some wrapper script, not the actual workbox script directly.

mangelozzi avatar Jul 13 '22 16:07 mangelozzi