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.
Right now, its easy to introduce breaking changes with our typescript types without realizing it.
ClassMethodArgument. If the argument name changes, the type name changes, and that is a breaking change.dog.speak(options)we will have aDogSpeakOptionstype. If in a later version, we movespeakto theanimalclass which dogs inherits from, we will only haveAnimalSpeakOptionsandDogSpeakOptionswill 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