Hi Joel, > On 25. Mar 2020, at 18:29, Joel Jucá <[email protected]> wrote: > > Hello community! > > I saw the announcement of CouchDB 3 with great enthusiasm when there was a > mention of the updated JavaScript engine, SpiderMonkey version 60. It seems > to fully support ES6, so it would be possible to write queries and/or > design documents using JavaScript modules (eg: ESM, CommonJS, etc.)?
You can already use CommonJS modules in CouchDB. This continues to work: https://docs.couchdb.org/en/stable/query-server/javascript.html#commonjs We didn’t build any support for ESM and that likely won’t happen, unless someone volunteers to champion that. > The thing that I always wondered would be how a professional flow could be > set up for a code that's supposed to live inside CouchDB. How could I write > code that's submitted to tests on a CI pipeline, and deployed to a CouchDB > instance on successful executions? Or, how could I leverage JavaScript/npm > ecosystem to build such functionalities? Also, how could I provision a > database from a blank-slate CouchDB (eg: a Docker image) and inject all > configurations *and* documents on it automatically? Is it something that > SpiderMonkey 60 could be helpful with? I recommend doing all this tooling outside of CouchDB. My favourite tool for this is https://github.com/jo/couchdb-bootstrap which allows significant automation of many things you might want to do. To add a layer of CI testing, I built https://github.com/janl/couchdb-ddoc-test some time ago. It is very basic, but does the job. Best Jan — > PS: I'm a basic user of CouchDB. I currently do not run services using it, > but I've been interested in using it for a while - hence my questions. > > -- > Joel Jucá > about.me/joelwallis
