185driver / pwa-app-updates Goto Github PK
View Code? Open in Web Editor NEWGive Users Control Over App Updates in Vue CLI 3 PWAs
Home Page: https://medium.com/@dougallrich/give-users-control-over-app-updates-in-vue-cli-3-pwas-20453aedc1f2
Give Users Control Over App Updates in Vue CLI 3 PWAs
Home Page: https://medium.com/@dougallrich/give-users-control-over-app-updates-in-vue-cli-3-pwas-20453aedc1f2
Just an fyi, this line in App.vue Created event:
navigator.serviceWorker.addEventListener("controllerchange", () => {
will cause a vuetify app to go "snakey" and exhibit strange behaviour like clicks not working in data tables, menus not dropping down on toolbar etc if the app happens to be not localhost or not https and so service worker can't operate.
Removing that line reliably fixes this problem but of course breaks the whole thing when service workers are supported; but it's a big issue in cases where users run the app locally on a private network as an option rather than hosted (for example).
I'm currently trying to figure out how to work around this, it's taking forever due to a slow build process and a phone as my only test device outside my localhost; I'm guessing there is a simple way to not call this by detecting if service worker is running but haven't go there yet.
You might consider adding a conditional to that line to fix this issue.
=-=-=-
UPDATE: well that was easy:
if (navigator.serviceWorker) {
navigator.serviceWorker.addEventListener("controllerchange", () => {
...etc...
Please consider updating your article and code (perhaps that guy who straight up copied your article will update his as well :) )
I got this error Uncaught TypeError: workbox.clientsClaim is not a function
after I installed Vue CLI 4.
This implements Workbox v4.
workbox.clientsClaim();
is deprecated and should become workbox.core.clientsClaim();
See:
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-v3
In case someone runs in this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.