Open amirh opened 5 years ago
Instead of duplicating information from the changelog in the pubspec, we could parse the changelog.
pub upgrade
upgrades only to the next non-breaking version, so not sure how useful this would be in the current upgrade model!?
@mit-mit the 2 use cases I think this might help with are:
battery: ^0.2.0
in his pubspec, he sees there's a new major upgrade to the battery package, he goes to pubspec.yaml and changes to battery: ^0.3.0
planning on spending some time figuring out the new API changes. But instead he gets some obscure Gradle error he doesn't know how to deal with.battery: any
. (yeah this is not recommended, but it seems to be pretty common in practice) Maybe an alternate solution is to actually represent the gradle dependencies as pub dependencies?
@mit-mit I think that would be good to have on its own in addition to this, but there's also so much that can go into making plugin updates potentially breaking that I think it would be hard to completely capture everything as a dependency graph in pub.
Off the top of my head:
compileSdkVersion
.This particular change involved Gradle dependencies, but there's a lot of confusing breaking plugin updates like this that don't.
Now we have dependabot parsing changelogs for us when upgrading through that.
But it would still be cool to have this as a feature in the pub client.
For package updates that include breaking changes it can be sometimes useful to present the developer(package user) with a prompt showing a message provided by the package developer.
I think this would be useful when the change in the package requires more than just adjusting the code to a new API.
While the CHANGELOG is the official place to include such instructions the recent experience with upgrading flutter plugins to use AndroidX showed that many people don't always read these(e.g https://github.com/flutter/flutter/issues/27226 https://github.com/flutter/flutter/issues/27146 https://github.com/flutter/flutter/issues/27156)
What I envision is that we could include some breaking change message with the upgrade(in pubspec.yaml?) which will result in something like the following when running
pub upgrade
:The 2 use cases I think this might help with are:
battery: ^0.2.0
in his pubspec, he sees there's a new major upgrade to the battery package, he goes to pubspec.yaml and changes tobattery: ^0.3.0
planning on spending some time figuring out the new API changes. But instead he gets some obscure Gradle error he doesn't know how to deal with.battery: any
. (yeah this is not recommended, but this happens in practice)I believe this would be mostly useful for Flutter plugins where it is common to require some manual environment setup steps from the package users(e.g set up API keys, config Gradle, config Info.plist, etc...)
cc @kevmoo @mklim