Replies: 2 comments 1 reply
-
For sure, it would be great to have stricter types. Currently, one can use an unknown property and TS won't warn them about it since there's |
Beta Was this translation helpful? Give feedback.
-
Please run with it
YES! To share some context: I learned (and still am learning) how to TypeScript on @octokit. There is a lot of stuff that could be much more elegant, and I'm nothing but enthusiastically welcoming anyone who wants to help out in improving it. I have some bigger plans/ideas that I will lay out as soon as I find the time (April), but one thing in particular that I would like to do is to use a global There are 3 things that I'd like to address that way
I hope that helps to put the current Types and what I imagine them to be in future into context |
Beta Was this translation helpful? Give feedback.
-
I've started using @octokit/rest for a few things, and the types seem to be in an interesting shape - which is to say they seem to be overly complex in places and I suspect it's limiting IDEs ability to provide intellisense and autocompletes.
I have a limited understanding of how the whole system ties together, and so understand a lot of this is because we're using a plugin system, auto generating stuff, and that there are maintenance overheads among other things so I'm going to try not to challenge the whole thing as I think that'd not get anywhere.
Instead, I'd like to discuss current behaviours of the client and what we're actually wanting to achieve & support in the hopes of gaining enough understanding that I can dive into some of the types and see if I can do some improving.
I also suspect we're probably overextending our reach to support a few patterns that require much weaker types, like what we were doing in octokit/webhooks.js, which would be better supported by using a new method to separate things out.
Right now I'd like to focus on the fact that this is apparently valid:
While it doesn't cause the client to crash at runtime, it doesn't strike me as something we should be allowing if possible at compile-time.
The respective type for this looks like this:
(tbh, the bulk of what I'm asking here is: are people ok if I try to make our types a bit stricter, and with possibly breaking a few builds both temporarily and permanently in the process?)
Beta Was this translation helpful? Give feedback.
All reactions