Update REVIEWING.md

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-10-20 09:49:38 +02:00
committed by GitHub
parent dacd03daf8
commit ff621dbb5b
+1 -1
View File
@@ -229,7 +229,7 @@ When modifying an output type, any change that reduces constraints are breaking.
Adding new properties is not a breaking change, regardless of whether they are optional or not. Removing properties is on the other hand always breaking.
It is generally fine to increase constraints without it being a breaking change. For example, if we made the `title` property required, that would not be breaking.
It is generally fine to increase constraints without it being a breaking change. For example, if we made the `shape` property required, that would not be breaking.
There are some edge-cases though, for example if `shape` was changed to just `'square'`, that would be a breaking change because consumers might be checking for `box.shape === 'rounded'`, which would then be breaking. It's typically a quite easy thing for consumers to fix though. More generally, type unions and discriminated unions are quite troublesome in output types, as both adding and removing types from them are considered breaking changes.