-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Update workbox plugin to 5.1.2 #8822
Conversation
Hi @jflayhart! Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
navigateFallback: paths.publicUrlOrPath + 'index.html', | ||
navigateFallbackBlacklist: [ | ||
navigateFallbackDenylist: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to join the efforts at #8485? That PR is doing the update and adding support for |
@bebraw Sure, but that PR involves much more change while this PR simply upgrades Workbox so CRA can immediately take advantage of the new workbox V5 features. Seems like this could go in prior to #8485 as an incremental step in the right direction rather than waiting on #8485 with all its improvements to be worked out. I'd love to help where I can, though. The hope was that this would go in much more quickly, not create more work. |
@jflayhart Yeah, agreed. It would be cool to see this one land first as #8485 builds on top of this. I added a couple of notes there based on my initial experiences. Let's hope a maintainer finds time to look at these. 👍 |
@jeffposnick Any default config changes you think we should make with this upgrade? |
(For reference, here's our release notes and migration guide.) Two new options to consider adding:
I would love to see more flexibility in the long term around SW generation, via #8485 or something similar. But for now, that's what I'd suggest for a |
What about defaulting Honestly, my main concern is simply |
Please don't set C.f. https://stackoverflow.com/questions/49482680/workbox-the-danger-of-self-skipwaiting/49494141#49494141 and https://pawll.glitch.me/ The various recipes for showing a "Reload for updated content" toast are the UX that works best here, where clicking on the button will both trigger |
...actually, taking a step back for a second, how would the I think that would actually make a lot of folks who want more control over their service worker's behavior much happier, as folks could edit the base service worker file as they see fit to customize the behavior. The difference is explained at https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#which_plugin_to_use and this was previously a bit more complex to do in a controlled environment like |
I wrote this up in more detail at #9141 |
@jeffposnick I think more control over the SW would be great - and we know the community want that - so I'm all for this approach. |
love it! thanks @jeffposnick Feel free to close this as needed. |
I believe this has all been addressed and superseded by #9205. Thank you for the PR though! |
Closes #8821
I would like to propose this change to take advantage of some great defaults Google gives us out of the box (pun intended) with their new V5 workbox plugin, however, I mainly want to remedy the issue Google fixes here.
This wonderful CRA library would be remiss if it did not stay up-to-date with Google's PWA best practices.
Verification
✔️ Run tests
✔️ Create an app with CRA
✔️ Build CRA (service-worker output below)