-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be careful to avoid breaking changes in with the typescript types. #1439
Comments
I want to try this approach. This way we can be sure our types are good. For example, we currently have |
I was playing around today with different ways of changing the way we export types for #1439. I looked at only exporting 'Parameter' types, only exporting 'Return' types, only exporting a manual list of 'important' types. They all had different pros and cons, and it was very difficult to settle on a good answer. For now, let's not export any parameter/return types. We can whitelist some types upon user request. I'm thinking `LaunchOptions` and `AccessibilitySnapshot` could be quite useful. We can always add new types after 1.0, but we can't remove them. The patch looks funny because this was my original intent for the types, but I didn't know I had to `export {}` to tell typescript that my .d.ts shouldn't export everything.
This is mostly done, except that we should add a test that lints our current types against the old ones. |
I tried to add a test that lints our current types against the old ones. It was stymied in two ways.
Closing this as infeasible. |
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 aDogSpeakOptions
type. If in a later version, we movespeak
to theanimal
class which dogs inherits from, we will only haveAnimalSpeakOptions
andDogSpeakOptions
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
The text was updated successfully, but these errors were encountered: