You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2012/10/02 16:14:23 UTC

Re: Part2: What's up dev? About couchapps.

On Wed, Sep 26, 2012 at 1:36 PM, Dave Cottlehuber <dc...@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

Re: Part2: What's up dev? About couchapps.

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 2 October 2012 16:14, Benoit Chesneau <bc...@gmail.com> wrote:
> On Wed, Sep 26, 2012 at 1:36 PM, Dave Cottlehuber <dc...@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

Should also handle plain JSON docs.

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

Yes.

> Other possible features:

Nice if the node-style app.js format can be accommodated.

> - 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) ?

I don't think so, unless its important to support existing couchapps
that rely on it.

> - 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

Better off providing that as an external couchapp?

>
>
> 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?

Anything but couchapp to avoid confusion.

A+
Dave

Re: Part2: What's up dev? About couchapps.

Posted by Noah Slater <ns...@tumbolia.org>.
On Tue, Oct 2, 2012 at 3:14 PM, Benoit Chesneau <bc...@gmail.com> wrote:

>
> - web editor/viewer
>

Is this something that could be rolled into Futon? (Just spitballin here.)

(As a side note, I love the idea of being able to suck down a DD, see the
files, edit them, and blow it back. And, like you said, this doesn't have
to follow any specific format. As long as there is a standard DD/FS
mapping.)

Why don't you put a design proposal up on the wiki, and we can invite
contributions to it there.

It's getting a bit hard to track all of the ideas, and rationales, in these
email threads.

If we can get a design proposal that the community likes, implementing it
should be simple enough.

We can reach out to the existing "CouchApp" community pockets, and ask for
comments.

(Let's not get hung up on names, for now.)

Thanks,

-- 
NS