You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Jonathan Bond-Caron <jb...@gdesolutions.com> on 2014/02/11 16:20:34 UTC

Engine confusion

I'm a bit confused about 'engines'

To my surprise, "cordova-plugman" actually returns node's version:
https://github.com/apache/cordova-plugman/blob/master/src/util/default-engines.js

Some questions:

-          Should "cordova-plugman" be renamed to "node"?

-          Are there many plugins that depend on "version x" of cordova-android, cordova-ios, xcode, ...?

-          Are 'engines' meant be build time requirements vs. runtime (~webview) requirements?



It all looks like build time, with the exception of "cordova" where cordova.js exec() is required by the plugins.

J


Re: Engine confusion

Posted by Andrew Grieve <ag...@chromium.org>.
On Wed, Feb 12, 2014 at 10:22 PM, Andrew Grieve <ag...@chromium.org>wrote:

>
>
>
> On Wed, Feb 12, 2014 at 5:19 PM, Jonathan Bond-Caron <
> jbondc@gdesolutions.com> wrote:
>
>> On Wed Feb 12 03:56 PM, Braden Shepherdson wrote:
>> > Do the check the same file? I thought they were different. They might
>> > check the
>> > same path in different platforms, but that script can
>> > return different things. I
>> > would consider that a bug as well.
>> >
>> > I don't see anything to be gained from changing the syntax.
>> >
>>
>> They check the same *relative file* to the platform/project directory (so
>> ya can have different version script per platform).
>> Makes sense it was done that way in the beginning but could be improved
>> now.
>>
>> a) Issue is other/newer platforms don't have the 'check for version x'.
>>
>> b) More a personal preference for:
>> <engine name="cordova" version=">=3.0.0"/>
>> <engine name="cordova" version=">=3.3.0" platform="android"/>
>>
>> I can patch the code so that:
>> <engine name="cordova-android" version=">=3.3.0" />
>> <engine name="cordova-{$supported_platform} " version=">=3.3.0" />
>>
>>
> - Agree that the first example is more intuitive.
> - Based on our 3.0+ version scheme, it's possible for cordova-ios= 4.0
> while cordova-cli = 3.5. So, another option here is to make cordova-ios
> check  platforms/ios/cordova/version and "cordova" use CLI's version
>

Hmm, to get this right though, you'd want to do: <engine name="cordova-ios"
version=">3.5" platform="ios"/>.

Note that plugman is the one doing these checks, not CLI, so to fix this,
plugman will need to keep a map of platformVersion -> cadenceVersion.


>
>
>
>> Still works but is deprecated for 4.0
>>
>> If "cordova" is meant to check the cli version, from what I can tell
>> hasn't been that way since Aug 2013
>>
>> J
>>
>>
>

RE: Engine confusion

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Wed Feb 12 10:22 PM, Andrew Grieve wrote:
> > b) More a personal preference for:
> > <engine name="cordova" version=">=3.0.0"/> <engine name="cordova"
> > version=">=3.3.0" platform="android"/>
> >
> > I can patch the code so that:
> > <engine name="cordova-android" version=">=3.3.0" /> <engine
> > name="cordova-{$supported_platform} " version=">=3.3.0" />
> >
> >
> - Agree that the first example is more intuitive.
> - Based on our 3.0+ version scheme, it's possible for cordova-ios= 4.0 while
> cordova-cli = 3.5. So, another option here is to make cordova-ios check
> platforms/ios/cordova/version and "cordova" use CLI's version
> 

I think I appropriately picked the e-mail topic :)

I prefer:
<engine name="cordova" version=">=3.0.0"/>
<engine name="cordova" version=">=3.3.0" platform="ios"/>

Before it implies cordova is the "engine"

<engine name="cordova-ios" version=">=3.0.0"/>
<engine name="cordova-android" version=">=3.0.0"/>

Implies there's 1+ cordova engines, which I'm not really sure what that means.

It's really "cordova" engine for platform "foo"
<engine name="cordova" version=">=3.3.0" platform="foo"/>

Odd part in the code is "cordova" check gets dropped *if* "cordova-platform" exists:
https://github.com/jbondc/cordova-plugman/blob/master/src/install.js#L212

I don't think that how people expect it to work, hence the confusion. "cordova" doesn't refer to the cordova-cli version

