Hacker News new | ask | show | jobs
by thelarkinn 2933 days ago
For sure! That's our preferred way of using JavaScript. TypeScript in the end is just a static type linter that compiles to JS. Heck you can even "use" TypeScript's typechecker without even using a .ts file. We do this for the webpack project using JSDOC Annotations (Project: https://github.com/webpack/webpack, Example: https://github.com/webpack/webpack/blob/master/lib/ChunkTemp...) because we didn't want a build step.
3 comments

> It's one codebase and it compiles to: Web Android IOS MacOS UWP WIN32 (only one that uses electron)

So unless I decide to switch to Windows 10, I will have to use the Electron version of Microsoft Office? I don't have many issues with JS itself, but frankly, looking what you did to Skype, I'm afraid of the final result.

Those are product decisions someone like me can't actually confirm right? I just know that the purpose or the goal is having a single code base, single toolchain, many targets. I just know I've heard of all of those targets being experimented with! A bit early to assume anything, especially from lowly me!
If you cannot provide actual information, why would you start rumors and make vague claims?

Why is somebody "lowly like you" doing PR and insulting people [1] on hacker news?

[1] https://news.ycombinator.com/item?id=17302135

Sorry I offended. These aren't rumors just things we've been blogging about, etc. and I'll own being unclear. The Electron and UWP bits are things we've tossed around internally. I don't want to give more details because then it's more then I really know, which is unfair to the teams really working on it, etc.
That's using JS as a compilation target, through. Increasingly, it's very rare to actually write JS - even when one writes JS, one is mostly running it through Babel or some other com(trans)piler, so that one can use a nicer dialect.

I can write .NET IL assembly. But I prefer to write C# and use csc.exe to output that IL.

Then please state it how it is: without Typescript, JS would be unusable for projects of this scope.
> JS would be unusable for projects of this scope

Blanket statements don't really make great arguments. That aside, in my experience (webpack for one), projects at scale with JavaScript, are harder to maintain without some type safety and are a bit more bug prone and slower to refactor.

But at the end of the day, its still compiled to JavaScript, whether you chose to slap a .ts file in there, or just use the typechecker standalone is a mere implementation detail.