By: Alba Herrerías
Published: 13 April 2022
We're happy to announce the release of PouchDB 7.3.0, bringing in features, fixes and dependency updates. For a full changelog from 7.2.2 to 7.3.0, please see the releases page or view the latest commits. Some of the highlights:
Improving testing
We have been investing lots of time into our test suites, with around 36 commits, 112 files changed, 3314 insertions and 2064 deletions made about this topic. We have:
- Migrated from Travis CI to Github Actions, which has improved the speed, throughput and reliability of our CI.
- Rewrote TESTING.md documentation.
- Upgraded eslint configuration in order to use ES6 syntax within our tests. Feel free to incorporate newer syntax (such as
async/await
) into your new tests contributions. - Fixed bugs in CI configuration: ADAPTERS and GREP variables weren't working correctly, background servers being started incorrectly, build failure caused by an older version of pouchdb-express-router.
- Unified the configuration variables used in the build.
- Fix the majority of non-deterministic tests to substantially reduce random failure during CI runs, and put in tooling for retrying failed tasks. This includes improving tests that check behaviour for unreachable servers, which previously relied on a third party service being available.
- Restructured the CI tasks so that each task exercises a single backend (i.e. CouchDB server version or client-side PouchDB adapter), rather than some combination of local and remote adapters. This reduces the impact of flaky tests, reduces the duration of each task, reduces redundant tasks repeating the same work, and allows more parallelisation of tests.
- Improved the test coverage across target platforms, including cross-browser tests, different Node.js versions, and different CouchDB versions. We have fixed tests that assume CouchDB v1.x behaviour so that they now work on v2.x and v3.x.
- Allowed the indexeddb adapter to be loaded and used during tests
Add indexeddb
adapter in the default distribution
The indexeddb adapter is now available in the default distribution. You can use it specifying the adapter:
PouchDB.plugin(require('pouchdb-adapter-indexeddb'));
const db = new PouchDB('mydb', {adapter: 'indexeddb'});
Please note that it is considered BETA quality, use it carefully and please report any issues you find. Thank you.
Add view_update_changes_batch_size
#8320 With view_update_changes_batch_size
, we can now specify how many change records will be consumed at a time when rebuilding view indexes when the query()
method is used.
Support partial_filter_selector
#8276 #8277 Now PouchDB-find supports partial_filter_selector
.
Indexing event to show the progress of view updates
#8321 We can now subscribe to an indexing
event, which will emit a progress
object containing the properties view
, last_seq
, results_count
and indexed_docs
.
Checkpoint events during replication
#8324 During replication, we can subscribe to checkpoint
events, which will emit the following properties: checkpoint
, revs_diff
, start_next_batch
and pending_batch
.
Add style
to replication options
#8380 #8379 We expose changes feed style
to replication options.
Add view_adapter
option
#8335 view_adapter
provides an option for the user to specify a separate adapter to store their view index in addition to the main adapter for their core data:
const db = new PouchDB(DB_NAME, {adapter: 'indexeddb', view_adapter: 'memory'});
Enable discussions and projects
In Github we have enabled:
- Discussions: feel free to open and participate
- Projects: we are keeping track of the issues and PRs for future releases.
Changelog
New features
- 7cc1c8e3 (#8171) - Allow
_access
field in documents - b359d788 Let caller set the change batch size when updating views (#8320)
- a9e2996b (#8277) - Support
partial_filter_selector
- 0875b19a Add an indexing event to show progress of view updates
- fe9bd028 Add checkpoint events during replication
- b523a1d2 (#8379) - Expose changes feed style to replication options (#8380)
- (#8335) Add view adapter option
Bugfixes
- b8d3fc65 (#8229) - indexeddb: ensure errors are propagated and handle database deletion
- fe7ffa9c (#8237) - Conform pouchdb find operators to couchdb's (#8327)
- 0e27e23f (#8222) - fix multiple $regex conditions on same field when using $and
- ab451d9e (#8165) - Initial dollar sign escaped with unit tests.
- f544c822 (#8242) - unhandled promise rejection in upsert
- 62dd11bf (#8185) - Fix date checking
- a6a34357 (#8187) - Don't include leveldown in browsers
- 9bf13109 (#7331) - Close leveldb file handlers
- be55391b (#8274) - rev() should clone only when needed
- 8377ae00 (#8316) - Properly handle transaction abort
- c4aaf255 Fix escaping of key path segments in indexeddb adapter (#8358)
- 77d9782a Fix memory leak when replications fails
- 73a9bad4 fix: add
auto_compaction
to indexeddb bulkDocs - (#8460) Fix writing erroneous attachment rev references in bulkDocs
- (#8370) Implement skip and limit for keys query #8404
- (#8473) Add stack to CustomPouchError (fix #8372)
- (#8473) Add idb global database failure error as reason to transaction errors #8414
Documentation
- d37fc6da (#8212) - Fix broken link to levelDB website
- ab97b853 (#8201) - Add indexeddb adapter option
- b3eaf791 (#8259) - Change link to firefox addon for deleting data
- f703887f (#8269) - Fix link to CouchDB docs related to views collation
- a5a920c9 (#8267) - Add pouchdb-adapter-hyperbee
- d6203248 (#8292) - Add Newt image
- ef0a2c6b (#8292) - Add Newt to Who's Using PouchDB (https://newt.to)
- 7532eb30 (#8261) - Bump redcarpet from 3.5.0 to 3.5.1 in /docs
- c3f06693 (#8279) - Bump kramdown from 2.3.0 to 2.3.1 in /docs
- 91b41360 (#8295) - Bump rexml from 3.2.4 to 3.2.5 in /docs
- 09a26ba9 (#8301) - Update overview.html
- 8b3ed089 (#8328) - Bump addressable from 2.7.0 to 2.8.0 in /docs
- a7b9b8c3 update IRC links
- 40cf3dac (#8354) - Docs: Update couchdb setup guide (#8355)
- a33bc407 Reorganise the testing documentation
- 349ca75e docs: Fix a few typos
- 0ad4770 (#8474) feat(docs) document the
partial_filter_selector
option to createIndex() - a44ae12 (#8474) feat(docs) add documentation for the indexing event
- 1c3ac70 (#8474) feat(docs) add documentation for the checkpoint event
Testing
- 04d2a458 (#8227) - Remove saucelabs test runs
- 095ada4f (#8319) - Fix node build ordering
- 451e7ec4 (#8325) - Reduce the number of travis runs
- 1e6cfa1a Update indexing event test to use async/await instead of callbacks
- 9f5da871 Update checkpoint event test to use async/await instead of callbacks
- 2218ed1c Parse query string into an object in webrunner.js
- b39b98f7 Load adapters as plugins only if they are present in
packages/node_modules/pouchdb/dist
- 731a83ba Remove the ADAPTER variable from the browser test scripts and update CI config and docs
- 7a8ff25f Replace remaining uses of ADAPTER in tests with ADAPTERS
- efa56c8c Turn indexeddb into a plugin and make it loadable via the ADAPTERS option
- 6c5d601a Run "find" tests against a single implementation at a time (#8359)
- 4a9562d2 Quote arguments to mocha(1) to make GREP work correctly (#8363)
- d9edb532 Fix mapreduce tests (#8365)
- 453dd3e6 Consistent loading of PouchDB in tests (#8366)
- 18c74c3e Migrate CI to GitHub Actions (#8368)
- 55b5ee5b Add test for broken skip in pouch-find (#8371)
- 566502c7 fix(test): skip test setup and assertions were wrong
- 07376ded chore(test): uncomment test for future fix
- 45413a6e chore: rename build node variable
- c0771a7d fix: skip building node on webpack tests
- 1fc976f7 Add webpack test to github actions
- 469a4938 Fix mapreduce tests that assume bulkDocs() response order, which pouchdb-server does not guarantee
- fc7f6855 Test for non-string values for
views.*.map
should pass on more recent CouchDB versions which do not reject the design doc on write, but fail on queries instead - 5b0903cb Add missing "npm test" command in mapreduce CI tasks
- ea46e5a8 Run integration tests on Node.js, and with the memory adapter, and use ADAPTERS (plural) to set the adapter
- 423124c0 Run integration tests against CouchDB and pouchdb-server
- 4040b214 Add all the combinations for testing the pouchdb-find plugin to the CI matrix
- 6893afd5 Build pouchdb-server correctly during tests on GitHub Actions
- d3912687 Refactor the GitHub actions workflows
- ac7bcc65 Do not run eslint after all tests, but make it a distinct task that other CI jobs depend on
- 6786456d test: add couchdb 2.3 browser matrix
- 1ba99d64 test: remove debugging logs
- ad520298 feat: add down server, use it in tests
- fc690dd4 test: refactor in replication test replicate from down server test
- e7e3eff7 feat: add retries to failed jobs in gha ci
- 31bc31f8 fix: node build on tests
Dependency updates
- 7b9ae245 (#8160) - fix: upgrade uuid from 8.1.0 to 8.3.0
- dca61ca1 (#8232) - Update node-fetch
- 3531d136 (#8235) - fix: upgrade fetch-cookie from 0.10.1 to 0.11.0
- 356d696c (#8254) - fix: upgrade uuid from 8.3.0 to 8.3.2
- e76f02f9 Upgrade pouchdb-express-router to 0.0.11 to fix sync tests
- 2c93c04f chore: remove unused dependency
- e4bda69f Revert "chore: remove unused dependency"
- f42cc235 fix: upgrade node-fetch from 2.6.1 to 2.6.2 (#8369)
- cd77102e fix: upgrade node-fetch from 2.6.2 to 2.6.4 (#8377)
- da0aac83 chore: upgrade ua-parser-js version (#8424)
- b810edd7 chore: remove unused dependency js-extend (#8425)
- c3333db0 chore: update eslint to the latest version (8.7.0)
- abf87a84 (#8440) - bump node-fetch to 2.6.7 (#8448)
- 3b980f21 Upgrade dependencies, remove request
Other changes
- 1ba87970 (#8167) - Revert Jekyll to 3.9.0 to be able to build documentation (+ doc updates)
- dfdb55e6 (#8219) - Update stale bot configuration
- 1a48c541 Upgrade eslint ecmaVersion to 8
- 1d8d7500 Update issue template's adapters
- d5f47348 chore: fix eslint running at
packages/node_modules
- d143e02e chore: remove local, unneeded eslint config
- b1742b1d chore: fix eslint no-prototype-builtins errors
- 41d70ea8 Update README's build status badge
- dae3e384 Add or update repository field in package.jsons
Get in touch
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!