J


Re: Engine confusion

Posted by Andrew Grieve <ag...@chromium.org>.
On Wed, Feb 12, 2014 at 5:19 PM, Jonathan Bond-Caron <
jbondc@gdesolutions.com> wrote:

> On Wed Feb 12 03:56 PM, Braden Shepherdson wrote:
> > Do the check the same file? I thought they were different. They might
> > check the
> > same path in different platforms, but that script can
> > return different things. I
> > would consider that a bug as well.
> >
> > I don't see anything to be gained from changing the syntax.
> >
>
> They check the same *relative file* to the platform/project directory (so
> ya can have different version script per platform).
> Makes sense it was done that way in the beginning but could be improved
> now.
>
> a) Issue is other/newer platforms don't have the 'check for version x'.
>
> b) More a personal preference for:
> <engine name="cordova" version=">=3.0.0"/>
> <engine name="cordova" version=">=3.3.0" platform="android"/>
>
> I can patch the code so that:
> <engine name="cordova-android" version=">=3.3.0" />
> <engine name="cordova-{$supported_platform} " version=">=3.3.0" />
>
>
- Agree that the first example is more intuitive.
- Based on our 3.0+ version scheme, it's possible for cordova-ios= 4.0
while cordova-cli = 3.5. So, another option here is to make cordova-ios
check  platforms/ios/cordova/version and "cordova" use CLI's version



> Still works but is deprecated for 4.0
>
> If "cordova" is meant to check the cli version, from what I can tell
> hasn't been that way since Aug 2013
>
> J
>
>

RE: Engine confusion

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Wed Feb 12 03:56 PM, Braden Shepherdson wrote:
> Do the check the same file? I thought they were different. They might
> check the
> same path in different platforms, but that script can
> return different things. I
> would consider that a bug as well.
> 
> I don't see anything to be gained from changing the syntax.
> 

They check the same *relative file* to the platform/project directory (so ya can have different version script per platform).
Makes sense it was done that way in the beginning but could be improved now.

a) Issue is other/newer platforms don't have the 'check for version x'. 

b) More a personal preference for:
<engine name="cordova" version=">=3.0.0"/> 
<engine name="cordova" version=">=3.3.0" platform="android"/>

I can patch the code so that:
<engine name="cordova-android" version=">=3.3.0" />
<engine name="cordova-{$supported_platform} " version=">=3.3.0" />

Still works but is deprecated for 4.0

If "cordova" is meant to check the cli version, from what I can tell hasn't been that way since Aug 2013

J


Re: Engine confusion

Posted by Braden Shepherdson <br...@chromium.org>.
Do the check the same file? I thought they were different. They might check
the same path in different platforms, but that script can return different
things. I would consider that a bug as well.

I don't see anything to be gained from changing the syntax.

The reason we want to specify separately for each platform is that we don't
wait to bring all platforms up to feature parity at each Cordova release.
We want to be able to say "I need feature X, and that landed in iOS in 3.4,
Android and FFOS in 3.5, and BB10 in 3.4.2".

Braden


On Wed, Feb 12, 2014 at 3:35 PM, Jonathan Bond-Caron <
jbondc@gdesolutions.com> wrote:

> On Tue Feb 11 11:05 AM, Braden Shepherdson wrote:
> > The intention is that it allows plugins to specify that they require at
> least a certain
> > version of the native code for each platform. This would be for things
> like added
> > a new transport type to the bridge, as when we added binary data
> transmission
> > on iOS and Android a year or so ago. Any plugins published that relied
> on it would
> > specify at least that level of cordova-android and cordova-ios,
> whichever releases
> > the changes made it into. It turns out that the native code is stable
> enough that
> > this is hardly ever relevant.
> >
> > Answering your questions:
> > - The cordova-plugman version returning node's version sounds like a bug.
> > It should be Plugman's NPM version number so far as I know.
> > - Very few. Most of the significant changes happened several versions
> ago; in
> > most cases ">= 3.0" is sufficient.
> > - Build time (more precisely, plugin install time). There are currently
> no
> > constraints or checks for eg. what versions of Android a plugin supports.
> >     - This is true even of the "cordova" one, which is actually the
> version of the
> > `cordova` CLI tool if memory serves.
> >
>
> Thanks, patch is here:
>
> https://github.com/jbondc/cordova-plugman/blob/master/src/util/default-engines.js
>
> Seems like there should only be "cordova" and not "cordova-ios",
> "cordova-android", "cordova-*", they check the same 'script' file
> Maybe it was different in 2.x?
>
> <engine name="cordova" version=">=3.0.0"/>
> <engine name="cordova" version=">=3.3.0" platform="android"/>
>
> Equivalent to:
> <engine name="cordova" version=">=3.0.0"/>
> <engine name="cordova-android" version=">=3.3.0" platform="android"/>
>
>

RE: Engine confusion

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Tue Feb 11 11:05 AM, Braden Shepherdson wrote:
> The intention is that it allows plugins to specify that they require at least a certain
> version of the native code for each platform. This would be for things like added
> a new transport type to the bridge, as when we added binary data transmission
> on iOS and Android a year or so ago. Any plugins published that relied on it would
> specify at least that level of cordova-android and cordova-ios, whichever releases
> the changes made it into. It turns out that the native code is stable enough that
> this is hardly ever relevant.
> 
> Answering your questions:
> - The cordova-plugman version returning node's version sounds like a bug.
> It should be Plugman's NPM version number so far as I know.
> - Very few. Most of the significant changes happened several versions ago; in
> most cases ">= 3.0" is sufficient.
> - Build time (more precisely, plugin install time). There are currently no
> constraints or checks for eg. what versions of Android a plugin supports.
>     - This is true even of the "cordova" one, which is actually the version of the
> `cordova` CLI tool if memory serves.
> 

Thanks, patch is here:
https://github.com/jbondc/cordova-plugman/blob/master/src/util/default-engines.js

Seems like there should only be "cordova" and not "cordova-ios", "cordova-android", "cordova-*", they check the same 'script' file
Maybe it was different in 2.x?

<engine name="cordova" version=">=3.0.0"/>
<engine name="cordova" version=">=3.3.0" platform="android"/>

Equivalent to:
<engine name="cordova" version=">=3.0.0"/>
<engine name="cordova-android" version=">=3.3.0" platform="android"/>


Re: Engine confusion

Posted by Andrew Grieve <ag...@chromium.org>.
I think it makes the most sense to have:

name="..." <-- this is the only thing that specifies the thing whose
version you care about
platform="..." <-- this specifies that you care about the version only on a
subset of platforms.

So, for an android platform:
<engine name="cordova-android" version=">=3.0.0" platform="android" />


So, for an android engine, I'd like:

<engine name="android-chromeview" platform="android" version... />



On Fri, Feb 21, 2014 at 9:54 AM, Marcel Kinard <cm...@gmail.com> wrote:

> I prefer the former. I'd rather do a match for a simple attribute value
> (which is easy to write an XSD for), than have to parse/unparse a value
> convention with a bunch of hyphens or some custom syntax.
>
> On Feb 21, 2014, at 9:36 AM, Jonathan Bond-Caron <jb...@gdesolutions.com>
> wrote:
>
> > <engine name="cordova" version=">=4.0.0" platform="android"
> runtime="chromeview" />
> >
> > Vs.
> > <engine name="cordova-android-chromeview" version=">=3.3.0" /> ?
> >
>
>

Re: Engine confusion

Posted by Marcel Kinard <cm...@gmail.com>.
I prefer the former. I'd rather do a match for a simple attribute value (which is easy to write an XSD for), than have to parse/unparse a value convention with a bunch of hyphens or some custom syntax.

On Feb 21, 2014, at 9:36 AM, Jonathan Bond-Caron <jb...@gdesolutions.com> wrote:

> <engine name="cordova" version=">=4.0.0" platform="android" runtime="chromeview" />
> 
> Vs.
> <engine name="cordova-android-chromeview" version=">=3.3.0" /> ?
> 


RE: Engine confusion

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Wed Feb 12 02:12 PM, Tim Kim wrote:
> 
> 
> Yep, Braden is correct. That is totally a bug.  Filed here:
> https://issues.apache.org/jira/browse/CB-6023
> 

Thoughts on?
<engine name="cordova" version=">=3.3.0" platform="android"/>

Vs.

<engine name="cordova-android" version=">=3.3.0" /> 

