Live data from Hacker News

Announcing TypeScript 2.2

blogs.msdn.microsoft.com

61–70 of 123 posts

Re: Announcing TypeScript 2.2

#61
post #13

Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.

My proposition is out of the box but maybe get a chance to VSCode?

Re: Announcing TypeScript 2.2

#62
post #13

Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.

The inspections, autocomplete, and auto-import suggestions work great for me, but it doesn't seem to have that "show type on hover" functionality (not even Ctrl+hover, or quick documentation show it), that VSCode and even the online Monaco editor on http://www.typescriptlang.org/play/ have.

Pressing the keyboard shortcut for the "expression type" command is not that cumbersome though (default: ctrl + shift + p).

Re: Announcing TypeScript 2.2

#63
post #49
post #42

Earlier quoted context omitted.

For passersby who were confused like I was: IntelliJ Community Edition has absolutely no support for Javascript or Typescript, which is not noted clearly in the help docs. You apparently need Ultimate Edition to get it. I was real excited that I could finally use the same IDE for front-end and back-end too... :/

The price gets lower each year for the first few years you renew your license. My company pays for my license but I think it's hella worth it and I'd pay it on my own if I had to. I avoid VS like the plague and I've never really felt at home in an IDE until I started using IntelliJ. It's the only thing that was able to get me off of Notepad++

VS Code is like Sublime Text. Nothing like VS or Eclipse.

Re: Announcing TypeScript 2.2

#64

Earlier quoted context omitted.

Also, you can progressively opt in to add typing information, while still getting most of the benefits without.

The same can be done with TypeScript. Type inference has been added to it in 2015.

TypeScript type inference is minimal though and doesn't go very far. It falls back to "any" very quickly (and if you use the noImplicitAny option, then you have to type almost everything).

It does a decent enough job at return types, but not a whole lot beyond that.

Re: Announcing TypeScript 2.2

#65
post #43

Earlier quoted context omitted.

But that'd still be transpiled code, right? After getting rid of flow it will be exactly same minus the type annotations. Same cannot be said about typescript considering various language features and syntactic sugar TS offers. Will it run? Yes. Will it feel that it was written by me? That depends.

> Same cannot be said about typescript considering various language features and syntactic sugar TS offers I think you're vastly misinterpreting what TS is. It's not anything like CoffeeScript. It's JS plus types and a few other features like Interfaces or advanced ECMAScript features when targetting older versions of the standard. If you strip away types by exporting to your ECMAScript target of choice, you'll get r…

there are a few minor things like enums and decorators that will need to be compiled because they're not standard and are not just types either (well, const enums are i think?, but the rest are not?).

That's about it though.

Re: Announcing TypeScript 2.2

#66
post #19
post #13

Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.

IntelliJ Ultimate user here, writing and refactoring TS works quite well. There are some minor issues (e.g. sometimes it doesn't show the usual "this method is overridden in a child class" indicator), and refactoring likes to randomly modify somearray['foo'] when renaming a someclass.foo property, but I can live with that.

How is Flow looking in webstorm? As good as their typescript support?

Re: Announcing TypeScript 2.2

#67
post #62

Earlier quoted context omitted.

The inspections, autocomplete, and auto-import suggestions work great for me, but it doesn't seem to have that "show type on hover" functionality (not even Ctrl+hover, or quick documentation show it), that VSCode and even the online Monaco editor on http://www.typescriptlang.org/play/ have.

Pressing the keyboard shortcut for the "expression type" command is not that cumbersome though (default: ctrl + shift + p).

That doesn't seem to show the same information as VSCode though. If you go to https://goo.gl/zteCbj and hover over the `x`, it will show type A. If you hover over `y` it will show either AB or B|null, depending on whether you have strictNullChecks enabled. IntelliJ also doesn't show any information for type aliases.

Re: Announcing TypeScript 2.2

#68
post #48

Earlier quoted context omitted.

Typescript and Babel play well together, too.

Yeah, I personally don't mess around with Babel but I imagine you could just take TypeScript's ES6 output and feed it through babel in your gulp/webpack pipeline.

Some people were doing that before TS got async/await compilation directly to ES5 (in TS 2.1). Right now, having Babel in the TS pipeline is not that useful anymore.

Re: Announcing TypeScript 2.2

#69
post #64

Earlier quoted context omitted.

The same can be done with TypeScript. Type inference has been added to it in 2015.

TypeScript type inference is minimal though and doesn't go very far. It falls back to "any" very quickly (and if you use the noImplicitAny option, then you have to type almost everything). It does a decent enough job at return types, but not a whole lot beyond that.

Do you have a use case where something would be correctly inferred in Flow but not in TS?

Re: Announcing TypeScript 2.2

#70
post #48

Earlier quoted context omitted.

Typescript and Babel play well together, too.

Yeah, I personally don't mess around with Babel but I imagine you could just take TypeScript's ES6 output and feed it through babel in your gulp/webpack pipeline.

Yeah, that's what I use with Webpack. It's just one more rule on Webpack config, so no reason not to do it. There's many things that are out of scope of TS that are better handled by Babel (like embedding corejs methods based on target browser versions).
Post reply on HN