-
Notifications
You must be signed in to change notification settings - Fork 121
Description
Problem (brief): The 'service worker' section of the README includes the content of serviceworker.js, however it's out of sync with the file and is broken.
Problem (detail): The main issue I noticed was when I was trying to get the custom offline page to work. The original JS file includes '/offline/' in 2 instances (note, wrapped in forward slashes), whereas the README has '/offline' in one instance and 'offline' in the other, which doesn't work as these aren't wrapped in forward slashes. It's such a minor bug that people will likely get very confused as to why it doesn't work if they copy the content from the README into their service worker file (as I did).
Proposed fix: Very easy fix - just link to the file instead. It may be tempting to just correct these forward slashes, but based on the DRY principle, we really shouldn't be repeating a whole file of code in the README when linking to it is sufficient, along with an explanation of something like "Here's our default service worker (link to file). To make your own custom service worker, you can copy this file and tweak its contents to cache the objects relevant to your project"