Re: Proposal for JS in Plugins

2013-02-19 Thread Brian LeRoux
I think I like it! (But look forward to seeing it in a pull request.) On Thu, Feb 14, 2013 at 10:31 AM, Braden Shepherdson wrote: > So I've written up my plan for attacking this problem into a Google Doc > I've shared for public comments: > > > https://docs.google.com/document/d/1fhwnIZ5TqwklGx7

Re: Proposal for JS in Plugins

2013-02-14 Thread Braden Shepherdson
So I've written up my plan for attacking this problem into a Google Doc I've shared for public comments: https://docs.google.com/document/d/1fhwnIZ5TqwklGx71pLmfSghysls1S4_5ktEsjA9ac5Y/edit?usp=sharing tl;dr version is that on cordova prepare (the new fast first part of cordova build, copies www)

Re: Proposal for JS in Plugins

2013-02-08 Thread Brian LeRoux
You know what. I'm super wrong. I was thinking in the context of a native project and not a *cordova* project. The flaw in the thinking was that we were shipping only one file we build leaving devs to include as they see fit. But whats really happening is that we are generating a new file for ever

Re: Proposal for JS in Plugins

2013-02-07 Thread Filip Maj
I don't think this feature would take that ability away.. If using the cordova-cli tools as an example of what happens, you have a structure like: Project |-www <- your app assets `-platforms <--- android, iOS, etc projects Anything you put into www will be copied into the platforms/

Re: Proposal for JS in Plugins

2013-02-07 Thread Andrew Grieve
I don't think we'd want to take away the ability to just copy in a file to the www/ directory. I think it might be better for them to opt-in the files they want to have included in this auto-inject system. Prototyping SGTM. On Thu, Feb 7, 2013 at 3:36 PM, Filip Maj wrote: > Good points Shaz a

Re: Proposal for JS in Plugins

2013-02-07 Thread Filip Maj
Good points Shaz and Andrew. I'm up for trying it out (I think we're at a point where we should prototype the approaches to get further). The plugin.xml manifest lists web assets via elements. Couple q's relating to this: - I guess we use the target attribute on all of these elements to determi

Re: Proposal for JS in Plugins

2013-02-06 Thread Shazron
I'm looking at the task goal: "*Should be easy to install / remove plugins (no need to manually add/remove script tags)" and inserting the script tags seems the best solution, what alternative is there? If devs don't agree with this goal, then it should be removed, and we keep the hard to install w

Re: Proposal for JS in Plugins

2013-02-06 Thread Andrew Grieve
For a project who's main language is JS, I'm a bit surprised that injecting a script tag through DOM manipulation would put us into the "magic" category... Brian - Your sentiments about the development stack don't make sense to me. The development stack is *the* job of CLI. We are prescribing a wa

Re: Proposal for JS in Plugins

2013-02-06 Thread Joe Bowser
I also disagree with automagically injecting the script tags. If we're adding the script tags, we have the ability of adding the script tags wrong, and breaking people's apps with magic. We have enough trouble directing our users to use Cordova/PhoneGap without us trying to make things more cleve

Re: Proposal for JS in Plugins

2013-02-06 Thread Anis KADRI
I don't think we should be automatically injecting javascript tags. Instruct users to do so when they add a plugin by displaying the tag. Everyone has different needs/requirements. Also *"cordova plugin add file" - Download plugin files to project/plugins - Runs plugman to install native parts of

Re: Proposal for JS in Plugins

2013-02-06 Thread Michal Mocny
Then, if we don't inject the js automatically, how does a developer get the list of scripts they need to include? Will the docs say to include everything from *project/platforms/cordova-js/lib/... dir, or should cordova-cli have a list-scripts command?* * * *-Michal* On Wed, Feb 6, 2013 at 4:07

Re: Proposal for JS in Plugins

2013-02-06 Thread Brian LeRoux
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 p

Re: Proposal for JS in Plugins

2013-02-06 Thread Andrew Grieve
Maybe another motivating use-case is when plugin authors add new .js files (or remove them, or rename them). Then we'd need to tell each app to update their html files. On Wed, Feb 6, 2013 at 4:01 PM, Michal Mocny wrote: > Right now you insert a single cordova.js for bridge and all core plugins

Re: Proposal for JS in Plugins

2013-02-06 Thread Michal Mocny
Right now you insert a single cordova.js for bridge and all core plugins. If we do *not* inject scripts, then all users will need to update all apps to include potentially a lot of script tags, right? On Wed, Feb 6, 2013 at 3:52 PM, Jesse wrote: > I am leaning towards Fil's points. > The advan

Re: Proposal for JS in Plugins

2013-02-06 Thread Jesse
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 suffic

Re: Proposal for JS in Plugins

2013-02-06 Thread Braden Shepherdson
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 a

Re: Proposal for JS in Plugins

2013-02-06 Thread Andrew Grieve
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 ea

Re: Proposal for JS in Plugins

2013-02-06 Thread Filip Maj
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 scrip

Re: Proposal for JS in Plugins

2013-02-06 Thread Andrew Grieve
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

Re: Proposal for JS in Plugins

2013-02-06 Thread Filip Maj
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 (

Re: Proposal for JS in Plugins

2013-02-06 Thread Andrew Grieve
Bump On Mon, Feb 4, 2013 at 4:47 PM, Andrew Grieve wrote: > I've taken the result of the previous thread of > CB-2214, > and turned it into a proposal doc: > > > https://docs.google.com/document/d/1Evzu8qliwxBWGj9-U8ea1rvrbd-jokmN4Dti8AGAXdU/edit#

Proposal for JS in Plugins

2013-02-04 Thread Andrew Grieve
I've taken the result of the previous thread of CB-2214, and turned it into a proposal doc: https://docs.google.com/document/d/1Evzu8qliwxBWGj9-U8ea1rvrbd-jokmN4Dti8AGAXdU/edit# Please feel free to add comments / edit the proposals.