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 C0CD2E640 for ; Wed, 6 Feb 2013 21:07:34 +0000 (UTC) Received: (qmail 55878 invoked by uid 500); 6 Feb 2013 21:07:34 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 55848 invoked by uid 500); 6 Feb 2013 21:07:34 -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 55840 invoked by uid 99); 6 Feb 2013 21:07:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Feb 2013 21:07:34 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brian.leroux@gmail.com designates 209.85.128.179 as permitted sender) Received: from [209.85.128.179] (HELO mail-ve0-f179.google.com) (209.85.128.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Feb 2013 21:07:29 +0000 Received: by mail-ve0-f179.google.com with SMTP id da11so1637794veb.38 for ; Wed, 06 Feb 2013 13:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=OMvYK8Kxgp5dYUzkw2XA5olANdaN8wlisTHVveYyDbc=; b=XfNuJxs4ERT5QQgQ3qyw9n5DglBYSpt+nmHKvd3vEh2wcz0j7IjjgHhOriNa7oqYVz RM+oDIvvDDoKHBQBm77V5EJWnHiFkklb63AM6ehGYRmauDa8CPAmTKeFRSybuxJCye49 F6oqTrNlXLqoaaXBRp9naYwGxPlMdm8aqM0hlxLEGY/O0nqb0QQRn1gxQ2Hnl6umVIlQ YuLz35cpv26lBXdquOwVBmm6bt0FwGZWKrexc5KLMF5GVWDNusCk/PkwSLOq6l+48y+R I+kP10w4pmkTA7LSbcrKMHPnasLf6kmityBsTsW+GyyedN80bQk/0MefCB/L11FztRXO DmIQ== MIME-Version: 1.0 X-Received: by 10.52.95.37 with SMTP id dh5mr31250638vdb.26.1360184828967; Wed, 06 Feb 2013 13:07:08 -0800 (PST) Sender: brian.leroux@gmail.com Received: by 10.58.38.230 with HTTP; Wed, 6 Feb 2013 13:07:08 -0800 (PST) In-Reply-To: References: Date: Wed, 6 Feb 2013 13:07:08 -0800 X-Google-Sender-Auth: kBeKMTvUXXsL6DB7ZUJ9iXU4B-k Message-ID: Subject: Re: Proposal for JS in Plugins From: Brian LeRoux To: dev@cordova.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I am not in favor of prescribing any part of the development stack. Some ppl like requirejs. Etc. This is really not a problem we need to add to the list of things we need to solve! (More detailed feedback on the way.) On Wed, Feb 6, 2013 at 12:52 PM, Jesse wrote: > I am leaning towards Fil's points. > The advantage of script tags is everyone understands how they work. Only > use magic when magic is required. > > > > On Wed, Feb 6, 2013 at 12:45 PM, Braden Shepherdson wrote: > >> I think it's fine to have the default behavior be to inject script tags. >> That will suffice for 90% of our users, probably more. If you fall into the >> 10% that have some more complicated setup, we should provide a flag like >> > cordova plugin add --no-inject-js myplugin >> that prevents us from doing it automatically, and you can do whatever more >> complex step you need to do. >> >> >> Braden >> >> >> On Wed, Feb 6, 2013 at 3:37 PM, Andrew Grieve >> wrote: >> >> > On Wed, Feb 6, 2013 at 3:00 PM, Filip Maj wrote: >> > >> > > >> > > >> > > On 2/6/13 11:51 AM, "Andrew Grieve" wrote: >> > > >> > > >On Wed, Feb 6, 2013 at 2:33 PM, Filip Maj wrote: >> > > > >> > > >> I've added a few detail explanations to the document, but moved the >> > > >> discussion to the ML. >> > > >> >> > > >> ---- >> > > >> >> > > >> > Should be easy to install / remove plugins (no need to manually >> > > >> >add/remove script tags) >> > > >> >> > > >> >> > > >> I think adding/removing script tags is the way to go. Concatenating >> > all >> > > >> javascript relevant to your project (cordova.js + any plugins you >> add) >> > > >> makes it difficult to debug later on. WE'd have to get users to post >> > > >> entire contents of their cordova.js file to determine what was added >> > and >> > > >> what exists in there. With that in mind, I favor the packager >> > approach, >> > > >> which would require: >> > > >> >> > > > >> > > >Very good point about concat making it hard to track bugs! I wonder if >> > > >there's a better way than requiring users to manually add the tags (we >> > > >don't require them to manually add native files to their project >> files). >> > > > >> > > >One thought is to have cordova-packer output source-maps. I don't >> think >> > > >there's very good support for them in mobile browsers yet, but we >> could >> > > >use >> > > >them to manually map exception line numbers to file+line numbers. >> > > > >> > > >Another idea is to use exec + special comment that is used in our >> > existing >> > > >pkg/debug/*.js files. I don't think support for this is all that great >> > > >either though. >> > > > >> > > >Another idea is to have cordova.js inject a script tag for each >> module. >> > > >This may have an adverse effect on start-up time, but probably no >> worse >> > > >than if the user manually adds all of the script tags separately. >> > Winner? >> > > >> > > I don't think the script tag is a giant issue, but I do think it is a >> > > slipper slope problem to try and solve. What if the user has a >> multipage >> > > application? Do we then add script tags automatically to all pages? >> What >> > > if the user only uses the plugin on specific pages? Etc etc >> > > >> > >> > I'm suggesting that any page that include (manually) cordova.js will have >> > it dynamically inject installed plugin JS files. Should work fine in a >> > multi-page app. We don't currently disable plugins on a per-page basis. >> Is >> > this really an important use-case? If so, I'm sure we could figure out >> how >> > to not inject script tags for plugins you don't want. >> > >> > > > > -- > @purplecabbage > risingj.com