Home > Software engineering >  Dart: What is the difference between the "Upgradable" and "Resolvable" columns i
Dart: What is the difference between the "Upgradable" and "Resolvable" columns i

Time:09-25

What is the difference between the "Upgradable" and "Resolvable" columns in the output of "dart pub outdated"?

Here is an example of a package that can be upgraded to the latest. The Upgradable, Resolvable, and Latest all match:

url_launcher                            *6.0.11   6.0.12      6.0.12      6.0.12   

Here is an example of a package that is already at the highest resolvable version, but can't be upgraded to the absolute latest version. Presumably another dependency is restricting the resolvability to the latest.

rxdart                                  *0.26.0   *0.26.0     *0.26.0     0.27.2   

Here is an example of a package that can't be upgraded any higher but has a Resolvable version that is higher. What does this mean? How is this different from the middle case above?

provider                                 *5.0.0        *5.0.0       6.0.1        6.0.1

CodePudding user response:

Upgradable means an upgradeable version. Generally, minor version updates can be upgraded directly without modification.

Resolvable can use the version, generally a major version update (the 0.x version may have destructive changes, same as major version), may have incompatible interfaces to the previous version, if you update this version, you may need to change some code

Latest The latest version. If it is inconsistent with the Resolvable version, means the SDK version required by the latest version is inconsistent with the current project

CodePudding user response:

The main difference is that Resolvable mains the version you need to reach to resolve outdated issues in your project and Upgradable mains the version you can update of that package.

To resolve it you must find packages you can update and continue updating until you can update the main package.

You can see it in this link about those concepts: Dart pub outdated

CodePudding user response:

In addition to the other very useful posted thoughts, I have learned the following helpful details:

Upgradable refers to the highest version that your direct pubspec will permit, which considers the sdk version and the individual package version (whether to upgrade to just minor or also major). When Upgradable is limited, it can likely be your sdk version holding things back. In my case I was using sdk 2.12, but some packages require 2.14 now (Sep 2021).

From the docs:

The latest version allowed by your pubspec.yaml file. This is the version that dart pub upgrade resolves to. The value is - if the value in the Current column is -.

Resolvable refers to the highest version that all of the other packages' dependencies will allow, in addition to your direct pubspec constraints. When the Resolvable is limited, there is usually one package holding everything back, or a major version holding everything back.

From the docs:

The latest version that can be resolved, when combined with all other dependencies. This version corresponds to what dart pub upgrade gives you if all version constraints in pubspec.yaml are unbounded. A value of - means that the package won’t be needed.

  • Related