Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A061EBE7 for ; Mon, 25 Feb 2013 17:55:58 +0000 (UTC) Received: (qmail 40924 invoked by uid 500); 25 Feb 2013 17:55:58 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 40907 invoked by uid 500); 25 Feb 2013 17:55:58 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 40898 invoked by uid 99); 25 Feb 2013 17:55:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 17:55:57 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fil@adobe.com designates 64.18.1.25 as permitted sender) Received: from [64.18.1.25] (HELO exprod6og110.obsmtp.com) (64.18.1.25) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 17:55:52 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob110.postini.com ([64.18.5.12]) with SMTP ID DSNKUSulkx6D054a3MejSJiZuNZjd3A/mjIY@postini.com; Mon, 25 Feb 2013 09:55:32 PST Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r1PHqR1v018634 for ; Mon, 25 Feb 2013 09:52:27 -0800 (PST) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r1PHtVAV015248 for ; Mon, 25 Feb 2013 09:55:31 -0800 (PST) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas03.corp.adobe.com ([10.8.189.121]) with mapi; Mon, 25 Feb 2013 09:55:31 -0800 From: Filip Maj To: "dev@cordova.apache.org" Date: Mon, 25 Feb 2013 09:55:40 -0800 Subject: Re: Prototype for automatic JS installation in cordova-cli Thread-Topic: Prototype for automatic JS installation in cordova-cli Thread-Index: Ac4TgUy6YpeY9k09RXixtyC1+b3LZA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.1.130117 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Sweet! Thanks for putting this together Braden. I now have something to play with on the flight to Portland this afternoon :D Related, we had spoke a few months ago [1] about what to do with plugin installation and inclusion of plugin JS (as either concat'ed to cordova.js or with new script tags added to html files). We never really got to a solid conclusion but it seems like concatenation was the general consensus. The concern with concating is issue tracking will be hard (my cordova.js is different from yours). Brian brought up a good point in [1] that the config.xml ends up being a manifest that summarizes what your cordova.js should look like. While this helps, then we keep going up the slope once we hit different plugin versions.. Likely in the end we will need users to upload their cordova.js for figuring out plugin versions and whatnot. Just wanted to reiterate and perhaps bring that back to light. [1] http://markmail.org/message/tsbypckth2vcuib3 On 2/25/13 8:20 AM, "Braden Shepherdson" wrote: >I sent around a document[1] outlining my plan for automatically installing >plugin Javascript files last week. The prototype is complete and in a pull >request[2] now. > >tl;dr for how this works is: tags in the plugin.xml specify >, and for each JS file; cordova prepare copies >the JS files into the platforms and injects code at the end of cordova.js >to cordova.require the modules and do the clobbering and merging. > >Please take a look and see what you think. If you want to try it, check >out >my fork's auto_js branch and install it. You'll need some ported plugins >to >install, for which see: >https://github.com/MobileChromeApps/refresh >https://github.com/MobileChromeApps/chrome-cordova/tree/plugins/plugins/so >cket >https://github.com/MobileChromeApps/chrome-cordova/tree/plugins/plugins/st >orage > >I'm pleased with how things turned out, in the code and in the interface. >I >think this is the right approach for automatic installation. It doesn't >pollute top-level www, has no risk of collision between plugins or between >plugins and user code, and uses existing tools like the module mapper. > >Comments welcome. > >Braden > >[1] >https://docs.google.com/document/d/1fhwnIZ5TqwklGx71pLmfSghysls1S4_5ktEsjA >9ac5Y/edit >[2] https://github.com/apache/cordova-cli/pull/4