DEV Community

Discussion on: Moving from JavaScript to TypeScript

Collapse
 
ingosteinke profile image
Ingo Steinke

How do you manage to build express apps using TypeScript everywhere?
Your example is quite straightforward, but once you add node + express + mongoose it starts getting harder. Most tutorial and StackOverflow code is only JS (mostly JS that does not even pass the recommended ESLint rules either, not to talk about TypeScript yet) and if there are no prebuilt type files, you can end up spending hours guessing what return type a certain function might expect. At least I did when I started a new MERN side project and tried to use TypeScript everywhere. got me so frustrated I'd rather go back to PHP or any other properly typed language for the backend, or maybe use deno next time. What do you think?

Collapse
 
andrewbaisden profile image
Andrew Baisden

Yes this article was just an introduction. I am working on a follow up article Creating MERN Stack Applications 2022 and that tutorial will be using TypeScript. I taught myself how to build a MERN application using TypeScript without too many problems so it can be done.

Deno is a potential option too but I have not used it in a long time.

Collapse
 
mycarrysun profile image
Mike Harrison

I'd just like to stress the importance of actually learning the way things work instead of following and relying on tutorials for everything. If you can get good at reading the official documentation for languages/libraries you will be much better off. You'll then be able to use whatever stack you want and understand how they interplay together.