I'm trying to look at how this can apply to 'runtimes'. E.g.

<engine name="cordova" version=">=3.0.0" platform="android" />
<engine name="cordova" version=">=4.0.0" platform="android" runtime="chromeview" />

Vs.
<engine name="cordova-android-chromeview" version=">=3.3.0" /> ?


Re: Engine confusion

Posted by Tim Kim <ti...@gmail.com>.
>
>  Should "cordova-plugman" be renamed to "node"?


- The cordova-plugman version returning node's version sounds like a bug.
> It should be Plugman's NPM version number so far as I know.


Yep, Braden is correct. That is totally a bug.  Filed here:
https://issues.apache.org/jira/browse/CB-6023


On 11 February 2014 08:05, Braden Shepherdson <br...@chromium.org> wrote:

> The intention is that it allows plugins to specify that they require at
> least a certain version of the native code for each platform. This would be
> for things like added a new transport type to the bridge, as when we added
> binary data transmission on iOS and Android a year or so ago. Any plugins
> published that relied on it would specify at least that level of
> cordova-android and cordova-ios, whichever releases the changes made it
> into. It turns out that the native code is stable enough that this is
> hardly ever relevant.
>
> Answering your questions:
> - The cordova-plugman version returning node's version sounds like a bug.
> It should be Plugman's NPM version number so far as I know.
> - Very few. Most of the significant changes happened several versions ago;
> in most cases ">= 3.0" is sufficient.
> - Build time (more precisely, plugin install time). There are currently no
> constraints or checks for eg. what versions of Android a plugin supports.
>     - This is true even of the "cordova" one, which is actually the version
> of the `cordova` CLI tool if memory serves.
>
>
> Braden
>
>
> On Tue, Feb 11, 2014 at 10:20 AM, Jonathan Bond-Caron <
> jbondc@gdesolutions.com> wrote:
>
> > I'm a bit confused about 'engines'
> >
> > To my surprise, "cordova-plugman" actually returns node's version:
> >
> >
> https://github.com/apache/cordova-plugman/blob/master/src/util/default-engines.js
> >
> > Some questions:
> >
> > -          Should "cordova-plugman" be renamed to "node"?
> >
> > -          Are there many plugins that depend on "version x" of
> > cordova-android, cordova-ios, xcode, ...?
> >
> > -          Are 'engines' meant be build time requirements vs. runtime
> > (~webview) requirements?
> >
> >
> >
> > It all looks like build time, with the exception of "cordova" where
> > cordova.js exec() is required by the plugins.
> >
> > J
> >
> >
>



-- 
Timothy Kim

Re: Engine confusion

Posted by Braden Shepherdson <br...@chromium.org>.
The intention is that it allows plugins to specify that they require at
least a certain version of the native code for each platform. This would be
for things like added a new transport type to the bridge, as when we added
binary data transmission on iOS and Android a year or so ago. Any plugins
published that relied on it would specify at least that level of
cordova-android and cordova-ios, whichever releases the changes made it
into. It turns out that the native code is stable enough that this is
hardly ever relevant.

Answering your questions:
- The cordova-plugman version returning node's version sounds like a bug.
It should be Plugman's NPM version number so far as I know.
- Very few. Most of the significant changes happened several versions ago;
in most cases ">= 3.0" is sufficient.
- Build time (more precisely, plugin install time). There are currently no
constraints or checks for eg. what versions of Android a plugin supports.
    - This is true even of the "cordova" one, which is actually the version
of the `cordova` CLI tool if memory serves.


Braden


On Tue, Feb 11, 2014 at 10:20 AM, Jonathan Bond-Caron <
jbondc@gdesolutions.com> wrote:

> I'm a bit confused about 'engines'
>
> To my surprise, "cordova-plugman" actually returns node's version:
>
> https://github.com/apache/cordova-plugman/blob/master/src/util/default-engines.js
>
> Some questions:
>
> -          Should "cordova-plugman" be renamed to "node"?
>
> -          Are there many plugins that depend on "version x" of
> cordova-android, cordova-ios, xcode, ...?
>
> -          Are 'engines' meant be build time requirements vs. runtime
> (~webview) requirements?
>
>
>
> It all looks like build time, with the exception of "cordova" where
> cordova.js exec() is required by the plugins.
>
> J
>
>