benetech / VideoDeduplication

GNU General Public License v3.0
34 stars 12 forks source link

Migrate frontend to TypeScript #427

Closed stepan-anokhin closed 2 years ago

stepan-anokhin commented 2 years ago

The #364 showed that this would be extremely useful to have a static types in our frontend as it becomes more complex:

I've already experimented with using TypeScript in my free time and it worked great. TypeScript has very powerful and convenient type system (algebraic types, structural typing, generics, etc), which provides a great amount of polymorphism and fits the dynamic JS code-base very well.

ETA is 2d

Migration of React components is almost 1-to-1. Just replace PropTypes with react types. Migration of the Redux state could be tedious but it will not be required after #426. I've already tried to migrate parts of the Server and it was pretty simple. Also this could be done gradually: we can mix JS and TS code for some time.