thyme icon indicating copy to clipboard operation
thyme copied to clipboard

Convert to TypeScript

Open Gaya opened this issue 7 years ago • 7 comments

TypeScript is getting more and more popular. Since we're using Flow it might be quite easy to convert to TypeScript and be more "developer friendly".

Gaya avatar Jan 10 '19 07:01 Gaya

TypeScript support in CRA is still kind of minimal. Let's check if basePath gets supported.

Gaya avatar Jan 10 '19 15:01 Gaya

@Gaya Did you use create-react-script to startup?

Scoombe avatar Jan 25 '19 11:01 Scoombe

@Gaya Have you looked into how this would be done also? Just adding the different dependencies?

Scoombe avatar Jan 25 '19 11:01 Scoombe

I followed their guide. There are some features I use in JavaScript like absolute imports which are not yet supported in Create React App + TypeScript, they're working on getting it supported though.

I am waiting until that is fixed.

https://facebook.github.io/create-react-app/docs/adding-typescript

Gaya avatar Jan 25 '19 12:01 Gaya

@Gaya Oh right, looks quite easy then, I didn't realize. Have you used much typescript before?

Scoombe avatar Jan 25 '19 13:01 Scoombe

@Scoombe Yes I have used it on another project. Still prefer Flow, but it is loosing the popularity contest and to keep up with the rest of the community I'd say using TypeScript will be preferable. It's not even that different though, so it should be too much of a task

Gaya avatar Jan 25 '19 14:01 Gaya

Checked back on this one today since TS support has been improved. The feeling I get right now is that I am only trading in one technology for the other without any benefits other than: it's more popular to use. There are a few trade-offs when switching to Typescript.

  • ESLint support is not great, which would take a lot of time to reconfigure
  • Missing features like import / exporting types
  • Feels just less "working", probably because the project is Flow type

It makes me wonder how much it's worth switching the Typescript at all, I have always preferred Flow type any way.

I am going to think this one over a bit more.

Gaya avatar Apr 23 '19 14:04 Gaya