cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse <purplecabb...@gmail.com>
Subject Re: best practice plugin authoring guidelines / window.plugins hate
Date Mon, 28 Jan 2013 19:35:22 GMT
The require step is overkill in this case IMHO, although exec 'should'
likely be :
var exec = cordova.require('cordova/exec');

https://github.com/purplecabbage/InstagramPlugin/blob/master/www/CDVInstagramPlugin.js

Pull request sent

Instagram.isInstalled(callback);
Instagram.share(canvasId,callback);





On Mon, Jan 28, 2013 at 11:27 AM, Don Coleman <don.coleman@gmail.com> wrote:

> +1
>
>
>
> On Mon, Jan 28, 2013 at 2:23 PM, Brian LeRoux <b@brian.io> wrote:
>
> > ah sorry that is what I meant actually----tho it does beg how
> > cordova.require and various other requires might work
> >
> > (I think Pat brought this up last year.)
> >
> > On Mon, Jan 28, 2013 at 11:15 AM, Filip Maj <fil@adobe.com> wrote:
> > > Hmm, how does this fit in with cordova.require ?
> > >
> > > On 1/28/13 11:11 AM, "Brian LeRoux" <b@brian.io> wrote:
> > >
> > >>I'm thinking we encourage:
> > >>
> > >>var insta = require('instagram')
> > >>insta.share( ... )
> > >>
> > >>
> > >>
> > >>On Mon, Jan 28, 2013 at 12:51 PM, Jesse <purplecabbage@gmail.com>
> wrote:
> > >>> No reason to exist there, other than that is the way it used to be.
> > >>> I would rather just see :
> > >>>
> > >>> var myRef = Instagram.install();
> > >>> myRef.share( ... )
> > >>>
> > >>> I'll fork it.
> > >>>
> > >>> Also, I think we need to educate people on the use of
> > >>>objects&&prototypes,
> > >>> by example.
> > >>> We too have multiple places where we define a prototype object of
> which
> > >>> there will only evar be one ... off-topic sorry ...
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Mon, Jan 28, 2013 at 10:40 AM, Filip Maj <fil@adobe.com> wrote:
> > >>>
> > >>>> Don't think so. Should be up to the user. That said Cordova should
> > >>>>provide
> > >>>> a registration mechanism to enable collision detection (I think
> Andrew
> > >>>> Grieve has something like this in his symbol mapping branch in
> > >>>>cordova-js).
> > >>>>
> > >>>> On 1/28/13 10:34 AM, "Brian LeRoux" <b@brian.io> wrote:
> > >>>>
> > >>>> >The community is starting to put plugins in their own repos
> (good). I
> > >>>> >noticed this one today:
> > >>>> >
> > >>>> >https://github.com/vstirbu/InstagramPlugin
> > >>>> >
> > >>>> >(Awesome.)
> > >>>> >
> > >>>> >But I can't stand window.plugins any longer. I think this might
be
> a
> > >>>> >hangover from the existing plugin space but not totally sure---is
> > >>>> >there a good reason to have the plugins global "namespace"
anymore?
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>> --
> > >>> @purplecabbage
> > >>> risingj.com
> > >
> >
>



-- 
@purplecabbage
risingj.com

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