pub icon indicating copy to clipboard operation
pub copied to clipboard

Failed resolution of global activate should indicate if package is discontinued

Open parlough opened this issue 1 year ago • 2 comments

There's been some confusion and reported issues by developers finding old references to use dart pub global activate for package:devtoools which was discontinued in favor of being bundled with the SDK.

Two recent examples of this resulting in confusion are https://github.com/flutter/devtools/issues/7135, https://github.com/flutter/devtools/issues/6550.

On recent SDK versions this fails due to incompatible SDK constraints, potentially misleading the user into thinking they have an issue. The error message should likely also indicate a package is discontinued and if it has a replacement.

I hope that will help avoid some of the confusion.

There's a separate issue for devtools though (likely for pub.dev), as there is no replacement package, so it might be nice if instead of a replacement, a link for more information could be configured instead. This might also help for packages and APIs that start outside of an SDK and later are included, if that ever happens.

parlough avatar Jan 31 '24 15:01 parlough

Yeah it would be nice to show up-front that the package is discontinued.

A sad thing here is that if it managed to resolve it would be shown as discontinued in the resolution report.

There's a separate issue for devtools though (likely for pub.dev), as there is no replacement package, so it might be nice if instead of a replacement, a link for more information could be configured instead. This might also help for packages and APIs that start outside of an SDK and later are included, if that ever happens.

I think we decided against a custom deprecation message because we don't want package authors to be able to put arbitrary stuff in the terminal output. (could eg. be used for advertisement). Maybe we could link to the package page - where the README could explain more...

sigurdm avatar Feb 01 '24 08:02 sigurdm

Related to https://github.com/dart-lang/pub-dev/issues/2457

sigurdm avatar Feb 01 '24 09:02 sigurdm