incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Walters <>
Subject Re: CB-280 - Improve layout of cordova-js scripts
Date Thu, 22 Mar 2012 13:48:48 GMT
Looking at the '2nd try at file refactoring'.  I like this structure
much better then the first try.  Regarding the following comment from
the commit:

       cp -R lib/common  gen/android
       cp -R lib/android gen/android

    'platform specific' files overwrite any 'common' files,
    per the order of the cp commands above.

This makes sense though we need to strive for platforms not overriding
'common' files since that negates the benefit of cordova-js common
API.  We do however need to provide mechanisms for the following:

1. Platforms should be able to add new modules not in common.  Your
refactor makes this easy.
2. Platforms need to be able to 'enhance' a common module API.  In the
short term this is currently accomplished through a platforms "merges"
object.  Long term we likely need to rethink this.
3. Platforms need to be able to proxy exec to a javascript
implementation as opposed to native.  This feature does not yet exist,
so platforms are using the "merges" object which overrides existing
API definition.

The reason I am mentioning the above is that if we refactored the code
as shown in your commit, then we need to rename files currently using
the "merges" approach as they would override common when they are
intended to augment common.

On Wed, Mar 21, 2012 at 5:26 PM, Patrick Mueller <> wrote:
> On Wed, Mar 21, 2012 at 17:42, Patrick Mueller <> wrote:
>> 2) additional flattening of removing 'platform'
>> lib/common
>> lib/android
>> lib/...
>> lib/scripts
> I like this.  You can try it yourself by running this script in the correct
> directory:
> It's non-destructive - it will add a 'lib2' directory to
> incubator-common-js, with the new split.
> It removes the 'cordova noise', and all the files in common and the
> platforms are at the same 'level'.
> --
> Patrick Mueller

View raw message