DEV Community

How We Migrated from Javascript and Flow to TypeScript at Osome

Andrey Frolov on April 23, 2022

This fairy tale started a long time ago. Often, you make a bet on the wrong horse in life, but, unfortunately, you cannot do anything about it. You...
Collapse
 
rajeshroyal profile image
Rajesh Royal •

I made the same design of moving all the projects to TypeScript when I joined, and I'm glad I made that decision. Although some of the developers still has a tendency to use any which makes TS no use 🙁

Collapse
 
frolovdev profile image
Andrey Frolov • • Edited

And whats the problem with a small amount of any's in project?

Collapse
 
rajeshroyal profile image
Rajesh Royal •

We had big problem. cannot desctructure X from undefined

Thread Thread
 
frolovdev profile image
Andrey Frolov • • Edited

But the typescript type system is not Ocaml, Haskell, or Rust like; it doesn't give you any 100% that you don't get any runtime errors or null pointer errors :d

Yes, it prevents a huge surface of errors, but not as much as it looks in theory.

Thread Thread
 
rajeshroyal profile image
Rajesh Royal •

agreed 💯

Collapse
 
frolovdev profile image
Andrey Frolov •

Good point, but It's not so true, the development is not about black and white and good or bad, you always have semitones - tradeoffs. For us, it was an appropriate decision to make a sharp migration and start to check type coverage to reduce the amount of any's iteratively

Collapse
 
jwp profile image
John Peters •

Sometimes our legacy prejudices blind us. For Javascripters, they rejected TypeScript from the start. That's why newfound issues were solved using various Javascript libraries none of which used the same dependencies or coding patterns. Alas NPM became a virtual cesspool as a result.

TypeScript has its roots in over 35 years of other languages such as C#, Java and even Pascal. Many Javascripters and large companies see the value now. Demand is only going to grow. Being a part of that need is a great place to be right now.

Collapse
 
frolovdev profile image
Andrey Frolov •

Thank you for your comment. But what do you mean by demand right here?

Collapse
 
jwp profile image
John Peters •

TypeScript is becoming very popular in large companies.

Thread Thread
 
frolovdev profile image
Andrey Frolov •

de facto standard :d

Collapse
 
drmnk profile image
Denis Romanenko •

Thanks God it was not Dart. Canonical still doesn’t have strength to admit that they bet on the wrong horse…

Collapse
 
insidewhy profile image
insidewhy •

Using Dart on a flutter project at work. So much disappointment, so much boilerplate, so much having to give up on doing things because the type system is too basic.

Collapse
 
frolovdev profile image
Andrey Frolov •

Interesting point. What do you mean by too basic?

Collapse
 
frolovdev profile image
Andrey Frolov •

Nowadays most people die of a sort of creeping common sense, and discover when it is too late that the only things one never regrets are one's mistakes :d

Collapse
 
artemekaterinenko profile image
artemekaterinenko •

Great stuff! This will save us a lot of time for the future migration

Collapse
 
frolovdev profile image
Andrey Frolov •

Thank you mate

Collapse
 
konnikiforov profile image
KonNikiforov •

Thx, get some insights for my current project!

Collapse
 
frolovdev profile image
Andrey Frolov •

appreciate it

Collapse
 
funsis profile image
Sergey Korovin •

Great article, found some interesting ideas for me

Collapse
 
frolovdev profile image
Andrey Frolov •

My pleasure