Skip to content

Commit

Permalink
(#4329) - clean up docs, add fruitdown safari test
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Oct 6, 2015
1 parent a0fc6a9 commit 25da9e5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ env:
- CLIENT=saucelabs:safari:6 COMMAND=test
- CLIENT="saucelabs:internet explorer:10:Windows 8" COMMAND=test
- CLIENT="saucelabs:internet explorer:10:Windows 8" ADAPTERS=memory COMMAND=test
- CLIENT="saucelabs:iphone:8.4:OS X 10.11" ADAPTERS=fruitdown GREP=suite2 INVERT=true COMMAND=test
- CLIENT="saucelabs:iphone:8.4:OS X 10.11" ADAPTERS=fruitdown GREP=suite2 COMMAND=test

# split up the android+iphone tests as it goes over time
- GREP=suite2 INVERT=true SKIP_MIGRATION=true CLIENT="saucelabs:iphone:8.1:OS X 10.10" COMMAND=test
Expand Down
30 changes: 16 additions & 14 deletions docs/_includes/api/extras.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@

These adapters are alternatives to PouchDB's built-in IndexedDB/WebSQL adapters. They fully pass the PouchDB test suite.

#### FruitDOWN adapter

{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/fruitdown');

var db = new PouchDB('mydb', {adapter: 'fruitdown'});
{% endhighlight %}

PouchDB adapter using [FruitDOWN](https://github.com/nolanlawson/fruitdown).
This is an alternative to the default IndexedDB adapter that ships with PouchDB, which works over all implementations of IndexedDB, including Apple's buggy version.

You can also download this plugin [as a standalone script](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.fruitdown.js).

#### In-memory adapter

{% highlight js %}
Expand Down Expand Up @@ -68,6 +54,22 @@
{% endmarkdown %}
{% include alert/end.html%}

#### FruitDOWN adapter

{% highlight js %}
var PouchDB = require('pouchdb');
require('pouchdb/extras/fruitdown');

var db = new PouchDB('mydb', {adapter: 'fruitdown'});
{% endhighlight %}

PouchDB adapter using [FruitDOWN](https://github.com/nolanlawson/fruitdown).
This is an alternative to the default IndexedDB adapter that ships with PouchDB, which works over all implementations of IndexedDB, including Apple's version.

It is slower and more inefficient than PouchDB's default IndexedDB adapter, but it's handy if you need to use IndexedDB in Safari, iOS, WKWebView, etc.

You can also download this plugin [as a standalone script](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.fruitdown.js).

### APIs for plugin authors

These APIs are designed for PouchDB plugin authors, who may want to re-use some PouchDB code to avoid duplication.
Expand Down
14 changes: 14 additions & 0 deletions docs/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ PouchDB also offers separate browser plugins that use backends other than Indexe

* [pouchdb.memory.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.memory.js) (Minified: [pouchdb.memory.min.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.memory.min.js))
* [pouchdb.localstorage.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.localstorage.js) (Minified: [pouchdb.localstorage.min.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.localstorage.min.js))
* [pouchdb.fruitdown.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.fruitdown.js) (Minified: [pouchdb.fruitdown.min.js](https://github.com/pouchdb/pouchdb/releases/download/{{ site.version }}/pouchdb.fruitdown.min.js))

{% include alert/start.html variant="warning"%}
{% markdown %}
Expand Down Expand Up @@ -207,6 +208,19 @@ If you need to support very old browsers, such as IE ≤ 9.0 and Opera Mini, yo
The LocalStorage plugin should be considered highly experimental, and the underlying structure may change in the future. Currently it stores all document IDs in memory, which works fine on small databases but may crash on larger databases. You can follow <a href='https://github.com/No9/localstorage-down'>localstorage-down</a> to track our progress.
{% include alert/end.html %}

#### FruitDOWN adapter

If you need to support IndexedDB in Apple browsers (which PouchDB normally does not support due to instability), then you can use FruitDOWN, which works over all IndexedDB implementations at the expense of using a much smaller part of the IndexedDB API and therefore being slower and less efficient.

```html
<script src="pouchdb.js"></script>
<script src="pouchdb.fruitdown.js"></script>
<script>
// this pouch is backed by FruitDOWN
var pouch = new PouchDB('mydb', {adapter: 'fruitdown'});
</script>
```

{% include anchor.html title="PouchDB in Node.js" hash="pouchdb_in_node_js"%}

In Node.js, the adapter situation is much simpler than in browsers. By default, if you create a PouchDB like this one:
Expand Down

0 comments on commit 25da9e5

Please sign in to comment.