breautek commented on PR #1515: URL: https://github.com/apache/cordova-ios/pull/1515#issuecomment-4876709972
I know it's a bit late for feedback, but thought to at least write down my experience somewhere and maybe it can be a foundation for future improvements. > SwiftPM doesn't have particularly good support for overriding library versions from sub-dependencies or a concept like npm's peerDependencies From my recent work in doing my upgrades of several internal plugins and such I don't really believe this is the case. Because SPM will not accept duplicate packages of varying versions. Every package that declares a dependency on a package will cause that package to resolve to the latest version of that package that is still satisfies all the version constraints across all packages. If there is a version incompatibility (say one package wants v1 of a dependency, and another package wants v2 of that same dependency) then package resolution will fail and the project simply won't be buildable. For example I have the following packages: sqlite v0.4.5 (transient dependency, app does not declare this dependency directly) tilegen depends on sqlite using ^0.4.5 (upToNextMinor) cordova-plugin-sqlite depends on sqlite using exact 0.4.5 The app resolves the sqlite package to 0.4.5. So in theory plugins can define a loose version range on cordova-ios, either a particular major `(upToNextMajor(from: "8.0.0"))` which accepts all version 8, like NPM's `^8.0.0`. Couple of issues I can foresee: 1) I'm not sure what SPM does if you have a local dependency, I believe it acts as an any version -- so with the current configuration where the Cordova Plugins SPM package depends on the local cordova-ios which is technically versionless I think it may defeat the purposes of explicitly declaring supported versions to begin with. 2) We also can't simply do away with the local SPM module because the framework code is coupled with the CLI implementation for installing iOS platform & plugins, and if we pin to a specific version, it will obviously fetch a copy of cordova-ios rather than using what is bundled within NPM's tarball. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
