Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E88D39039 for ; Fri, 24 Feb 2012 15:40:32 +0000 (UTC) Received: (qmail 64344 invoked by uid 500); 24 Feb 2012 15:40:32 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 64322 invoked by uid 500); 24 Feb 2012 15:40:32 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 64313 invoked by uid 99); 24 Feb 2012 15:40:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 15:40:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of purdrew@gmail.com designates 209.85.214.47 as permitted sender) Received: from [209.85.214.47] (HELO mail-bk0-f47.google.com) (209.85.214.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 15:40:26 +0000 Received: by bkwq11 with SMTP id q11so2234674bkw.6 for ; Fri, 24 Feb 2012 07:40:06 -0800 (PST) Received-SPF: pass (google.com: domain of purdrew@gmail.com designates 10.204.10.91 as permitted sender) client-ip=10.204.10.91; Authentication-Results: mr.google.com; spf=pass (google.com: domain of purdrew@gmail.com designates 10.204.10.91 as permitted sender) smtp.mail=purdrew@gmail.com; dkim=pass header.i=purdrew@gmail.com Received: from mr.google.com ([10.204.10.91]) by 10.204.10.91 with SMTP id o27mr1390937bko.17.1330098006271 (num_hops = 1); Fri, 24 Feb 2012 07:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=a9pvK1KdK+zVKzoXxjvMSN2ayIQcyY2FEJT0W1CRIZA=; b=C6NifTu9QROqENKQeerP+vdR5GlafjL1p950aFm+PbcNKvhjbLeXB83jNrNocYpGV/ LRo8JC6ajg2AWI4xFrT5eL4kogRC2VmIR09MZv7dZ5k/xM+02JgUVd39Pe+0j061nEwp hWJe0Ivcf/gnT0O3HTzNK93qg8ii7vXM/0hqs= Received: by 10.204.10.91 with SMTP id o27mr1150534bko.17.1330098006156; Fri, 24 Feb 2012 07:40:06 -0800 (PST) MIME-Version: 1.0 Sender: purdrew@gmail.com Received: by 10.204.174.68 with HTTP; Fri, 24 Feb 2012 07:39:46 -0800 (PST) In-Reply-To: References: From: Drew Walters Date: Fri, 24 Feb 2012 09:39:46 -0600 X-Google-Sender-Auth: ROlZxHyaFOaxyap3-ckpcP0ABq4 Message-ID: Subject: Re: proposed common-js file moves/renames for post-1.5 To: callback-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org > - rename `lib` to `cordova`, since that's the top level module bit in our > modules +1 > - move the platform-specific modules out of `lib`, into a new top-level > directory named `platform`, which has subdirectories for each platform, a= nd > then cordova/blah/... directories for any additional files for the > platform, including potentially overlaid files I don't understand why this would be a peer of `lib` and not a child. In your examples you list 'platform/android/cordova/exec.js'. This seems to imply that the platform specific files could apply to more then just cordova since cordova would be a child. Unless there is a reason for this, I still like 'cordova/platform/android/exec' better. Seems to me we would want to keep the module namespace beneath 'cordova'. > - there are also plain ol' scripts like `require.js` which should be > separate from the modules, in say a top-level `scripts` directory +1 though I think require.js is the only example of this so far and I would vote for keeping it under 'cordova' name space and in a 'lib' folder (showing my C roots). > I would also really like to create a subdirectory-per-plugin in the > `plugins` directory +1 As we more closely tie native plugin code to JS API from a packaging standpoint I think this needs to be done for manageability. On your wiki entry, the following example for 'moving platform files to separate directories' seems excessive: platform/android/cordova/plugin/android/app Based on my comments above I still like this better: cordova/platform/android/plugin/app Just my thoughts. On Thu, Feb 23, 2012 at 10:07 PM, Patrick Mueller wrote= : > I finally got a chance to start looking at the common-js bits this week. > > One thing that's had me confused, is figuring out how all the files get > combined into the platform-specific single files. =A0It's not real obviou= s > from looking at the files, or the resulting output. =A0Looking at the > packager.js script gives you the recipe, but it's nice to see the whole > thing laid out. =A0Which I couldn't see. > > I instrumented packager.js to dump the module names and original file nam= es > of the source. =A0The result is here: > > > https://github.com/pmuellr/incubator-cordova-js/wiki/cordova-js-file-to-m= odule-map > > (neat that you can enabled a wiki on your cloned GitHub repos!) > > On the left is the module id, the right is the original file name. > > Based on that, came up with a few thoughts on a clearer organization of t= he > .js files, here: > > > https://github.com/pmuellr/incubator-cordova-js/wiki/cordova-js-file-loca= tion-refactoring > > It seems to me like we should be able to do a little re-org of the files, > with changes to packager.js, to make things a little more obvious. =A0All > without changing any of the actual code - just the file names/directories= , > and packager.js > > Changes: > > - rename `lib` to `cordova`, since that's the top level module bit in our > modules > > - move the platform-specific modules out of `lib`, into a new top-level > directory named `platform`, which has subdirectories for each platform, a= nd > then cordova/blah/... directories for any additional files for the > platform, including potentially overlaid files > > - there are also plain ol' scripts like `require.js` which should be > separate from the modules, in say a top-level `scripts` directory > > All that would, I think, be a little clearer. =A0And would likely simplif= y > packager.js. =A0Would also easily allow you to 'overlay' a platform-speci= fic > file over a common one, if you wanted. > > If we had a 'portable' version of `cordova/exec.js` and > `cordova/platform.js`, that existed in the portable directory but was > always overwritten by platform builds, then the `cordova` directory could > actually be the source for a "mock" version of Cordova - that you could > load in a desktop browser, say. =A0In theory, it would be easy to ingest = this > kind of directory structure in an AMD environment as well. > > I would also really like to create a subdirectory-per-plugin in the > `plugins` directory, but this will affect other code, since those modules > names will be changing. =A0It's a step in the direction of "all our plugi= ns > are just like any other plugins". =A0Due to the code changes required, > wouldn't be including this in the first refactor. > > I was thinking this might be something we could do post-1.5. =A0Thought I= 'd > go ahead and start playing with it, see how it feels. =A0Anyone have > thoughts, or know of any reason why this wouldn't work, or be more > confusing than the current layout? > > -- > Patrick Mueller > http://muellerware.org