As many of you already know, the upgrading of the service worker gives us agony. Until now we always need to make some compromises. But what if I...
For further actions, you may consider blocking this person and/or reporting abuse
Hey, I have a quick question regarding this bit:
Should the
REACT_APP_VERSION_UNIQUE_STRING
only change when making changes to the service worker, or upon every build and deploy?It should be on every build and deploy. Since on every build and deploy you have new files. But you can make it automated - add Date String prefix, suffix etc...
Thank you!
If anyone is interested, I've edited this script found on SO to replace my
"build": "craco build"
command inpackage.json
:I have just upgraded from react 16 to 17 and then followed this tutorial, but I still need to close the tab and open again to see the updates, I really hate PWA's.
Hi @myfairshare the update does not happen immediately. First you need to load the page, so that it detects the new service worker, to prepare caches and to replace the index.html
After the next reload your website will be updated with the new service worker
Ok thanks for the reply mate. I think next time I build a mobile app I will try flutter instead!!
Unfortunately there is a big difference and use cases between PWA and Mobile App. And PWA gain much on popularity. I also hate the way the PWA handles the updates, but they will surely change it in future.
I hope your right, thanks!!
Thanks Anton, going to try this, certainly is painful dealing with service workers.
If I understand correctly, the only time a new service worker will be activated immediately is when there is only one tab open, correct?
Yes