Skip to content

Consider hosting a "migration cookbook" (of sorts) to help with breaking changes #54948

Open
@matanlurey

Description

@matanlurey

See #54947.

There are certain patterns that need to be followed to work around tricky breaking changes. Consider the following:

class Cow {
  void moo() {}
}

Later, we decide Cows should also be able to walk:

class Cow {
  void moo() {}
+ void walk() {}
}

This is a breaking change, because anyone who wrote:

class CowLikeApparatus implements Cow {
  @override
  void moo() {}
}

... now is missing an implementation of walk. It is non-obvious that someone could land a patch in advance:

class CowLikeApparatus implements Cow {
  @override
  void moo() {}

+ // TODO(name): Remove after <issue link>
+ // ignore: unnecessary_override
+ @override
+ void walk() {}
}

I suspect there are many such "tricky" cases that the larger Dart team has encountered over the years (including landing lints and hints) that are mostly tribal knowledge. It would be a shame if there wasn't a central place folks could reference to instead of having to re-discover best practices over and over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-documentationPrefer using 'type-documentation' and a specific area label.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions