We are thrilled to announce the release of PouchDB's new major version 8.0.0. For a full changelog from 7.3.1 to 8.0.0, please see the releases page or view the latest commits. Here are the highlights:
Embracing modern ES6+ JS syntax
We have started the process of moving to ES6+ syntax. We made refactors to use native JS classes instead of prototypes, deprecated some packages that implemented features that are now built in the language (, ), and started in packages such as and . We encourage you to embrace the syntax in your new contributions and, if you can, contribute to the refactoring effort.
This might mean a potentially breaking change, therefore we bump the major version. If you need to support ES5 we recommend you use a transpiler.
Add activeTasks
#8422#8441 Analogous to the _active_tasks feature in CouchDB, PouchDB now has activeTasks. With this functionality, PouchDB is able to list all active database tasks, like database_compaction, view_indexing, or replication. PouchDB will report the progress of these tasks to the active tasks API and remove tasks as soon as they are completed or have failed.
#8453 Similar to CouchDB's purge, PouchDB has now purge for its indexeddb adapter.
Purge permanently removes data from the database. Normal deletion with db.remove() does not, it only marks the document as _deleted=true and creates a new revision. This behaviour ensures that deletes can be replicated across databases, and deleted documents don’t get undeleted by syncing with a database that still has this document.
db.purge() is not intended as a regular method for deleting documents, instead, it is meant as an admin function for cases where some secret was erroneously added to the database and must now be removed completely, eg. a credit card or social security number. Purge effectively puts the database in a state where the offending write never happened.
Example usage:
try {
const result = await db.purge('mydoc', '6-3a24009a9525bde9e4bfa8a99046b00d');
// handle result
} catch (error) {
// handle error
}
As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!