Skip to content

Can we make 1.0 releases of packages non-breaking? #3385

Closed
@collinjackson

Description

@collinjackson

Flutter packages have a special update to 1.0 when they reach API stability. This doesn't actually need to be a breaking change, but the version solver treats it as one, leading to conflicts at the worst possible time - when a package is just achieving popularity. As a result, the incentives for developers to stabilize their APIs is low.

If we could teach the constraint solver to be aware that 1.0 promotions aren't breaking, we wouldn't need to inflict pain on the ecosystem just as a package is reaching widespread usage, and developers might get to 1.0 faster.

Straw proposal:

  • The constraint solver could treat version "1.x.0, 0.42.x" as satisfying a request for ^0.42.x+y or ^1.x.y.
  • It could be an error for the minor versions (x) to not match. Or alternatively the minor and patch versions of 0.42 could be implied and omitted.
  • Minor updates would keep the pre-1.0 major version locked at the major version that was initially promoted. So in this case pub would reject any pre-1.0 version other than (0.42) once the promotion occurred. Version 1.1.0 (0.42) would satisfy a request for ^0.42.0 or ^0.42.100 or ^1.0.0 or ^1.1.0.
  • Breaking changes would force a major update to 2.0.0, at which point the pre-1.0 version number would no longer be relevant.

(Problem statement and proposal are based on discussions with @amirh.)

Context:

https://semver.org/
https://dart.dev/tools/pub/versioning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions