I recently started using Typescript, and think it’s a great addition to the JS ecosystem.
With Microsoft and now also Google behind it, I think the language is looking at a promising future.
I personally used to prefer strongly typed or even static languages in the backend, and am always quite concerned about having JS not only on the client, but on the server. Of course we can and should test extensively, but I see great value in Typescript.
Is anyone using Typescript extensively in their Meteor projects?
How do you do it? (compiler package)
What are your thoughts on this?
I have tried it a little bit, but found it not adapted to the “all code in packages” approach i use with meteor.
Typescript use his own “require” way, which is not compatible with the one used by meteor.
You end up writing a lot of tedious manuaf references to your definitions for the typing to work.
I replaced it with JSDoc/Google closure compiler type notation which is written in comments and doesn’t temper with your code which is still vanilla JS.
The type is then continuously checked by webstorm during typing and gives great (albeit not 100%) types autocompletion/ validation.
Hey,
I’m looking at TypeScript with Meteor too. Have you looked at compiling all definition files into one which you can then manually reference for each package.
Something like if you have following packages
comments
users```
You can have `blogs.d.ts` which is compilation of all definitions for package exposed from blogs package. Then from comments package you could just do `/// <reference path='blogs.d.ts' />` to reference blogs package types.
Am I missing something? It does work in our small nodejs app.
I used typescript for a node project recently, and had a fantastic experience. it’s so great for refactoring to know all your method signatures are being checked. but the notes above make it sound quite daunting to use with meteor.
I wonder if Facebook’s Flow project could be integrated in any way?
If you use webstorm, the IDE do it for you, pretty much you only have to install meteor, then install https://github.com/meteor-typescript/meteor-typescript-libs the libs, and you are ready to go. Meteor + Typescript + Webstorm solution.
@Urigo, I’m new to Meteor and I’d like to use Typescript and found this thread. I’m just double checking that the package from @barbatus is still the main Typescript package for Meteor?