-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
TypeScript #37
Comments
Hi @FredyC Regarding Typescript. I guess this issue is a good place to talk about the plan. I personally use Typescript heavily in my projects and would just prefer to "re-write" the lib using typescript. But I know not everyone on the team might be on that same page. |
@uriklar If you can rewrite whole lib to typescript, I wouldn't mind) |
Ok, I may dive into that next week in theory. Do you have some experience with mixing propTypes and TypeScript? In our apps, we are using TS only. For a lib, it definitely makes sense to have both as JS consumers would be left out in the wind otherwise. There surely must be some effective way how to cover this without duplicating it for both worlds. |
@JustFly1984 Do you have some tool for that? I was trying to look for one but wasn't lucky. |
@FredyC I do not know any tool to convert propTypes to typescript. I've just gother all proptypes in single file, co it could be useful to create types 1 to 1. |
I think we can pretty much base all our typings on: With a bit of extending. I've started working on a POC. I'll link the branch here when it's ready |
Pushed https://github.com/JustFly1984/react-google-maps-api/compare/typescript Right now it's a POC using the google maps types. Works nicely with the Circle component. Now just need to refactor all remaining components and define their interfaces |
@uriklar Thank you for such an amazing pile of work. I got rather swamped with other stuff, so I was unable to watch it through. |
So in #18 you have a TypeScript mentioned in the roadmap, but what it actually means for you? In my experience, it's just a bad idea to have typings made manually. It always gets desynchronized. What is your opinion on that?
Besides, when I saw there is a Babel Polyfill requirement, I got real goosebumps. Haven't seen that for a while. I certainly don't want to enlarge app bundle with this monstrosity. If the package would be written in TypeScript, I believe this requirement could be removed as TSC is more than capable of production ES5 compatible code without any hiccups.
The text was updated successfully, but these errors were encountered: