You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Andrew Grieve <ag...@chromium.org> on 2014/04/24 19:42:08 UTC

Coho Clean-up

I went coho crazy last night & this morning. Made two significant changes:

1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
and superspawn. This requires that your use node v0.11 or greater to
run it.

2. Broke all commands into their own files.

Many commands now run faster due to no shell.exec(). The node update
is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
alias default 0.11.

Re: Coho Clean-up

Posted by Andrew Grieve <ag...@chromium.org>.
Also also - coho now automatically runs with the
CWD=parent-of-cordova-coho (e.g. assumes your other cordova repos are
siblings of cordova-coho).

Can turn it off with --no-chdir

On Thu, Apr 24, 2014 at 2:27 PM, Michal Mocny <mm...@chromium.org> wrote:
> From the description of nave:
> "nave borrows concepts, inspiration, and code from Tim Caswell's "nvm" and
> Kris Kowal's "sea" programs."
> "Nvm is also really nice, but has to be sourced rather than being run, and
> thus is a little bit wonky for some use cases. But it doesn't involve
> subshells, which makes it better for some others."
>
>
> On Thu, Apr 24, 2014 at 2:19 PM, Brian LeRoux <b...@brian.io> wrote:
>>
>> not sure if there's a difference but I use nave for this
>>
>>
>> On Thu, Apr 24, 2014 at 10:59 AM, Andrew Grieve
>> <ag...@chromium.org>wrote:
>>
>> > FYI - if you're not using nvm (shame on you), the installers are here:
>> > http://nodejs.org/dist/v0.11.12/
>> >
>> > On Thu, Apr 24, 2014 at 1:42 PM, Andrew Grieve <ag...@chromium.org>
>> > wrote:
>> > > I went coho crazy last night & this morning. Made two significant
>> > changes:
>> > >
>> > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
>> > > and superspawn. This requires that your use node v0.11 or greater to
>> > > run it.
>> > >
>> > > 2. Broke all commands into their own files.
>> > >
>> > > Many commands now run faster due to no shell.exec(). The node update
>> > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
>> > > alias default 0.11.
>> >
>
>

Re: Coho Clean-up

Posted by Michal Mocny <mm...@chromium.org>.
>From the description of nave:
"nave borrows concepts, inspiration, and code from Tim Caswell's "nvm" and
Kris Kowal's "sea" programs."
"Nvm is also really nice, but has to be sourced rather than being run, and
thus is a little bit wonky for some use cases. But it doesn't involve
subshells, which makes it better for some others."


On Thu, Apr 24, 2014 at 2:19 PM, Brian LeRoux <b...@brian.io> wrote:

> not sure if there's a difference but I use nave for this
>
>
> On Thu, Apr 24, 2014 at 10:59 AM, Andrew Grieve <agrieve@chromium.org
> >wrote:
>
> > FYI - if you're not using nvm (shame on you), the installers are here:
> > http://nodejs.org/dist/v0.11.12/
> >
> > On Thu, Apr 24, 2014 at 1:42 PM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> > > I went coho crazy last night & this morning. Made two significant
> > changes:
> > >
> > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> > > and superspawn. This requires that your use node v0.11 or greater to
> > > run it.
> > >
> > > 2. Broke all commands into their own files.
> > >
> > > Many commands now run faster due to no shell.exec(). The node update
> > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> > > alias default 0.11.
> >
>

Re: Coho Clean-up

Posted by Brian LeRoux <b...@brian.io>.
not sure if there's a difference but I use nave for this


On Thu, Apr 24, 2014 at 10:59 AM, Andrew Grieve <ag...@chromium.org>wrote:

> FYI - if you're not using nvm (shame on you), the installers are here:
> http://nodejs.org/dist/v0.11.12/
>
> On Thu, Apr 24, 2014 at 1:42 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
> > I went coho crazy last night & this morning. Made two significant
> changes:
> >
> > 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> > and superspawn. This requires that your use node v0.11 or greater to
> > run it.
> >
> > 2. Broke all commands into their own files.
> >
> > Many commands now run faster due to no shell.exec(). The node update
> > is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> > alias default 0.11.
>

Re: Coho Clean-up

Posted by Andrew Grieve <ag...@chromium.org>.
FYI - if you're not using nvm (shame on you), the installers are here:
http://nodejs.org/dist/v0.11.12/

On Thu, Apr 24, 2014 at 1:42 PM, Andrew Grieve <ag...@chromium.org> wrote:
> I went coho crazy last night & this morning. Made two significant changes:
>
> 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> and superspawn. This requires that your use node v0.11 or greater to
> run it.
>
> 2. Broke all commands into their own files.
>
> Many commands now run faster due to no shell.exec(). The node update
> is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> alias default 0.11.

Re: Coho Clean-up

Posted by Brian LeRoux <b...@brian.io>.
/me groans

(that co business is really elegant…a rare sight for js)


On Thu, Apr 24, 2014 at 9:56 PM, Michal Mocny <mm...@chromium.org> wrote:

> On Thu, Apr 24, 2014 at 9:42 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > Yes, I will say that I was super impressed at how cleanly the code
> > converted to co-routines.
> >
> > I had started down the road of promises and quickly determined it was
> > infeasible.
> >
> > With "co", 99% of the change was converting function() -> function*(),
> > and added "yield" in-front of anything async.
> >
> > There's even code like:
> > if (cond1 && yield someAsyncThing()) {}
> >
> > Future is bright :)
> >
> You Promise?
>
>
> >
> >
> > On Thu, Apr 24, 2014 at 8:48 PM, Brian LeRoux <b...@brian.io> wrote:
> > > ok, this looks awesome. also this is good fun:
> > >
> > > https://github.com/apache/cordova-coho/blob/master/package.json#L10
> > >
> > >
> > > On Thu, Apr 24, 2014 at 3:46 PM, Steven Gill <st...@gmail.com>
> > wrote:
> > >
> > >> Thanks Andrew! Can't wait to check it out!
> > >>
> > >>
> > >> On Thu, Apr 24, 2014 at 2:15 PM, Anis KADRI <an...@gmail.com>
> > wrote:
> > >>
> > >> > cool
> > >> >
> > >> >
> > >> > On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:
> > >> >
> > >> > > Thanks for this Andrew!
> > >> > >
> > >> > >
> > >> > > On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <
> > agrieve@chromium.org
> > >> > > >wrote:
> > >> > >
> > >> > > > I went coho crazy last night & this morning. Made two
> significant
> > >> > > changes:
> > >> > > >
> > >> > > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses
> > >> co-routines
> > >> > > > and superspawn. This requires that your use node v0.11 or
> greater
> > to
> > >> > > > run it.
> > >> > > >
> > >> > > > 2. Broke all commands into their own files.
> > >> > > >
> > >> > > > Many commands now run faster due to no shell.exec(). The node
> > update
> > >> > > > is a paint, but meh. If you use nvm, it's just nvm install 0.11
> &&
> > >> nvm
> > >> > > > alias default 0.11.
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
>

Re: Coho Clean-up

Posted by Michal Mocny <mm...@chromium.org>.
On Thu, Apr 24, 2014 at 9:42 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Yes, I will say that I was super impressed at how cleanly the code
> converted to co-routines.
>
> I had started down the road of promises and quickly determined it was
> infeasible.
>
> With "co", 99% of the change was converting function() -> function*(),
> and added "yield" in-front of anything async.
>
> There's even code like:
> if (cond1 && yield someAsyncThing()) {}
>
> Future is bright :)
>
You Promise?


>
>
> On Thu, Apr 24, 2014 at 8:48 PM, Brian LeRoux <b...@brian.io> wrote:
> > ok, this looks awesome. also this is good fun:
> >
> > https://github.com/apache/cordova-coho/blob/master/package.json#L10
> >
> >
> > On Thu, Apr 24, 2014 at 3:46 PM, Steven Gill <st...@gmail.com>
> wrote:
> >
> >> Thanks Andrew! Can't wait to check it out!
> >>
> >>
> >> On Thu, Apr 24, 2014 at 2:15 PM, Anis KADRI <an...@gmail.com>
> wrote:
> >>
> >> > cool
> >> >
> >> >
> >> > On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:
> >> >
> >> > > Thanks for this Andrew!
> >> > >
> >> > >
> >> > > On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <
> agrieve@chromium.org
> >> > > >wrote:
> >> > >
> >> > > > I went coho crazy last night & this morning. Made two significant
> >> > > changes:
> >> > > >
> >> > > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses
> >> co-routines
> >> > > > and superspawn. This requires that your use node v0.11 or greater
> to
> >> > > > run it.
> >> > > >
> >> > > > 2. Broke all commands into their own files.
> >> > > >
> >> > > > Many commands now run faster due to no shell.exec(). The node
> update
> >> > > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 &&
> >> nvm
> >> > > > alias default 0.11.
> >> > > >
> >> > >
> >> >
> >>
>

Re: Coho Clean-up

Posted by Andrew Grieve <ag...@chromium.org>.
Yes, I will say that I was super impressed at how cleanly the code
converted to co-routines.

I had started down the road of promises and quickly determined it was
infeasible.

With "co", 99% of the change was converting function() -> function*(),
and added "yield" in-front of anything async.

There's even code like:
if (cond1 && yield someAsyncThing()) {}

Future is bright :)


On Thu, Apr 24, 2014 at 8:48 PM, Brian LeRoux <b...@brian.io> wrote:
> ok, this looks awesome. also this is good fun:
>
> https://github.com/apache/cordova-coho/blob/master/package.json#L10
>
>
> On Thu, Apr 24, 2014 at 3:46 PM, Steven Gill <st...@gmail.com> wrote:
>
>> Thanks Andrew! Can't wait to check it out!
>>
>>
>> On Thu, Apr 24, 2014 at 2:15 PM, Anis KADRI <an...@gmail.com> wrote:
>>
>> > cool
>> >
>> >
>> > On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:
>> >
>> > > Thanks for this Andrew!
>> > >
>> > >
>> > > On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <agrieve@chromium.org
>> > > >wrote:
>> > >
>> > > > I went coho crazy last night & this morning. Made two significant
>> > > changes:
>> > > >
>> > > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses
>> co-routines
>> > > > and superspawn. This requires that your use node v0.11 or greater to
>> > > > run it.
>> > > >
>> > > > 2. Broke all commands into their own files.
>> > > >
>> > > > Many commands now run faster due to no shell.exec(). The node update
>> > > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 &&
>> nvm
>> > > > alias default 0.11.
>> > > >
>> > >
>> >
>>

Re: Coho Clean-up

Posted by Brian LeRoux <b...@brian.io>.
ok, this looks awesome. also this is good fun:

https://github.com/apache/cordova-coho/blob/master/package.json#L10


On Thu, Apr 24, 2014 at 3:46 PM, Steven Gill <st...@gmail.com> wrote:

> Thanks Andrew! Can't wait to check it out!
>
>
> On Thu, Apr 24, 2014 at 2:15 PM, Anis KADRI <an...@gmail.com> wrote:
>
> > cool
> >
> >
> > On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > Thanks for this Andrew!
> > >
> > >
> > > On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <agrieve@chromium.org
> > > >wrote:
> > >
> > > > I went coho crazy last night & this morning. Made two significant
> > > changes:
> > > >
> > > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses
> co-routines
> > > > and superspawn. This requires that your use node v0.11 or greater to
> > > > run it.
> > > >
> > > > 2. Broke all commands into their own files.
> > > >
> > > > Many commands now run faster due to no shell.exec(). The node update
> > > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 &&
> nvm
> > > > alias default 0.11.
> > > >
> > >
> >
>

Re: Coho Clean-up

Posted by Steven Gill <st...@gmail.com>.
Thanks Andrew! Can't wait to check it out!


On Thu, Apr 24, 2014 at 2:15 PM, Anis KADRI <an...@gmail.com> wrote:

> cool
>
>
> On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:
>
> > Thanks for this Andrew!
> >
> >
> > On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <agrieve@chromium.org
> > >wrote:
> >
> > > I went coho crazy last night & this morning. Made two significant
> > changes:
> > >
> > > 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> > > and superspawn. This requires that your use node v0.11 or greater to
> > > run it.
> > >
> > > 2. Broke all commands into their own files.
> > >
> > > Many commands now run faster due to no shell.exec(). The node update
> > > is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> > > alias default 0.11.
> > >
> >
>

Re: Coho Clean-up

Posted by Anis KADRI <an...@gmail.com>.
cool


On Thu, Apr 24, 2014 at 1:50 PM, Shazron <sh...@gmail.com> wrote:

> Thanks for this Andrew!
>
>
> On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <agrieve@chromium.org
> >wrote:
>
> > I went coho crazy last night & this morning. Made two significant
> changes:
> >
> > 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> > and superspawn. This requires that your use node v0.11 or greater to
> > run it.
> >
> > 2. Broke all commands into their own files.
> >
> > Many commands now run faster due to no shell.exec(). The node update
> > is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> > alias default 0.11.
> >
>

Re: Coho Clean-up

Posted by Shazron <sh...@gmail.com>.
Thanks for this Andrew!


On Thu, Apr 24, 2014 at 10:42 AM, Andrew Grieve <ag...@chromium.org>wrote:

> I went coho crazy last night & this morning. Made two significant changes:
>
> 1. It doesn't use shelljs.exec() anymore. Instead, it uses co-routines
> and superspawn. This requires that your use node v0.11 or greater to
> run it.
>
> 2. Broke all commands into their own files.
>
> Many commands now run faster due to no shell.exec(). The node update
> is a paint, but meh. If you use nvm, it's just nvm install 0.11 && nvm
> alias default 0.11.
>