-
Notifications
You must be signed in to change notification settings - Fork 78
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 Support #32
Comments
@tiefox could you share your thoughts about using TS in React projects? |
@droshev quick thoughts: From this repository benefits:
For consumers:
I don't want to make a real advert or develop arguments, I think that many good writers have done it already :-) |
Sorry for late reply, but my thoughts are exactly the same as @o0Djeen0o . In my company we are looking to standardize all front-end development on Typescript, and currently looking to base our own internal component library for our internal enterprise apps on a good foundation, and we do already some Fiori + UI5, but also want to provide a standard to other teams working with React and Angular. Would be awesome if it was already in Typescript :) |
@o0Djeen0o @tiefox thanks for your feedback. I have asked few colleagues writing in React such as @casche to share some ideas. They use https://flow.org/. What are your thoughts for TS vs. Flow? |
For me is mostly the traction that TS is getting vs Flow, the ecosystem is booming and we are making a bet on it. See this https://2018.stateofjs.com/javascript-flavors/conclusion/ |
@tiefox I have seen that link. Both of them are close in terms of dev's satisfaction. I know that TS is more popular this year. This may flip quite fast. |
Hi again @droshev, I think that both solutions are valid for static type checking. As @tiefox mentionned, typescript has better support from the open source community, but Flow is also used and has Facebook behind, so both solutions valid here. The real difference is that Typescript is not just about static typings. It can work like that (you have for instance a babel preset to just remove typings info, like for Flow), but it is more a language with:
I'll let you check what fits your needs best. |
@o0Djeen0o @tiefox ok, we will discuss it and keep you posted |
@droshev Sure! Lets figure out the right component and do this :) |
Since the question is still out there as to how/if we should use TypeScript or Flow for our components, For my learning process, I decided to convert the SearchInput control. I create a separate create-react-app project with typescript enabled and it took about less than an hour to get the SearchInput control working exactly like it does in the current version. I did spend more time familiarizing myself with Typescript syntax since I haven't used it in a while than I did actually convert the JS to TSX. Because that conversion was so fast I also did the MultiInput, Modal and Pagination components as well. I would have to say in total time worked, it probably took less than 2 hours to convert all 4 components to TypeScript. |
Great @chrismanciero . I didn't had time yet to look into this ( just a lousy architect with barely any time to code anymore ) but I will also try a few. |
I don't want to start a typescript vs flow debate but with Microsoft behind TypeScript it's been great with tooling and also the fact that the angular fundamentals codebase will also be leaning towards typescript -- I think the answer is pretty straightforward about which to choose for consistency. |
I created this branch that has about 18 of 31 components rewritten using TypeScript - https://github.com/SAP/fundamental-react/tree/typescript-conversion Maybe that will push the conversation further as to what solution to use and if we go with TypeScript the ground work is setup to go foward with it. |
Hi 👋
|
@chrismanciero and @CodesOfRa these look great! I think one thing you may want to do is export the interface of the props and anything else passed in so that devs can import those props and use them as well. palantir/blueprint has a good example of this where they export IButtonProps |
Looks like things are still moving towards typescript, just in case we need any more reason, Kent C Dodds has a good post on Why every new web app at PayPal starts with TypeScript coming from having him used Flow prior to TypeScript. |
Another interesting one: |
I really like this tweet from Dan Abramov concerning when to implement a type system. https://twitter.com/dan_abramov/status/1084850819965554688. I'd say currently most of our 'bugs' are related to infrastructure and missing features. Once the library matures a bit more I'd be more inclined to consider adding a type system. |
Another one bites the dust... |
After using TypeScript for some time in a React+Redux+Material-UI project, I can't live without it anymore. |
Cannot thank you enough for this! thumbs up |
So nice! Is there any plan to merge these kind of typing into product and add do Typescript support officially? I cannot imaging living without Typescript now and my Library choice priority is:
|
Could not agree more. I'm maintaining a bunch of older Javascript apps, and only recently started in a new Typescript project. It took about 3 seconds of using TS+VSCode to convince me there is no going back... |
As a start, I started working on updating the DefinitelyTyped types here: DefinitelyTyped/DefinitelyTyped#41027 |
I just tried today to pull the types for this library but it seems there's a miss-match between some components. Fo example the From the docs: <Select placeholder="Select">
<List>
<List.Item>
<List.Text>
... Would be great to merge types definition into the project! |
Drafting an update to the DefinitelyTyped types DefinitelyTyped/DefinitelyTyped#43067 This has been merged as |
Any plans to use typescript or support it with typings ?
The text was updated successfully, but these errors were encountered: