By: Dale Harvey
Published:05 September 2016
To celebrate the USA and Canada's Labo(u)r Day, we have decided to work extra hard to bring you PouchDB 6.0.0. This release brings early retirement to those features that have done great work over the years, but whose services are no longer necessary (don't worry, we will pay their pensions in full).
Along with the removed features, we have a large list of bugfixes, documentation work and general improvements for you to enjoy with your BBQ.
Removed FeaturesPouchDB 5.4.0 introduced some deprecations. In 6.0.0, we have now removed these features permanently:
( #5154 ) - Remove db.put(doc, id, rev)Please use db.put({_id: id, _rev: rev, data: 'foo'}) instead.
( #5251 ) - Remove new PouchDB(dbName).thenThe constructor is now stateless. If you need to test whether setup can complete, then new PouchDB(dbName).info() can do that for you.
Note this also applies to the callback style, i.e. new PouchDB(dbName, function (err) { /* ... */ } .
( #5591 ) - Remove SQLite Plugin supportThe WebSQL adapter no longer automatically detects the SQLite Plugin in Cordova environments. Please use the pouchdb-adapter-cordova-sqlite plugin instead.
( #5519 ) - Remove extras APIAPIs like require('pouchdb/extras/ajax') are gone. Instead these have been extracted out into separate packages:
Removed Use instead require('pouchdb/extras/ajax') require('pouchdb-ajax') require('pouchdb/extras/checkpointer') require('pouchdb-checkpointer') require('pouchdb/extras/generateReplicationId') require('pouchdb-generate-replication-id') require('pouchdb/extras/promise') require('pouchdb-promise') require('pouchdb/extras/fruitdown') require('pouchdb-adapter-fruitdown') * require('pouchdb/extras/localstorage') require('pouchdb-adapter-localstorage') * require('pouchdb/extras/memory') require('pouchdb-adapter-memory') * require('pouchdb/extras/websql') require('pouchdb-adapter-node-websql') ** For the adapters, you’ll also need to explicitly register them using PouchDB.plugin() , e.g. PouchDB.plugin(require('pouchdb-adapter-memory')) . Please seeCustom builds for more info.
( #5435 ) - Remove getUrl() , getHeaders() from HTTP adapterInstead of the getUrl() API, you can use db.name to determine the URL for HTTP-based adapters. For getHeaders() no replacement is intended. Both APIs were previously undocumented.
( #5625 , #5590 ) - Remove node-websql as dependency, remove optionalDependenciesleveldown and websql are no longer optional dependencies. Instead, websql is removed entirely (use pouchdb-adapter-node-websql instead), and leveldown is now required.
If you want to avoid installing leveldown , then you can use the pouchdb-browser preset if you don't need Node support, or you can use pouchdb-memory if you only need an in-memory database. For all other uses, seeCustom builds.
( #5612 ) - Sandbox view and filter function executionView and filter functions now execute in 'use strict' environments and within a sandbox in Node. If you were depending on non-strict mode or non-sandboxed behavior, then you will need to change your view/filter functions.
Bugfixes ( #5214 ) - Stop squelching errors ( #3962 ) - Limit concurrent attachment requests ( #4632 ) - Fix attachment md5sum memory leak ( #4967 ) - Fix map function called twice ( #5402 ) - Remove the unbounded accumulation of listeners ( #5379 ) - Do not update checkpoint if last_seq has not changed ( #5441 ) - Release memory faster in ajax requests ( #5450 ) - Don't leak change listeners ( #5172 ) - Differentiate between validation and non-validation errors ( #5527 ) - Check if ArrayBuffer is defined before binary check ( #5471 ) - PouchDB.plugin() giving more helpful errors ( #5574 ) - Encode db name if opts.prefix is a URL ( #5443 ) - Use PUT when checkpointing to remote dbs ( #5612 ) - Change view & filter function execution ( #5491 ) - Fix for scenario where xhr.response === null ( #5584 ) - Support options.timeout in a replication's bulkDocs() Documentation ( #5359 ) - Remove whitespace that breaks markdown rendering ( #5836 ) - Remove references to index.html to fix excerpts ( #5304 ) - Add ServiceWorker support to the website ( #5418 ) - Added PouchDB packages (websocket / stream) ( #5422 ) - Added GRADEpro GDT to the list of users of PouchDB ( #5449 ) - Add info about the emit fn in map functions ( #5556 ) - Fix typo: seperate -> separate ( #5570 ) - Fix tiny wording issue in changes() docs ( #5594 ) - Fix typo in CoC ( #5597 ) - Added last_seq to example ( #5412 ) - markdownify headings ( #5602 ) - Update ISSUE_TEMPLATE.md Get in touchAs always, please file issues or tell us what you think . And of course, a big thanks to all of our new and existing contributors !