You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Filip Maj <fi...@adobe.com> on 2013/01/03 20:46:36 UTC

Re: 3rd party Plugin code structure

Go with Anis' (imhotep) plugman tool as the defacto plugin installation
tool, until we get it into an Apache repo (probably cordova-cli?). It was
based on Andrew's plugin spec and pluginstall tool but started deviating
slightly once we (Cordova) wanted to support more robust use cases
(uninstallation, for example).

Andrew's original work for the plugin spec and pluginstall had, as its
goal, supporting PhoneGap Build use cases, which do not include
uninstallation, and also did not (and do not) take into account platforms
other than Android and iOS.

I suggest we move relevant bits for the spec over to the Cordova wiki and
work from there.

On 12/27/12 6:45 AM, "Michal Mocny" <mm...@chromium.org> wrote:

>I do not mean that one or the other is incorrect, but there are small
>differences in content and text formatting.  Small matter for sure, but
>since they are being modified independently I wasn't sure which is the
>"right" version to point to (esp since both readme's claim to not be
>official cordova document).  I think I am hearing
>https://github.com/imhotep/plugman esp since that is where ongoing work is
>being done.
>
>
>On Sat, Dec 22, 2012 at 7:54 AM, Anis KADRI <an...@gmail.com> wrote:
>
>> Could you elaborate a little bit on the differences ?
>>
>>
>> On Thu, Dec 20, 2012 at 12:18 PM, Michal Mocny <mm...@chromium.org>
>> wrote:
>>
>> > So the docs in https://github.com/imhotep/plugman differ slightly from
>> > https://github.com/alunny/cordova-plugin-spec
>> >
>> > And the Readme in phonegap-plugin doesn't do a good job of pointing
>>the
>> > right place to look (other than indirectly through Shaz's post).
>> >
>> > Shall I add a line to the readme pointing to
>> > https://github.com/alunny/cordova-plugin-spec ?
>> >
>> > -Michal
>> >
>> >
>> > On Thu, Dec 20, 2012 at 3:00 PM, Don Coleman <do...@gmail.com>
>> > wrote:
>> >
>> > > +1 for using Andrew's cordova-plugin-spec
>> > >
>> > >
>> > > On Thu, Dec 20, 2012 at 2:52 PM, Brian LeRoux <b...@brian.io> wrote:
>> > >
>> > > > This is pretty close to Lunny's pluginstall spec:
>> > > >
>> > > > https://github.com/alunny/cordova-plugin-spec
>> > > >
>> > > > For which the tools are being built. View the current
>> > > > phonegap/phonegap-plugins repo as a stepping stone. It bought us
>>time
>> > > > to sorted out our own backyard before inviting everyone in to
>>play.
>> =)
>> > > >
>> > > >
>> > > > On Thu, Dec 20, 2012 at 11:03 AM, Michal Mocny <mm...@google.com>
>> > > wrote:
>> > > > > Seems that our thirdparty plugins are platform-centric; with
>> > javascript
>> > > > not
>> > > > > written to be shared across platforms.
>> > > > >
>> > > > > Even if individual contributors are not willing to write
>> > > implementations
>> > > > > for other platforms, or if a plugin only really applies to a
>>single
>> > > > > platform, I think we should still provide good plugin structure
>> > > > conventions
>> > > > > that could scale to multiple platform implementations in the
>> future.
>> > > > >
>> > > > > As far as I'm aware, this was the case with core plugins at some
>> > point,
>> > > > and
>> > > > > we made a big change to unify the js, right?
>> > > > >
>> > > > > Well, I think that plugin structure should be more like:
>> > > > >
>> > > > > plugin_name/
>> > > > > - common/ [js code]
>> > > > > - platform/
>> > > > >  - ios/ [native code]
>> > > > >  - android/ [native code]
>> > > > >  - etc..
>> > > > >
>> > > > > and less like we have now
>> > > > >
>> > > > > ios/plugin_name/
>> > > > >  - [js code]
>> > > > >  - [native code]
>> > > > >
>> > > > > android/plugin_name/
>> > > > >  - [js code -- different api]
>> > > > >  - [native code]
>> > > > >
>> > > > > I don't think we need to redo whats there now, but it would be
>>nice
>> > to
>> > > > > decide on a structure, put up a skeleton for starting with, and
>> > mention
>> > > > it
>> > > > > in the Readme.
>> > > > >
>> > > > > (I ask before I'm going to be adding an android version of
>> > > > WebNotifications
>> > > > > some day, and I really don't want to fork the JS)
>> > > > >
>> > > > > -Michal
>> > > >
>> > >
>> >
>>


Re: 3rd party Plugin code structure

Posted by Brian LeRoux <b...@brian.io>.
Yup, that'd be a good start.

Its becoming a big topic. Arguably these are discreet/different things
(authoring / packaging). (Aside: do we have a way to validate a
package?)

Once we have those the next thing is documenting Publishing/Discovery.


On Thu, Jan 3, 2013 at 11:59 AM, Filip Maj <fi...@adobe.com> wrote:
> Why not iterate on the existing Plugin Development Guide [1] ?
>
> http://docs.phonegap.com/en/2.2.0/guide_plugin-development_index.md.html#Pl
> ugin%20Development%20Guide
>
>
> On 1/3/13 11:55 AM, "Brian LeRoux" <b...@brian.io> wrote:
>
>>I think we should add a Guide for Plugin Packaging --- things will
>>move quicker, and b/c src is more canonical it is more likely to
>>encourage contrib.
>>
>>On Thu, Jan 3, 2013 at 11:46 AM, Filip Maj <fi...@adobe.com> wrote:
>>> Go with Anis' (imhotep) plugman tool as the defacto plugin installation
>>> tool, until we get it into an Apache repo (probably cordova-cli?). It
>>>was
>>> based on Andrew's plugin spec and pluginstall tool but started deviating
>>> slightly once we (Cordova) wanted to support more robust use cases
>>> (uninstallation, for example).
>>>
>>> Andrew's original work for the plugin spec and pluginstall had, as its
>>> goal, supporting PhoneGap Build use cases, which do not include
>>> uninstallation, and also did not (and do not) take into account
>>>platforms
>>> other than Android and iOS.
>>>
>>> I suggest we move relevant bits for the spec over to the Cordova wiki
>>>and
>>> work from there.
>>>
>>> On 12/27/12 6:45 AM, "Michal Mocny" <mm...@chromium.org> wrote:
>>>
>>>>I do not mean that one or the other is incorrect, but there are small
>>>>differences in content and text formatting.  Small matter for sure, but
>>>>since they are being modified independently I wasn't sure which is the
>>>>"right" version to point to (esp since both readme's claim to not be
>>>>official cordova document).  I think I am hearing
>>>>https://github.com/imhotep/plugman esp since that is where ongoing work
>>>>is
>>>>being done.
>>>>
>>>>
>>>>On Sat, Dec 22, 2012 at 7:54 AM, Anis KADRI <an...@gmail.com>
>>>>wrote:
>>>>
>>>>> Could you elaborate a little bit on the differences ?
>>>>>
>>>>>
>>>>> On Thu, Dec 20, 2012 at 12:18 PM, Michal Mocny <mm...@chromium.org>
>>>>> wrote:
>>>>>
>>>>> > So the docs in https://github.com/imhotep/plugman differ slightly
>>>>>from
>>>>> > https://github.com/alunny/cordova-plugin-spec
>>>>> >
>>>>> > And the Readme in phonegap-plugin doesn't do a good job of pointing
>>>>>the
>>>>> > right place to look (other than indirectly through Shaz's post).
>>>>> >
>>>>> > Shall I add a line to the readme pointing to
>>>>> > https://github.com/alunny/cordova-plugin-spec ?
>>>>> >
>>>>> > -Michal
>>>>> >
>>>>> >
>>>>> > On Thu, Dec 20, 2012 at 3:00 PM, Don Coleman <do...@gmail.com>
>>>>> > wrote:
>>>>> >
>>>>> > > +1 for using Andrew's cordova-plugin-spec
>>>>> > >
>>>>> > >
>>>>> > > On Thu, Dec 20, 2012 at 2:52 PM, Brian LeRoux <b...@brian.io> wrote:
>>>>> > >
>>>>> > > > This is pretty close to Lunny's pluginstall spec:
>>>>> > > >
>>>>> > > > https://github.com/alunny/cordova-plugin-spec
>>>>> > > >
>>>>> > > > For which the tools are being built. View the current
>>>>> > > > phonegap/phonegap-plugins repo as a stepping stone. It bought us
>>>>>time
>>>>> > > > to sorted out our own backyard before inviting everyone in to
>>>>>play.
>>>>> =)
>>>>> > > >
>>>>> > > >
>>>>> > > > On Thu, Dec 20, 2012 at 11:03 AM, Michal Mocny
>>>>><mm...@google.com>
>>>>> > > wrote:
>>>>> > > > > Seems that our thirdparty plugins are platform-centric; with
>>>>> > javascript
>>>>> > > > not
>>>>> > > > > written to be shared across platforms.
>>>>> > > > >
>>>>> > > > > Even if individual contributors are not willing to write
>>>>> > > implementations
>>>>> > > > > for other platforms, or if a plugin only really applies to a
>>>>>single
>>>>> > > > > platform, I think we should still provide good plugin
>>>>>structure
>>>>> > > > conventions
>>>>> > > > > that could scale to multiple platform implementations in the
>>>>> future.
>>>>> > > > >
>>>>> > > > > As far as I'm aware, this was the case with core plugins at
>>>>>some
>>>>> > point,
>>>>> > > > and
>>>>> > > > > we made a big change to unify the js, right?
>>>>> > > > >
>>>>> > > > > Well, I think that plugin structure should be more like:
>>>>> > > > >
>>>>> > > > > plugin_name/
>>>>> > > > > - common/ [js code]
>>>>> > > > > - platform/
>>>>> > > > >  - ios/ [native code]
>>>>> > > > >  - android/ [native code]
>>>>> > > > >  - etc..
>>>>> > > > >
>>>>> > > > > and less like we have now
>>>>> > > > >
>>>>> > > > > ios/plugin_name/
>>>>> > > > >  - [js code]
>>>>> > > > >  - [native code]
>>>>> > > > >
>>>>> > > > > android/plugin_name/
>>>>> > > > >  - [js code -- different api]
>>>>> > > > >  - [native code]
>>>>> > > > >
>>>>> > > > > I don't think we need to redo whats there now, but it would be
>>>>>nice
>>>>> > to
>>>>> > > > > decide on a structure, put up a skeleton for starting with,
>>>>>and
>>>>> > mention
>>>>> > > > it
>>>>> > > > > in the Readme.
>>>>> > > > >
>>>>> > > > > (I ask before I'm going to be adding an android version of
>>>>> > > > WebNotifications
>>>>> > > > > some day, and I really don't want to fork the JS)
>>>>> > > > >
>>>>> > > > > -Michal
>>>>> > > >
>>>>> > >
>>>>> >
>>>>>
>>>
>

Re: 3rd party Plugin code structure

Posted by Filip Maj <fi...@adobe.com>.
Why not iterate on the existing Plugin Development Guide [1] ?

http://docs.phonegap.com/en/2.2.0/guide_plugin-development_index.md.html#Pl
ugin%20Development%20Guide


On 1/3/13 11:55 AM, "Brian LeRoux" <b...@brian.io> wrote:

>I think we should add a Guide for Plugin Packaging --- things will
>move quicker, and b/c src is more canonical it is more likely to
>encourage contrib.
>
>On Thu, Jan 3, 2013 at 11:46 AM, Filip Maj <fi...@adobe.com> wrote:
>> Go with Anis' (imhotep) plugman tool as the defacto plugin installation
>> tool, until we get it into an Apache repo (probably cordova-cli?). It
>>was
>> based on Andrew's plugin spec and pluginstall tool but started deviating
>> slightly once we (Cordova) wanted to support more robust use cases
>> (uninstallation, for example).
>>
>> Andrew's original work for the plugin spec and pluginstall had, as its
>> goal, supporting PhoneGap Build use cases, which do not include
>> uninstallation, and also did not (and do not) take into account
>>platforms
>> other than Android and iOS.
>>
>> I suggest we move relevant bits for the spec over to the Cordova wiki
>>and
>> work from there.
>>
>> On 12/27/12 6:45 AM, "Michal Mocny" <mm...@chromium.org> wrote:
>>
>>>I do not mean that one or the other is incorrect, but there are small
>>>differences in content and text formatting.  Small matter for sure, but
>>>since they are being modified independently I wasn't sure which is the
>>>"right" version to point to (esp since both readme's claim to not be
>>>official cordova document).  I think I am hearing
>>>https://github.com/imhotep/plugman esp since that is where ongoing work
>>>is
>>>being done.
>>>
>>>
>>>On Sat, Dec 22, 2012 at 7:54 AM, Anis KADRI <an...@gmail.com>
>>>wrote:
>>>
>>>> Could you elaborate a little bit on the differences ?
>>>>
>>>>
>>>> On Thu, Dec 20, 2012 at 12:18 PM, Michal Mocny <mm...@chromium.org>
>>>> wrote:
>>>>
>>>> > So the docs in https://github.com/imhotep/plugman differ slightly
>>>>from
>>>> > https://github.com/alunny/cordova-plugin-spec
>>>> >
>>>> > And the Readme in phonegap-plugin doesn't do a good job of pointing
>>>>the
>>>> > right place to look (other than indirectly through Shaz's post).
>>>> >
>>>> > Shall I add a line to the readme pointing to
>>>> > https://github.com/alunny/cordova-plugin-spec ?
>>>> >
>>>> > -Michal
>>>> >
>>>> >
>>>> > On Thu, Dec 20, 2012 at 3:00 PM, Don Coleman <do...@gmail.com>
>>>> > wrote:
>>>> >
>>>> > > +1 for using Andrew's cordova-plugin-spec
>>>> > >
>>>> > >
>>>> > > On Thu, Dec 20, 2012 at 2:52 PM, Brian LeRoux <b...@brian.io> wrote:
>>>> > >
>>>> > > > This is pretty close to Lunny's pluginstall spec:
>>>> > > >
>>>> > > > https://github.com/alunny/cordova-plugin-spec
>>>> > > >
>>>> > > > For which the tools are being built. View the current
>>>> > > > phonegap/phonegap-plugins repo as a stepping stone. It bought us
>>>>time
>>>> > > > to sorted out our own backyard before inviting everyone in to
>>>>play.
>>>> =)
>>>> > > >
>>>> > > >
>>>> > > > On Thu, Dec 20, 2012 at 11:03 AM, Michal Mocny
>>>><mm...@google.com>
>>>> > > wrote:
>>>> > > > > Seems that our thirdparty plugins are platform-centric; with
>>>> > javascript
>>>> > > > not
>>>> > > > > written to be shared across platforms.
>>>> > > > >
>>>> > > > > Even if individual contributors are not willing to write
>>>> > > implementations
>>>> > > > > for other platforms, or if a plugin only really applies to a
>>>>single
>>>> > > > > platform, I think we should still provide good plugin
>>>>structure
>>>> > > > conventions
>>>> > > > > that could scale to multiple platform implementations in the
>>>> future.
>>>> > > > >
>>>> > > > > As far as I'm aware, this was the case with core plugins at
>>>>some
>>>> > point,
>>>> > > > and
>>>> > > > > we made a big change to unify the js, right?
>>>> > > > >
>>>> > > > > Well, I think that plugin structure should be more like:
>>>> > > > >
>>>> > > > > plugin_name/
>>>> > > > > - common/ [js code]
>>>> > > > > - platform/
>>>> > > > >  - ios/ [native code]
>>>> > > > >  - android/ [native code]
>>>> > > > >  - etc..
>>>> > > > >
>>>> > > > > and less like we have now
>>>> > > > >
>>>> > > > > ios/plugin_name/
>>>> > > > >  - [js code]
>>>> > > > >  - [native code]
>>>> > > > >
>>>> > > > > android/plugin_name/
>>>> > > > >  - [js code -- different api]
>>>> > > > >  - [native code]
>>>> > > > >
>>>> > > > > I don't think we need to redo whats there now, but it would be
>>>>nice
>>>> > to
>>>> > > > > decide on a structure, put up a skeleton for starting with,
>>>>and
>>>> > mention
>>>> > > > it
>>>> > > > > in the Readme.
>>>> > > > >
>>>> > > > > (I ask before I'm going to be adding an android version of
>>>> > > > WebNotifications
>>>> > > > > some day, and I really don't want to fork the JS)
>>>> > > > >
>>>> > > > > -Michal
>>>> > > >
>>>> > >
>>>> >
>>>>
>>


Re: 3rd party Plugin code structure

Posted by Brian LeRoux <b...@brian.io>.
I think we should add a Guide for Plugin Packaging --- things will
move quicker, and b/c src is more canonical it is more likely to
encourage contrib.

On Thu, Jan 3, 2013 at 11:46 AM, Filip Maj <fi...@adobe.com> wrote:
> Go with Anis' (imhotep) plugman tool as the defacto plugin installation
> tool, until we get it into an Apache repo (probably cordova-cli?). It was
> based on Andrew's plugin spec and pluginstall tool but started deviating
> slightly once we (Cordova) wanted to support more robust use cases
> (uninstallation, for example).
>
> Andrew's original work for the plugin spec and pluginstall had, as its
> goal, supporting PhoneGap Build use cases, which do not include
> uninstallation, and also did not (and do not) take into account platforms
> other than Android and iOS.
>
> I suggest we move relevant bits for the spec over to the Cordova wiki and
> work from there.
>
> On 12/27/12 6:45 AM, "Michal Mocny" <mm...@chromium.org> wrote:
>
>>I do not mean that one or the other is incorrect, but there are small
>>differences in content and text formatting.  Small matter for sure, but
>>since they are being modified independently I wasn't sure which is the
>>"right" version to point to (esp since both readme's claim to not be
>>official cordova document).  I think I am hearing
>>https://github.com/imhotep/plugman esp since that is where ongoing work is
>>being done.
>>
>>
>>On Sat, Dec 22, 2012 at 7:54 AM, Anis KADRI <an...@gmail.com> wrote:
>>
>>> Could you elaborate a little bit on the differences ?
>>>
>>>
>>> On Thu, Dec 20, 2012 at 12:18 PM, Michal Mocny <mm...@chromium.org>
>>> wrote:
>>>
>>> > So the docs in https://github.com/imhotep/plugman differ slightly from
>>> > https://github.com/alunny/cordova-plugin-spec
>>> >
>>> > And the Readme in phonegap-plugin doesn't do a good job of pointing
>>>the
>>> > right place to look (other than indirectly through Shaz's post).
>>> >
>>> > Shall I add a line to the readme pointing to
>>> > https://github.com/alunny/cordova-plugin-spec ?
>>> >
>>> > -Michal
>>> >
>>> >
>>> > On Thu, Dec 20, 2012 at 3:00 PM, Don Coleman <do...@gmail.com>
>>> > wrote:
>>> >
>>> > > +1 for using Andrew's cordova-plugin-spec
>>> > >
>>> > >
>>> > > On Thu, Dec 20, 2012 at 2:52 PM, Brian LeRoux <b...@brian.io> wrote:
>>> > >
>>> > > > This is pretty close to Lunny's pluginstall spec:
>>> > > >
>>> > > > https://github.com/alunny/cordova-plugin-spec
>>> > > >
>>> > > > For which the tools are being built. View the current
>>> > > > phonegap/phonegap-plugins repo as a stepping stone. It bought us
>>>time
>>> > > > to sorted out our own backyard before inviting everyone in to
>>>play.
>>> =)
>>> > > >
>>> > > >
>>> > > > On Thu, Dec 20, 2012 at 11:03 AM, Michal Mocny <mm...@google.com>
>>> > > wrote:
>>> > > > > Seems that our thirdparty plugins are platform-centric; with
>>> > javascript
>>> > > > not
>>> > > > > written to be shared across platforms.
>>> > > > >
>>> > > > > Even if individual contributors are not willing to write
>>> > > implementations
>>> > > > > for other platforms, or if a plugin only really applies to a
>>>single
>>> > > > > platform, I think we should still provide good plugin structure
>>> > > > conventions
>>> > > > > that could scale to multiple platform implementations in the
>>> future.
>>> > > > >
>>> > > > > As far as I'm aware, this was the case with core plugins at some
>>> > point,
>>> > > > and
>>> > > > > we made a big change to unify the js, right?
>>> > > > >
>>> > > > > Well, I think that plugin structure should be more like:
>>> > > > >
>>> > > > > plugin_name/
>>> > > > > - common/ [js code]
>>> > > > > - platform/
>>> > > > >  - ios/ [native code]
>>> > > > >  - android/ [native code]
>>> > > > >  - etc..
>>> > > > >
>>> > > > > and less like we have now
>>> > > > >
>>> > > > > ios/plugin_name/
>>> > > > >  - [js code]
>>> > > > >  - [native code]
>>> > > > >
>>> > > > > android/plugin_name/
>>> > > > >  - [js code -- different api]
>>> > > > >  - [native code]
>>> > > > >
>>> > > > > I don't think we need to redo whats there now, but it would be
>>>nice
>>> > to
>>> > > > > decide on a structure, put up a skeleton for starting with, and
>>> > mention
>>> > > > it
>>> > > > > in the Readme.
>>> > > > >
>>> > > > > (I ask before I'm going to be adding an android version of
>>> > > > WebNotifications
>>> > > > > some day, and I really don't want to fork the JS)
>>> > > > >
>>> > > > > -Michal
>>> > > >
>>> > >
>>> >
>>>
>