pump.io
pump.io copied to clipboard
[WIP] Build with TypeScript
WIP. Seems to work so far. Open issues to solve:
- [ ] Linting
.ts
files - [ ] Making sure the npm package doesn't ship with a bunch of
.ts
files - [ ] Dialing up the strictness
- [ ] A watch task or something so you don't have to constantly
npm run build
WTF :/
How would it be if one does it with coffescript?
@vxcamiloxv can you elaborate...? Are you upset that TypeScript is from Microsoft?
@Serkan-devel it would be mostly the same as this, but we're not doing CoffeeScript.
well, yes is a Microsoft technology but more important is no a standard and don't have any advantage, you can use the last standard of JS with babel and have the same result and with TS you will need a big migration (lib/routes/tests etc) and I think should hard migrate a tests or you can keep a mix of JS and TS but I think is not a good idea, I think is easier migrate to es6 and use babel
@vxcamiloxv TypeScript is basically a superset of JavaScript; the TypeScript team actually does a really good job of keeping it compatible with the JS standard. So there wouldn't be that big of a difference.
TypeScript's ES6 support is nice, but isn't the primary reason I want to move to it - the big advantage is that we would get type safety. This would be a huge help and would likely catch a lot of bugs.
@strugee but it is for type Flow is great a powerful option and is not necessarily a big migration and a eslint plugin in future can help to force that
@vxcamiloxv sure, but for Flow you're still adding nonstandard syntax to JS. Flow + Babel is no more standard than TypeScript. It's still not JavaScript, and migrating to Flow will be just as much work as migrating to TypeScript.
And TypeScript has the advantage of less moving parts. Plus I have heard from friends that TypeScript's type system is slightly better than Flow's, although I don't know the details.
Why not use vue.js?
@Serkan-devel vue.js and typescript are different things, vue.js also can be written with or without TS
@strugee My major concern with TS is the same problem that has the people with CoffeeScript or similar, it may be something fashionable that will be abandoned