cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <>
Subject Re: Proposal for JS in Plugins
Date Wed, 06 Feb 2013 20:37:44 GMT
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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message