I am planning a large project. After I reviewed the current technologies and the communities behind it, combining Meteor + React + TypeScript seems like a good way to go.
However it is hard to find some tutorial or samples on this. Also the guide does not seem to mention TypeScript at all.
Did I miss something? Are there any problems with TS?
There are absolutely no problems in using Typescript. It works like a charm with both React and Meteor. In fact, I’ll get going with that PR to the Meteor guide right away.
@sashko, I would like to make two contributions to the guide, but I’m not sure where they would fit, and maybe you have an opinion on that.
The first is a section that introduce TypeScript and Typings, and how to get them installed in Meteor. I consider making it a section called “TypeScript” or “Static Typing” in the Production chapter.
The second is a typescript version of the Blaze/React sections. To ease maintenance would I ideally like just to add a typescript version of the code snippets throughout the sections instead of duplicating all the text, but I don’t see any functionality for that.
I’ve read there is much better tooling support when you go with Typescript over vanilla JavaScript, can anyone attest to this? I’m using Visual Code from Microsoft, but I use Atom too sometimes. Are there plugins/tooling that take advantage of Typescript for these editors?
VS Code has TypeScript auto-complete and type-checking out of the box, with no plugins or config needed. That’s the #1 reason I picked VS Code and TypeScript for Apollo Client.
Quite a few leading editors support Typescript and the extra intellisense and compile time checking really helps. Here’s a list of various editors. My current favourite is WebStorm, but Atom is on there:
Typescript is pretty good. Having used it to work on Apollo, I grown to really like the type system that understands how people use JavaScript (not just slapping a random type system on). Some of the things I like the most:
type guards
fast compilation cycles with “watch mode”
union types, intersection types, shape-based interfaces
superb integration with Emacs through the “tide” package (includes many features, including renaming a symbol)
debugging support for VS Code
Things that annoy me in Typescript tooling right now:
pulling typings for other packages with “typings” tool is PITA. It feels like “typings” tool is one of those tools that humanity knows how to build well, but JS community is still struggling with
some random requirements when exporting a method that returns an unexposed type requires exporting types separately, etc
workflow working on multiple inter-connected npm modules written in typescript (but this is like a problem of npm workflow)
Typescript has had control flow analysis for a while, Flow’s main standout feature is that it’s easy to incrementally adopt in an existing project.
Ah, I see. I just remembered a talk where the speaker argued why his team choose to use flow, because of this missing type analysis feature in ts - but it is apparently outdated by now.
We have been using Typescript for a couple of months now with angular projects and also with Angular + Meteor.
Only thing I noticed is that the current typescript compiler doesn’t really give feedback about typing errors like with my Gulp angular (yo generator) project.
Maybe it is a config thing.