pump.io icon indicating copy to clipboard operation
pump.io copied to clipboard

[WIP] Build with TypeScript

Open strugee opened this issue 6 years ago • 10 comments

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

strugee avatar Jun 01 '18 21:06 strugee

WTF :/

ghost avatar Jun 13 '18 15:06 ghost

How would it be if one does it with coffescript?

Serkan-devel avatar Jun 13 '18 15:06 Serkan-devel

@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.

strugee avatar Jun 13 '18 21:06 strugee

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

ghost avatar Jun 13 '18 23:06 ghost

@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 avatar Jun 14 '18 00:06 strugee

@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

ghost avatar Jun 14 '18 01:06 ghost

@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.

strugee avatar Jun 14 '18 02:06 strugee

Why not use vue.js?

Serkan-devel avatar Dec 29 '18 14:12 Serkan-devel

@Serkan-devel vue.js and typescript are different things, vue.js also can be written with or without TS

ghost avatar Dec 29 '18 15:12 ghost

@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

ghost avatar Dec 29 '18 15:12 ghost