Skip to content

Be careful to avoid breaking changes in with the typescript types. #1439

Description

Right now, its easy to introduce breaking changes with our typescript types without realizing it.

  • Object literal types get names like ClassMethodArgument. If the argument name changes, the type name changes, and that is a breaking change.
  • If we have dog.speak(options) we will have a DogSpeakOptions type. If in a later version, we move speak to the animal class which dogs inherits from, we will only have AnimalSpeakOptions and DogSpeakOptions will be removed. This will be a breaking change.

There are probably some other subtle ways to introduce breaking changes that I have no thought of.

Possible mitigations

  • Add a test that checks that current types are a strict superset of the previously released types, unless this revision is a breaking change.
  • Manually add old types back into the api to make sure there are no breaking changes.
  • Don't export all parameter type objects, instead manually construct a set of useful types to export, and keep that from having breaking changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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