Skip to content

Upgrading pub_semver 1 to 2

Breaking1.4.4 → 2.2.1Breaking5Platform4Deprecated1New1Changed57Fixed4Other1

BreakingUpgrade verdict

5 breaking changes and 4 platform requirement changes.

  • Three font file types now use new names, so code looking up the old names will no longer find them.
  • The model/vnd.mts file type is no longer recognized.
  • Code can no longer extend or implement the Version class.
  • Two fields on Version now declare their element type as Object instead of a bare List, which can affect code that assigns or reads them.
Top 5 of 10 that need code or config changes

Dart SDK requirement changed in 2.1.5: >=2.0.0 <3.0.0 → ^3.4.0.

Breaking5
Renames application/x-font-otf, application/x-font-ttf and application/x-font-woff to font/otf, font/ttf and font/woff.
application/x-font-otffont/otfapplication/x-font-ttffont/ttfapplication/x-font-wofffont/woff
Removes the model/vnd.mts mime type.
model/vnd.mts
Marks the Version class as final instead of using @sealed.
Version
Adds type parameters to the signatures of the Version.preRelease and Version.build fields (List to List<Object>).
Version.preReleaseVersion.build
extensionFromMime(String mimeType) returns null instead of mimeType for an unknown mime type.
extensionFromMime
Platform4
Requires Dart 3.4.0.
Requires Dart 2.17.
Requires Dart 3.4 or greater.
Requires Dart 3.1 or greater.
Deprecated1
Notes that VersionConstraint.any and VersionConstraint.empty should not be reassigned and will become final.
VersionConstraint.anyVersionConstraint.empty