From 803628b0b3d08e74e278d57dcf8304312ee9894c Mon Sep 17 00:00:00 2001 From: Niels Dequeker Date: Sun, 14 Jan 2018 16:29:25 +0100 Subject: [PATCH 1/3] #207 Update documentation on Offline First --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0327d4..b64e884 100644 --- a/README.md +++ b/README.md @@ -439,9 +439,24 @@ app.import('bower_components/pouchdb-authentication/dist/pouchdb.authentication. Ember Pouch is really just a thin layer of Ember-y goodness over [Relational Pouch](https://github.com/pouchdb-community/relational-pouch). Before you file an issue, check to see if it's more appropriate to file over there. -### Offline first +### Offline First + +Saving data locally using PouchDB is one part of making a web application [Offline First](http://offlinefirst.org/). However, you will also need to make your static assets available offline. + +There are two possible approaches to this. The first one is using the Application Cache (AP). The second one is using Service Workers (SW). The Application Cache specification has been [removed from the Web standards](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache). Mozilla now recommends to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) instead. + +Most browser vendors still provide support for AC and are in the process of implementing Service Workers. So depending on the browsers you target, you should go for one or the other. You can track the progress via [caniuse.com](https://caniuse.com/#feat=serviceworkers). + +#### 1. Application Cache + +You can use [broccoli-manifest](https://github.com/racido/broccoli-manifest) to create an HTML5 `appcache.manifest` file. This By default, will allow your index.html and `assets` directory to load even if the user is offline. + +#### 2. Service Workers + +We recommend using [Ember Service Worker](http://ember-service-worker.com) to get started with Service Workers for your web application. The website provide's an easy to follow guide on getting started with the addon. + +You can also take a look at Martin Broerse his [ember-cli-blog](https://github.com/broerse/ember-cli-blog/blob/14b95b443b851afa3632be3cbe631f055664b340/ember-cli-build.js) configuration for the plugin. -If you want to go completely [offline-first](http://offlinefirst.org/), you'll also need an HTML5 appcache.manifest with [broccoli-manifest](https://github.com/racido/broccoli-manifest). This will allow your HTML/CSS/JS assets to load even if the user is offline. Plus your users can "add to homescreen" on a mobile device (iOS/Android). ### Security From a8e332ed581055b9d06db6181acb23b46608a751 Mon Sep 17 00:00:00 2001 From: Niels Dequeker Date: Sun, 14 Jan 2018 16:35:36 +0100 Subject: [PATCH 2/3] #207 Add note on iOS --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b64e884..e6c6f70 100644 --- a/README.md +++ b/README.md @@ -443,9 +443,9 @@ Ember Pouch is really just a thin layer of Ember-y goodness over [Relational Pou Saving data locally using PouchDB is one part of making a web application [Offline First](http://offlinefirst.org/). However, you will also need to make your static assets available offline. -There are two possible approaches to this. The first one is using the Application Cache (AP). The second one is using Service Workers (SW). The Application Cache specification has been [removed from the Web standards](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache). Mozilla now recommends to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) instead. +There are two possible approaches to this. The first one is using the Application Cache (AP) feature. The second one is using Service Workers (SW). The Application Cache specification has been [removed from the Web standards](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache). Mozilla now recommends to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) instead. -Most browser vendors still provide support for AC and are in the process of implementing Service Workers. So depending on the browsers you target, you should go for one or the other. You can track the progress via [caniuse.com](https://caniuse.com/#feat=serviceworkers). +Most browser vendors still provide support for Application Cache and are in the process of implementing Service Workers. So depending on the browsers you target, you should go for one or the other. You can track the progress via [caniuse.com](https://caniuse.com/#feat=serviceworkers). #### 1. Application Cache @@ -457,6 +457,8 @@ We recommend using [Ember Service Worker](http://ember-service-worker.com) to ge You can also take a look at Martin Broerse his [ember-cli-blog](https://github.com/broerse/ember-cli-blog/blob/14b95b443b851afa3632be3cbe631f055664b340/ember-cli-build.js) configuration for the plugin. +⚠️ iOS does not yet support Service Workers. If you want to make your assets available offline for an iPhone of iPad, you have to go for the Application Cache strategy. Since Jan 10, 2018, [Safari Technology Preview does support Service Workers](https://webkit.org/blog/8060/release-notes-for-safari-technology-preview-47/). It's expected to land in iOS 12, but there's no certainity about that. + ### Security From 729338f23912b94663d63d203b46824c3d778d38 Mon Sep 17 00:00:00 2001 From: Niels Dequeker Date: Sun, 14 Jan 2018 16:37:21 +0100 Subject: [PATCH 3/3] #207 Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6c6f70..5e27c61 100644 --- a/README.md +++ b/README.md @@ -457,7 +457,7 @@ We recommend using [Ember Service Worker](http://ember-service-worker.com) to ge You can also take a look at Martin Broerse his [ember-cli-blog](https://github.com/broerse/ember-cli-blog/blob/14b95b443b851afa3632be3cbe631f055664b340/ember-cli-build.js) configuration for the plugin. -⚠️ iOS does not yet support Service Workers. If you want to make your assets available offline for an iPhone of iPad, you have to go for the Application Cache strategy. Since Jan 10, 2018, [Safari Technology Preview does support Service Workers](https://webkit.org/blog/8060/release-notes-for-safari-technology-preview-47/). It's expected to land in iOS 12, but there's no certainity about that. +⚠️ iOS does not yet support Service Workers. If you want to make your assets available offline for an iPhone or iPad, you have to go for the Application Cache strategy. Since Jan 10, 2018, [Safari Technology Preview does support Service Workers](https://webkit.org/blog/8060/release-notes-for-safari-technology-preview-47/). It's expected to land in iOS 12, but there's no certainity about that. ### Security