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 2B7DA10D08 for ; Fri, 21 Jun 2013 13:13:27 +0000 (UTC) Received: (qmail 91142 invoked by uid 500); 21 Jun 2013 13:13:26 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 91120 invoked by uid 500); 21 Jun 2013 13:13:26 -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 91111 invoked by uid 99); 21 Jun 2013 13:13:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jun 2013 13:13:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of agrieve@google.com designates 209.85.214.179 as permitted sender) Received: from [209.85.214.179] (HELO mail-ob0-f179.google.com) (209.85.214.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jun 2013 13:13:22 +0000 Received: by mail-ob0-f179.google.com with SMTP id xk17so8467604obc.38 for ; Fri, 21 Jun 2013 06:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=gsB7wa0Lh656WMriNOgYJtP5CorSypkYQnjKvXjcsLc=; b=B5zncO4XZhFw+6p6NA/Mi21sCU9GwhAVK+tJ8vrtdcpmkxJ/qQ/PF/DSQ2sWFmu6HX 4bu/Ik64wclJ+AN8Og8Em/rIHuV+IWpWGzRsfGm35WYAmSp9T9FveIVzIpHKOyw29Z96 KCoGIhrynXxhKFM/7q95wHXYR1pz8M+PeuxdBsimHd0Es0/odCeJDYn7XSjQZ25fd4pL el12Pm+WeYIIMCLDxDtzywI0ZNCrdxGWs5Ja68CNHJs38vDTwRfC2zD6LRCuiiR6rJMC 7JWDDUcLD1E44V1AQhlb1ww/NEjGRgkdW1XJGAZI1c7L81+B71KTIbpfXOhNqxvmhx2s bDYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=gsB7wa0Lh656WMriNOgYJtP5CorSypkYQnjKvXjcsLc=; b=AMJwnKCoS57dN0LRK+6/2VjlEHISTssawHuVl0KPgg4VqpxJ0Fq2dWfqSuT1wOrWxd gzeu6SmT9pmdpPC8Y42/ei3hb95GQHhI7e6o7Amy8qMYSTwtb3F7WH5DCzDufrkyMvDf 3DZBRoxeKFXvEqalx3zfIMzhRWv96EcxpHKwY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=gsB7wa0Lh656WMriNOgYJtP5CorSypkYQnjKvXjcsLc=; b=eXvfIVh+11JwJfJSj6nFfgHXmqtk7qy0Yv/VSWxN9+qjVlpS+fP+fLgdUqj6s92dSP LyPybmiWIznMyZsKr8w153xY76Tx5SBbg60f+GYp7guRhOM75hS05WukMIpU5S6mM7f5 +2jFBcR34wgShvq3jJXk22XFeKjuwDXrIehHTVEYRkHbMJk+t5BQaA+Yf56sDPakqcie RSoyhPs8nyxslOsXpEJ3YFkjL5InAYoWaSM7hrD0difzYoUROrKvTMg1p3rOGSIsy5fD PZbDv8X3uuuSfzy4WB+r8H0Wb8rpi2YV7eIRFxIJtfWPW8HhafTm8y8ePX8Juir9NAOP Abjg== X-Received: by 10.182.181.99 with SMTP id dv3mr3632627obc.71.1371820382064; Fri, 21 Jun 2013 06:13:02 -0700 (PDT) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.182.176.66 with HTTP; Fri, 21 Jun 2013 06:12:42 -0700 (PDT) In-Reply-To: References: <6AA5D154FC52C047B1FF1CA3759A935B3CD845E9@BN1PRD0712MB650.namprd07.prod.outlook.com> From: Andrew Grieve Date: Fri, 21 Jun 2013 09:12:42 -0400 X-Google-Sender-Auth: L57Phdd07WzS7fDH_O_i2is7FKM Message-ID: Subject: Re: Suggestion - pluginLoader To: dev Content-Type: multipart/alternative; boundary=089e0158b6a691b59804dfa9d20f X-Gm-Message-State: ALoCoQnZnnkA7vKumpCU/9k2wLr43JH1TCQizcQCTfpv7miwu4O2qVGdKXLn7VxDV6X4SFAYlhrPGptuRXeSXz0VSnfEUAXDWOb4hLeQ64BPnf9PKv7hg6iSJzIPJkYEF0kqq0iEAU2AOn+37Y4kFTyB62TbZxMIehTFvwUmIFFjJBzpCeWNrawPH7gApYQvtOVhCDMId4En X-Virus-Checked: Checked by ClamAV on apache.org --089e0158b6a691b59804dfa9d20f Content-Type: text/plain; charset=ISO-8859-1 Hi Jonathan, First, thanks for a well-written proposal. At least for me, I'm not really sure that there is enough of a problem with the current approach that would justify changing it. That said, business is always an issue, and bumping your thread was the right thing to do :) For Android and iOS, the large majority of plugins require native code in order to be useful, so I don't think that having plugin JS be dynamically seems that useful without being able to dynamically load the native parts of it. You said that you're serving your app via HTTP. I think your best bet would be to concat all of your plugin JS together would be by far your biggest performance boost rather than try to selectively load them. Until very recently, Cordova's module system didn't involve a loader at all, and required that all modules be defined ahead of time. Now, we actually do load plugin .js files during start-up, but still not on-demand. So, in my mind we really have two things: 1. A registry 2. A boot-up process. To be clear - is it that you want to change the registry part, or is it just that you want to have plugin .js loaded on-demand? Are you concerned about the native side of the plugins? One thing I think maybe we should add is the ability to disable the start-up plugin_loader.js logic for when people want to package the .js themselves. On Fri, Jun 21, 2013 at 8:30 AM, J Prince wrote: > So it's been about a week now and I haven't really had any feedback on > this. > https://github.com/jxp/cordova.pluginLoader > I'm not sure if this means; > > a) Everyone is too busy > b) Everyone assumed someone else would respond > c) No-one is that interested in plugin javascript definitions > d) You've had similar discussions before and don't want to start THAT again > > > > From: princej.ws01@hotmail.co.uk > > To: dev@cordova.apache.org > > Subject: RE: Suggestion - pluginLoader > > Date: Tue, 18 Jun 2013 16:55:19 +0100 > > > > I have (briefly) looked at Harmony loaders before but that is a spec for > a future javascript language version. > > I have found a module loader that I wish to use (require.js). > > > > My point is that the current suggested module definition for cordova > plugins INCLUDES a loader implementation. > > > > I am suggesting that the loader implementation be removed from the > plugin to a new method cordova.pluginLoader > > This would make the plugins cleaner (as they would only describe their > own behaviour) and it would also allow cordova or app developers to > change/customize the loader implementation as needed. > > > > My suggested approach would result in plugins that could be loaded in > multiple different ways including (but not limited to); "classic" > window.plugins, cordova.define and require.js > > > > > > > -----Original Message----- > > > From: J Prince [mailto:princej.ws01@hotmail.co.uk] > > > Sent: Monday, June 17, 2013 7:27 AM > > > To: dev@cordova.apache.org > > > Subject: RE: Suggestion - pluginLoader > > > > > > There are a few main reasons. > > > > > > 1. The app I am working on is an Enterprise app. We are designing the > app as a Cordova shell that re-directs to all the html content. This means > that we have to dynamically load a different cordova.js (depending on > platform) following the redirect. > > > So we are actually unable to do anything other than dynamically load > plugins once the platform specific cordova.js is loaded > > > > > > 2. Some of the plugins will be used incredibly rarely. It doesn't seem > necessary to always load plugins until they are needed. > > > > > > 3. We are building with a single page architecture so don't want to > end up with lots of script includes in the index.html page. > > > The define/require pattern feels much cleaner and better > compartmentalized. > > > Our main page currently has 2 script includes: require.js and jqmobi. > > > > > > > > > > > > > --089e0158b6a691b59804dfa9d20f--