cordova-plugin-dialogs icon indicating copy to clipboard operation
cordova-plugin-dialogs copied to clipboard

fix(ios): set engines

Open jcesarmobile opened this issue 2 months ago • 8 comments

In https://github.com/apache/cordova-plugin-dialogs/pull/138 I removed code for iOS < 8.3, so I'm setting the engine to at least cordova-ios 4.4.0 as it was when the deployment target was set to iOS 9 (yes, it was done in a minor). While the code works on iOS 8+. there was a bug on 8.0 to 8.2 and I've removed the workaround, so better require iOS 9+. I could set it to even a higher cordova-ios version if desired since those versions are ancient anyway.

Also moved the >100 to a 4.0.0 version so the 3.0.0 version of the plugin can be installed

jcesarmobile avatar Oct 11 '25 21:10 jcesarmobile

Hi @breautek,

was I wrong with my suggestions? I thought the engines tag is obsolete in config.xml. Also the configuration "cordova": ">100" seems odd to me. Is this a correct configuration?

Regards,

Manuel

GitToTheHub avatar Oct 13 '25 13:10 GitToTheHub

I thought the engines tag is obsolete in config.xml.

Nope, it's not obsolete. It controls some checks on the Cordova CLI, and/or platforms when installing cordova plugins.

Where the engines inside package.json NPM controls checks on the NodeJS/npm runtime.

Also the configuration "cordova": ">100" seems odd to me.

In this case, it's set to CLI requirement >100 (which doesn't exist) on v4 of this plugin (which also doesn't currently exist). The rationale is that it forces whoever does a major version bump to also pay attention to the engines block and to set it accordingly.

breautek avatar Oct 13 '25 13:10 breautek

Nope, it's not obsolete. It controls some checks on the Cordova CLI, and/or platforms when installing cordova plugins.

Why does the documentation.) say for the plugin.xml engines tag:

NOTE: In Cordova 6.1.0+, the recommended place to specify platform, plugin, and CLI dependencies is in a plugin's package.json. See specifying Cordova dependencies for more information

This sounds for me as the tag is obsolete and should be replaced by engines in package.json. Also the documentation says in Specifying Cordova Dependencies:

This feature is intended to eventually replace the engines element in plugin.xml.

There it says, it will replaces the engines tag in plugin.xml.

Why do plugins work, if I remove the engines tag?

In this case, it's set to CLI requirement >100 (which doesn't exist) on v4 of this plugin (which also doesn't currently exist). The rationale is that it forces whoever does a major version bump to also pay attention to the engines block and to set it accordingly.

If you do something on a plugin, you should keep that anyway in mind. It's strange to create a reminder like this for this.

GitToTheHub avatar Oct 13 '25 14:10 GitToTheHub

I already provided the context about the Cordova > 100 on the conversation we had on your PR, but in case you missed

https://lists.apache.org/thread/lfnxoss879yqw0rbljqycms7r0g6vgy7

jcesarmobile avatar Oct 13 '25 20:10 jcesarmobile

Thanks, I forgot about this link.

So it's only to protect people installing a plugin which is maybe not compatible anymore with old cordova cli versions. For people who don't know about this will wonder and don't understand it's a entry for that. Could this be somewhere documented? So that have to be added in every plugin.

GitToTheHub avatar Oct 13 '25 21:10 GitToTheHub

I still don't get, why engines should also be configured in plugin.xml when the doc says package.json is a replacement for it

GitToTheHub avatar Oct 13 '25 21:10 GitToTheHub

The plugin doesn’t require a specific CLI version at the moment, so the engines are in both places for backward compatibility. If adding it only in the package.json, then it should require Cordova CLI 6.1.0 or newer

jcesarmobile avatar Oct 13 '25 22:10 jcesarmobile

Ah yes, you are right. Couldn't it be specified to 6.1.0 here?

GitToTheHub avatar Oct 14 '25 09:10 GitToTheHub