-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Migrate BCD internals to TypeScript #16333
Comments
CC @saschanaz @schalkneethling @caugner @foolip @sideshowbarker @bershanskiy (pretty much every contributor I can think of right now who is active and has contributed to BCD's infrastructure) |
There's already JSDocs everywhere, I guess it'll be very straightforward to migrate. |
I've read but never written any TypeScript, so I don't have a strong opinion on this. |
Same here. I’d never worked much with TypeScript until I had occasion to make some contributions to Yari. But after having working with TypeScript in Yari, I’m sold on the benefits it could also provide to maintenance of the BCD internals. |
I fully support migration to TypeScript, I used it extensively in the past and found the following advantages in my own projects:
This is a very important point. In my opinion, inconsitent/obsolete typedefs are the largest problem with TypeScript ecosystem, and it can be reliably fixed only by ïn-depth"adoption of good TypeScript. The problem is:
This happens very rarely in practice, but when it does it is a huge pain to fix it. I remember reading a blog post about this exact bug in React. (I can try to find it, if you are interested.) Also, please note that we do not have to make TypeScript transition all at once, we can break it up over time. We can start simply by renaming files from ".js" to ".ts". |
Thanks for your feedback, @bershanskiy, this is all really wonderful information! The gradual transition would definitely help in this case as well! And yes, #16328 is absolutely the motivation behind this, haha! XP |
For the record, I would love to see BCD internals in TypeScript. 😍 |
It sounds like we're all in agreement! I've opened #16406 to prepare for the migration, and will commence work on the actual migration soon (once all the script changes have been merged or closed)! |
With as big of a consumer base and how critical BCD is, it's important that we ensure that our code is always functioning as intended. As I have been working on Yari, I have now realized the power that TypeScript has in projects like this.
I think that we should consider migrating our internal code over to TypeScript, which should help us eliminate issues we may have during development.
(An added benefit is that in doing so, we can always be certain that our typedefs are up to date!)
The text was updated successfully, but these errors were encountered: