atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.17k stars 2.53k forks source link

Move from Flow to TypeScript #982

Open alexreardon opened 5 years ago

alexreardon commented 5 years ago

At Atlassian we consolidating on a single type system: TypeScript.

In 2019 we plan on moving react-beautiful-dnd to TypeScript.

We still hope to have a good flow story through the flowtyped project. We can essentially just use our existing flow types for a react-beautiful-dnd library definition.

alexreardon commented 5 years ago

For me personally this is not a negative reflection on flow. I really enjoy using it. However, there are advantages for us in consolidating on a type system internally. Also, my understanding is that TypeScript is a more popular project so a lot more people will get first class types when we move over

❤️

TrySound commented 5 years ago

I would prefer you to keep flow types up-to-date in this repo. As you can see there's not so much people who will maintain them separately.

TrySound commented 5 years ago

How about rewriting with reason? Type system is much nicer.

lilymatcha commented 5 years ago

@alexreardon This is an exciting development! Since Typescript is more widely used, it will also help make it easier for people to contribute to the project. Within 2019, what is your expected timeline for this migration?

treshugart commented 5 years ago

Just as we didn't want to maintain TS types when the source was in Flow, I don't think it's worth maintaining Flow types when moving to TS.

@lilymatcha Alex will be back mid-Jan. See #1010 for more details.

TrySound commented 5 years ago

@treshugart Flow types will be maintained. There are existing users.

alexreardon commented 5 years ago

@TrySound I am still thinking of the best way to maintain the flow types. Given they already exist I am open to having them in the repo. Once we start on the TypeScript conversion then we will have a better idea what the story could be

TrySound commented 5 years ago

Types will be quite small. So it won't take a lot of efforts to maintain them. Keeping them separately will make them out of date soon.

mdestagnol commented 5 years ago

@alexreardon good news for typescript. Do you guys also plan to move over Atlaskit?

nutboltu commented 5 years ago

@alexreardon Great initiatives! For initial step, any thoughts of moving @types/react-beautiful-dnd to this repos?

MaximSagan commented 4 years ago

@alexreardon Has the migration to TS been abandoned?

eran-pinhas commented 4 years ago

Hey guys, thought I would give it a shot

I tried running Khan Academy's flow-to-ts on a single file and it seems to do a decent job. Sure that it's not the only change need to be done, but it seems like a good start for the bulk of the code.

I'm just wondering how we should manage the existing PRs, 99% of the files would be completely different after the transition: The file names would be .ts/.tsx instead of .js/.jsx, the content would quite different as well and some config file would require changes as well. Only solution I can think of is to write a bash script that does this transition automatically so it could be applied on forked repos as well. The only problem with that is that applying all of the changes using script may be quite complicated...

Would love to hear your thoughts about it

Cheers

UPDATE: started out here

100terres commented 2 years ago

react-beautiful-dnd has been fully migrated to TypeScript here: https://github.com/react-forked/dnd :slightly_smiling_face: The repo is a fork of rbd that I plan to maintain.

Here's a blog post about it. Give it a try :slightly_smiling_face: