cordova-docs icon indicating copy to clipboard operation
cordova-docs copied to clipboard

Using external tools with updated Cordova platform version

Open brody4hire opened this issue 5 years ago • 5 comments

Third-party tools such as Ionic and PhoneGap Build seem to use outdated Cordova CLI versions. This has led to support issues such as:

  • apache/cordova-plugin-inappbrowser#507
  • apache/cordova-ios#647

In order to avoid supporting issues like these, I think we need to somehow make it extra clear that Cordova users need to use recent platform versions.

As an idea, I wonder if we should recommend that users add platforms by the following form:

cordova platform add ios@5

or to be absolutely sure:

cordova platform add ios@latest

Using this command on Cordova CLI 9 seems to use caret (^), which I think is the right default.

This is related to #986 (explain platform pinning).

Any other ideas would be very welcome for discussion.

brody4hire avatar Jul 15 '19 17:07 brody4hire

  • Ionic CLI does't influence what platform versions are used and also doesn't pin the CLI.
  • Phonegap Build works totally different by having pinned versions on the cloud side, which are used by default (but can partially be overwritten by explicit definition in config.xml - they never made the jump to package.json)

janpio avatar Jul 15 '19 18:07 janpio

  • Ionic CLI does't influence what platform versions are used and also doesn't pin the CLI.

I don’t understand. Ionic CLI works with Cordova using ionic cordova commands. We saw in apache/cordova-ios#647 that Ionic CLI would install the old cordova-ios version, if no version is specified.

  • Phonegap Build works totally different […]

Yes. I think we should tell users that they should do whatever is necessary to use recent platform versions, as we want to avoid support questions related to old platform versions.

At this point, I would agree that people using PhoneGap build have to configure this in config.xml, at least in this point of time.

brody4hire avatar Jul 15 '19 18:07 brody4hire

  • Ionic CLI does't influence what platform versions are used and also doesn't pin the CLI.

I don’t understand. Ionic CLI works with Cordova using ionic cordova commands. We saw in apache/cordova-ios#647 that Ionic CLI would install the old cordova-ios version, if no version is specified.

Then what you saw was wrong or caused by something unrelated. Afaik there is no special platform version handling in Ionic CLI, and regarding Cordova CLI is just uses whatever version is installed by the user.

Yes. I think we should tell users that they should do whatever is necessary to use recent platform versions, as we want to avoid support questions related to old platform versions.

Cordova CLI explicitly is built in a way that uses platform versions that are compatible at the time of release (+ some semver wiggle room). Suggesting users to install @latest contradicts that, doesn't it?

janpio avatar Jul 15 '19 19:07 janpio

Then what you saw was wrong […]

I think apache/cordova-ios#647 came about because the OP had old version of Ionic CLI installed. Recent version of Ionic CLI seems to install cordova-ios@5, as required at this time (see https://github.com/apache/cordova-ios/issues/647#issuecomment-511537590).

Cordova CLI explicitly is built in a way that uses platform versions that are compatible at the time of release (+ some semver wiggle room). Suggesting users to install @latest contradicts that, doesn't it?

Agreed. I just rewrote most of the title and part of the description to try to avoid this contradiction.

From the updated description:

In order to avoid supporting issues like these, I think we need to somehow make it extra clear that Cordova users need to use recent platform versions.

As an example:

cordova platform add ios@5

Any other thoughts or ideas?

brody4hire avatar Jul 15 '19 19:07 brody4hire

Recent version of Ionic CLI seems to install cordova-ios@5

Ionic CLI doesn't install any platforms. They just tell Cordova CLI to a platform. Ionic CLI has nothing to do with all that - the user was just using an old Cordova CLI and got the old, pinned platform of it.

In order to avoid supporting issues like these, I think we need to somehow make it extra clear that Cordova users need to use recent platform versions.

As an example:

cordova platform add ios@5

Any other thoughts or ideas?

For people that use older Cordova CLI for whatever reason, it might be the right thing to use older platforms.

janpio avatar Jul 15 '19 20:07 janpio

The latest CLI does not pin platforms anymore. It will always fetch latest released platform when creating new projects. If users want to maintain pinning, they must provide the version now. This is documented in the dev docs (next doc release.).

erisu avatar May 31 '23 03:05 erisu