Skip to content

Commit

Permalink
Remove the ServiceWorker cache polyfill
Browse files Browse the repository at this point in the history
This has been deprecated, see dominiccooney/cache-polyfill#17

Closes #22
  • Loading branch information
shaun554 committed Dec 17, 2015
1 parent 2ec27ea commit 0d6e822
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 78 deletions.
2 changes: 0 additions & 2 deletions FILE-APPENDIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@
* `server.js`: The development server, which allows us to go to `localhost:3000` and see the application live. Also makes hot-reloading work.

* `serviceworker.js`: The script that tells the serviceworker how to cache our files.

* `serviceworker-cache-polyfill.js`: A polyfill for the `ServiceWorker` cache, which isn't yet fully supported everywhere. (See [https://jakearchibald.com/2014/using-serviceworker-today/](here) for more information)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ To cache a file, add it to the `urlsToCache` variable in the [`serviceworker.js`

**Careful** about removing this, as there is no real downside to having your application available when the users network connection isn't perfect.

To remove offline capability, delete [`serviceworker.js`](serviceworker.js) and [`serviceworker-cache-polyfill.js`](serviceworker-cache-polyfill.js), don't import them in the [`app.js`](js/app.js), remove `AppCachePlugin` in [`makewebpackconfig.js`](makewebpackconfig.js) and remove the `manifest` attribute of the `<html>` tag in [`index.html`](index.html).
To remove offline capability, delete [`serviceworker.js`](serviceworker.js), remove the import in [`app.js`](js/app.js), remove `AppCachePlugin` in [`makewebpackconfig.js`](makewebpackconfig.js) and remove the `manifest` attribute of the `<html>` tag in [`index.html`](index.html).

### Add To Homescreen

Expand Down
1 change: 0 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

// Load the ServiceWorker, the Cache polyfill, the manifest.json file and the .htaccess file
import 'file?name=[name].[ext]!../serviceworker.js';
import 'file?name=[name].[ext]!../serviceworker-cache-polyfill.js';
import 'file?name=[name].[ext]!../manifest.json';
import 'file?name=[name].[ext]!../.htaccess';

Expand Down
72 changes: 0 additions & 72 deletions serviceworker-cache-polyfill.js

This file was deleted.

2 changes: 0 additions & 2 deletions serviceworker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
importScripts('serviceworker-cache-polyfill.js');

var CACHE_NAME = 'react-boilerplate-cache-v1';
// The files we want to cache
var urlsToCache = [
Expand Down

0 comments on commit 0d6e822

Please sign in to comment.