farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
59 stars 38 forks source link

Improve service worker configuration #484

Open jgaehring opened 2 years ago

jgaehring commented 2 years ago

I installed vite-plugin-pwa in place of the workbox-webpack-plugin we were using previously. It's quite a bit nicer, much more transparent to the Workbox API, though the documentation is lacking in some places. The most useful documentation is actually in its type definitions.

I haven't dwelt too much on this, but now that we have better tooling for our service worker's configuration, it's probably worth evaluating what strategy we're using (currently "StaleWhileRevalidate") and what all we're choosing to cache. There's also some nice tooling for including an update prompt, which could be a nice alternative to maintaining my DIY onupdatefound function.