https://github.com/yerkopalma/sw-starter-full
:sparkles: More realistic service worker starter
https://github.com/yerkopalma/sw-starter-full
Last synced: 3 months ago
JSON representation
:sparkles: More realistic service worker starter
- Host: GitHub
- URL: https://github.com/yerkopalma/sw-starter-full
- Owner: YerkoPalma
- License: mit
- Created: 2016-08-03T03:17:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-11T16:55:57.000Z (almost 9 years ago)
- Last Synced: 2025-03-16T22:36:25.248Z (3 months ago)
- Language: JavaScript
- Homepage: https://sw-starter-full.surge.sh
- Size: 343 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Full service worker starter [](https://travis-ci.org/YerkoPalma/sw-starter-full)
===========================> More realistic service worker starter
Check here: https://sw-starter-full.surge.sh
## Overview
This is some sort of a second part of my simple [sw-starter](https://github.com/YerkoPalma/sw-starter). The main differences here are:
- No `localStorage`, instead [`Dexie.js`](https://github.com/dfahlander/Dexie.js) is used
- The service-worker is now generated with [`sw-precache`](https://github.com/GoogleChrome/sw-precache)
- The _offline first_ strategy is a bit improved## Knowledge
- `sw-precache` only cache the assets of the proyect, and to cache the data, ~~should use different _fetch_ handler~~ use only the local database.
- In the `sw-precache` should be included specificly the files to cache to ignore junk files.
- Firebase use only Objects, no arrays, so, some hack need to be done to properly handle data.
- Local data should never replace network data, so `xhr` should always be done.
- HTTPS can be a pain. I found the best way to work for SPA is, develop on the cloud (I used c9.io) and deploy to third party service (I used surge.sh).
## See also- [Getting started with PWAs](https://addyosmani.com/blog/getting-started-with-progressive-web-apps/)
- [Storage on the web](https://github.com/addyosmani/storage-on-the-web)
- [Your first PWA](https://developers.google.com/web/fundamentals/getting-started/your-first-progressive-web-app/?hl=en)
- [Firebase REST API](https://www.firebase.com/docs/rest/api/)
- [Dexie.js offline sample](https://github.com/matthew-andrews/offline-todo-dexie/blob/gh-pages/application.js)## License
MIT © [YerkoPalma](https://github.com/YerkoPalma)