-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Proposal: Allow for service worker update without closing app #7237
Comments
Hi @jamesmfriedman, as you can control this file yourself, this doesn't need a change on our end. Do you mean that you think we should turn this on by default for all new projects? |
That is correct. I don’t know that many people really look or try to understand what’s going on with the service worker file. Defaulting to this just gives a path to live update the app which would otherwise have to be figured out by the individual developers. So yes, if you like the solution I think just updating the future generated templated file would be a nice value add. |
@ianschmitz, any thoughts on this one? I'm a little concerned about further-complicating the base service worker as we know a lot of people already find it confusing. |
this approach makes a lot of sense to me. I might be way off here, but wouldn't switching to a more |
It is really nice suggestion. CRA should provide someway to check for updates in SW |
Thanks @rizwan-ishtiaq. I have to say this is been working like a champ and has solved most of my service worker update problems. |
works great on computer chrome browsers. Tested on Iphone 11 and android. Both failed. Still need to close the tab then open again to get the updates! |
Relates to #3534
Proposal
Developers should be able to manually update their service worker on request
Current Behavior
Service workers update lazily, sometimes on navigation. Sometimes when the app reloads. In the case of an iOS PWA, the answer it VERY unpredictable. As of iOS 12.2, the app context is frozen and resumes whenever you reopen, which means your service worker will likely not be updated until the app unloads itself which could be anywhere between 24 hours and 2 weeks.
Working example
Modifications to the register function
Why?
Usually I wouldn't bother proposing stuff like this, but it only adds about 6 new lines of code (rerranges a bit more) and gives the developer more control over the update cycle of their app.
The text was updated successfully, but these errors were encountered: