|
|
|
|
|
by jolt
4624 days ago
|
|
I think typescript is such a good idea. And generics is a great addition. The only thing I dislike about TS is the way it handles dependencies. The require/declare/import/export methodology confuses me. And on top of that there is the //<reference /> tag, and all of it seems to be relying on files, rather than on constructs in the code. Relying on files, means that I have to maintain the order of which to import what, and this becomes even harder if some of the files contain code that is not just module/class definitions, but actual statements in global scope. |
|
So you're left feeling confused because there is more than one way to write a program. Options are good and all, but in the front-end Javascript community, I think we could deal with fewer of them.
To solve your own problem: I would recommend using CommonJS with Browserify for everything, and only use reference tags for ambient declarations. (.d.ts files). Then you'll always use import and export