I tried a lot of service workers and was getting errors that made no sense to me until I figured out I needed one built to work with React. I found it included in @captainn’s Meteor-React-Starter-Kit, as built by @nitrobay. Much appreciated!
Did a quick browse and cannot identify anything related to react. I can identify meteor-specific items. But what makes the service worker related to react?
I haven’t studied the internal tech of service workers, so I can’t respond with info about that. At the same time, the other service workers I tried, weren’t caching my React pages. In other words, if I went turned off internet access and did a page refresh, I got the network offline page. With this service worker, I can turn off internet access, do a page refresh – and I still see my fully active React component. Awesome!
@rjdavid this service worker can work with any Meteor front-end. I’m using it with Vue, but others have used it with Blaze and it should be independent of the front-end choice.
With a recent chrome update, there was an error that seems to be generated for many service worker implementations. I added some notes on the fix I used below:
Also, see the writeup @jkuester did on implementing this service worker by @nitrobay.
That is also my understanding @mullojo, that it is meteor-specific and front-end agnostic. I was using this previously before our needs evolved and we moved to something else.