Prompt users to reload page when application is updated
Noticed a nice feature that Repl.it has: it'll show a notification that "A new version is available; click here to reload". For a SPA where people might theoretically leave their tab open for a long time (and especially now that reloads aren't forced by auth so often), it would be valuable to have this for the queue.
Not totally sure how this would work - maybe we could embed the build time in the server-side code somehow? Or the git hash? Let's discuss how this might work
Service worker might be an approach. Since every byte difference in service worker source code is considered as an update, so you can embed a version number/git hash as part of the service worker source code and then go from there.
Potential Issue:
- For SPA, we might need to manually call the update method to trigger a check, but that's doable.
- Might need to figure out a way to manually update the service worker source code upon release, it's not ideal to do it by hand each time.
Related Link:
- https://deanhume.com/displaying-a-new-version-available-progressive-web-app/
- https://stackoverflow.com/questions/51748241/checking-for-service-worker-updates-in-a-single-page-app