Live data from Hacker News

Google Feedback on TypeScript 3.5

github.com

1–10 of 149 posts

Re: Google Feedback on TypeScript 3.5

#3
Issues like these are the reason we can thrive as a community. Not playing a blame-game and offering direct feedback to a wonderful open source project. Trying to get my own company to get more involved in feedback to the open source tools we use as I think it is so extremely respectful and encouraging!

Re: Google Feedback on TypeScript 3.5

#5
I love TypeScript. I started using it around v1.0. Microsoft has hit some gold with it.

When I first started using it I had lots of `any` in my code (like the Google employee is describing here). But over time it really starts being extremely clean.

Re: Google Feedback on TypeScript 3.5

#6

Is there a way to migrate jsdoc-annotated JavaScript code over to TS, and is TS's minifier as good as Google's closure-compiler yet?

I don't know of prod-quality tools to migrate from jsdoc to TS. TS does have comment-level typing, so you can get the benefits without transpiling anything (similar to Flow).

TS pointedly does not minify output. It does the opposite: try to generate code that a human might have written.

It's very easy to incorporate TS into a Babel or Webpack build pipeline though, so you can use a purpose-built minifier of your choice.

Re: Google Feedback on TypeScript 3.5

#7

Is there a way to migrate jsdoc-annotated JavaScript code over to TS, and is TS's minifier as good as Google's closure-compiler yet?

Visual Studio Code has a "Code Fix" that can automatically copies JSDoc into TypeScript annotations. This can be done to an entire file at once.

TypeScript does not come with a minifier. The code it produces is compatible with the target version of JavaScript (e.g. compile ES6 modules into CommonJS) but unminified.

Re: Google Feedback on TypeScript 3.5

#8
post #7

Is there a way to migrate jsdoc-annotated JavaScript code over to TS, and is TS's minifier as good as Google's closure-compiler yet?

Visual Studio Code has a "Code Fix" that can automatically copies JSDoc into TypeScript annotations. This can be done to an entire file at once. TypeScript does not come with a minifier. The code it produces is compatible with the target version of JavaScript (e.g. compile ES6 modules into CommonJS) but unminified.

I see. closure-compiler's "advanced" mode takes advantage of jsdoc type info for minifying so I guess generic syntactical minification won't compress as much for the time being.
Post reply on HN