couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: Part2: What's up dev? About couchapps.
Date Tue, 02 Oct 2012 14:14:23 GMT
On Wed, Sep 26, 2012 at 1:36 PM, Dave Cottlehuber <dch@jsonified.com> wrote:
> TL;DR +1 for including erica[1] into CouchDB proper.
>
> To summarise a bit:
>
> There are about 3 key things that all couchy tools do [1]….[5]:
>
> - transform local js and erlang functions in separate files, into
> design doc format
> - include necessary libraries and attachments into those ddocs
> - upload that ddoc into CouchDB
>
> and optionally:
> - support cloning ddocs (downloading and reversing the transformation)
> - pushing arbitrary json docs with optional attachments
> - pre/post hooks to minify, uglify, etc
> - package mgmt
> - keep some local state & store it in the ddoc to avoid unnecessary
> transfer of attachments
>
> We need to make the first steps when moving past using futon as easy
> as possible, and consistent across platforms, with a minimal tooling
> requirement. Node is awesome but is moving way too fast, and erlang is
> the logical next choice.
>
> If Benoit is willing, a slimmed down erica[1] code could be included
> into CouchDB proper, or at least blessed as the canonical version.
> It's in erlang, & with some rebar magic you have a stand-alone escript
> that can be located anywhere in your path. The only additional code
> I'd like to see is that it supports multiple ddocs, and handle
> uploading normal docs as well as ddocs.


It could be done really fast. So if I summarize the needed features
for an initial release, that would be:

- take an fs structure and send it as a ddoc to couchdb. The fs
structure would handle js functions (shows, update, lists, views &
validations) as separate files + attachments
- upload this ddoc to couchapp

I would add the possibility to ignore some files in the folder (the
.couchapp ignore files)

Other possible features:

- handle multiple sources for attachments (?), can be done maybe by
adding multiple sources folders)
- send multiples ddocs from one folder
- handle arbitrary jsons + their attachments
- hooks
- clone a ddoc to the fs
- ddoc templates

Currently handled by erica:

- take an fs structure and send it as a ddoc to couchdb. The fs
structure would handle js functions (shows, update, lists, views &
validations) as separate files + attachments
- upload this ddoc to couchapp
- clone a ddoc to the fs
- ignore some files in the folder
- macros to include files inside a js functions (do we still need it
with the commonjs feature) ?
- ddoc templates : allows to reuse a structure and ship it to others.
(useful to distribute some js frameworks structure or corporate
templates)
- web editor/viewer


Would be interesting if we can decide on the features to have if we
follow this way. Tthere is still the possibility to generate a
database with futon and other couchapps we support) when we create a
release. Also what would be the name?

- benoit


>
> Personally, I only really understood ddocs after using CouchDB for
> quite a while. I suspect I am not alone in this!
>
> [1]: https://github.com/benoitc/erica
> [2]: https://github.com/mikeal/node.couchapp.js
> [3]: https://github.com/kanso/kanso
> [4]: http://reupholster.iriscouch.com/reupholster/_design/app/index.html
> [5]: https://github.com/quirkey/soca
>
> A+
> Dave

Mime
View raw message