skill-collectors / weather-app

A VueJS Weather App
GNU General Public License v3.0
1 stars 2 forks source link

Create a service worker #63

Open dave-burke opened 3 years ago

dave-burke commented 3 years ago

Create a service worker and manifest file to make it a Progressive Web App. We should pick a library to use for this. I've heard Workbox (which might already come with Vue), Firebase, and UpUp are popular.

dave-burke commented 3 years ago

The app does register a service worker in src/registerServiceWorker.ts, and the documentation for vue/cli-plugin-pwa does reference using Workbox.

It basically works out of the box, but there are a few things we'll want to tweak to really get the "App" working correctly:

  1. Update the icons (#64)
  2. Do something in the service worker's updated() function to prompt the user to refresh. When the app is "installed" it won't have browser controls to provide a refresh button. It should be as easy as calling window.location.reload(true); but I remember having trouble with that working inconsistently in the PWA app I made a few months ago.