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 3AABC91EF for ; Fri, 18 Nov 2011 17:59:58 +0000 (UTC) Received: (qmail 61200 invoked by uid 500); 18 Nov 2011 17:59:58 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 61182 invoked by uid 500); 18 Nov 2011 17:59:58 -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 61173 invoked by uid 99); 18 Nov 2011 17:59:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2011 17:59:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alunny@gmail.com designates 209.85.220.175 as permitted sender) Received: from [209.85.220.175] (HELO mail-vx0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2011 17:59:52 +0000 Received: by vcbfo11 with SMTP id fo11so1021003vcb.6 for ; Fri, 18 Nov 2011 09:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=wC9yJODVzMS2C2YbcsHaUtV+F9OSgv4+DsVF/6RoyWs=; b=aCPGcnLXfWET2dlgMr5OI6C849+tLutqPMCJn+sEPdFthzvpc6GDVUjS6IBR3qieKH N2Q9mgJmsfk2k1bRGvjUAM+DgqNnlfKEU/O3N3y9y9QrPAUsuoLRVizOVGsVSUzCt9QF Kx8RmBHryIhEkfjeRmpx/3ocP3FUg7jo+b63A= MIME-Version: 1.0 Received: by 10.224.194.193 with SMTP id dz1mr1869243qab.98.1321639170891; Fri, 18 Nov 2011 09:59:30 -0800 (PST) Received: by 10.229.85.200 with HTTP; Fri, 18 Nov 2011 09:59:30 -0800 (PST) Reply-To: alunny@gmail.com In-Reply-To: References: Date: Fri, 18 Nov 2011 09:59:30 -0800 Message-ID: Subject: Re: Unified phonegap javascript layer incorperating modules / plugins From: Andrew Lunny To: Brian LeRoux Cc: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=20cf300fb0394d60a204b20619ef X-Virus-Checked: Checked by ClamAV on apache.org --20cf300fb0394d60a204b20619ef Content-Type: text/plain; charset=ISO-8859-1 On 17 November 2011 23:50, Brian LeRoux wrote: > The other issue, for our purposes, is some (tho not all) AMD style > compilers will end up w/ a larger footprint b/c of all the extra > ceremony. Not to mention more closure ceremony. We'd actually hurt > performance. > This is an assertion without any evidence that (a) performance would be worse or (b) the performance impact would significantly impact apps. There's no reason why AMD can't be used as an organization tool during development and compiled to a single file for production. > > From the aesthetics side, AMD is harder to read/write than a CommonJS > exports style. > AMD uses immediately-invoked functions, as the vast majority of JavaScript libraries do. There's no more "closure ceremony" than in the XUI source. But it's a point of opinion. > > From a future proofing perspective Harmony Modules will support > CommonJS. Not that a rewrite is beyond our capacity but its nice to > know that once the lang supports modules our code should 'just work'. > No, Harmony will have new syntax for modules: http://wiki.ecmascript.org/doku.php?id=harmony:modules_examples and http://wiki.ecmascript.org/doku.php?id=harmony:modules > I doubt that'll be the case but, hey, we can hope. I do know James > Burke, author of RequireJS AMD lib, is working towards a shim for > Harmony Modules but his work isn't complete yet. > James also wrote a post a couple of days ago defending AMD as still the best pragmatic choice for client-side devs: http://tagneto.blogspot.com/2011/11/why-not-amd.html > So in short, CommonJS gives us: > Node is not CommonJS - it has a module system based on an early draft of the CommonJS work, that is not common to any other JavaScript environment. > - better performance > - better aesthetics > - closer to the future > > "closer to the future" is factually incorrect. The other two are unqualified assertions. > +1 for AMD > > (But pls do a prototype anyhow b/c I think it would be interesting for > us to contrast.) > > > On Fri, Nov 18, 2011 at 7:59 AM, Andrew Lunny wrote: > > What's the reasoning behind developing this as a Node module? > > > > Node's great but I'm not sure if it's the best suited tool for this job - > > is it worth considering using AMD modules with existing script > > loaders/preprocessors? The JavaScript layer of PhoneGap/Callback is a > > client-side application, so I'd be in favour of going with the grain of > > existing client-side module solutions (requirejs, based on dojo modules, > > being the most prominent one). > > > > (hope to have some time to protoype something based on Gord's work, with > > AMD instead, in the next couple of weeks, but I'm curious what the other > > devs' thoughts are) > > > > On 17 November 2011 22:47, Dave Johnson > wrote: > > > >> Awesome. Looking forward to working on this! > >> > >> -dave > >> On Nov 17, 2011 1:13 PM, "Gord Tanner" wrote: > >> > >> > Hello, > >> > > >> > I have put together a quick prototype to iron out some of the design > >> > choices I think would really help phonegap to get to a point where we > >> have > >> > one common javascript layer for all platforms. > >> > > >> > Source can be found here: > >> > https://github.com/gtanner/phonegap > >> > > >> > the HACKING file outlines key areas to focus on: > >> > https://github.com/gtanner/phonegap/blob/master/HACKING > >> > > >> > Key points: > >> > > >> > - All API definitions in phonegap should be plugins / modules. > >> > - In additional to being able to require in submodules, the existing > >> > phonegap APIs should still be injected. > >> > - There is one javascript project that is common across all platforms. > >> > -- Should allow for platform specific overrides > >> > -- Should allow for 3rd party modules to easily be included and used. > >> > > >> > > >> > Currently this has only been tested on Ripple (ripple.tinyhippos.com) > >> in a > >> > special prototype branch I wrote to emulate the native layer a little > >> > closer. If you want to run it instructions can be found in the readme > >> > file: > >> > https://github.com/gtanner/phonegap/blob/master/README.md > >> > > >> > > >> > The plan is to further define this architecture and rapidly build out > >> more > >> > support next week and get it running on a few of the platforms. > >> > > >> > Cheers! > >> > > >> > ----- > >> > Gord Tanner > >> > Code Poet > >> > Research In Motion > >> > > >> > > > --20cf300fb0394d60a204b20619ef--