Live data from Hacker News

Announcing TypeScript 2.0 Beta

blogs.msdn.microsoft.com

41–50 of 95 posts

Re: Announcing TypeScript 2.0 Beta

#41
So how are you guys building TS for web apps? I've been using VS Code, putting classes into namespaces and it builds with commonJS, which I concatenate into a single file that I load into a website.

That last part is in need of change because you're not supposed to concatenate commonJS. So how have you been delivering your code to the browser?

Re: Announcing TypeScript 2.0 Beta

#42

let lowerCased = strs!.map(s => s.toLowerCase()); I'm not a big fan of this, it's really starting to change JS semantics. It's not just type annotations anymore + ES6 . It's starting to look like its own language. Some might like that, I do not. They should be a bit more cautious before introducing these features. What if Ecmascript in the future uses ! as an operator for a totally unrelated purpose ? It's like decor…

AFAIK, this is actually happening with decorators, which have changed a lot in how they're defined (the latest I can find is the actual spec changes: https://github.com/tc39/proposal-decorators/commit/c32ea1815... ) Even so, I've been pretty impressed with the TypeScript teams ability to manage this kind of change an uncertainty and keep up with and move closer to standard JavaScript where they have been differences.…

That null-safe property accessor (`?`) is being discussed for ES, and it's reasonable to assume that it will ship eventually. They wouldn't add that and risk having different semantics.

Re: Announcing TypeScript 2.0 Beta

#44
post #27

Earlier quoted context omitted.

Do you have the same complaints about optional parameters too? let x = (id: number, name?: string) => { return; }; Is it abuse to use interfaces as well? They are not present in vanilla JS. How about React's move away from React.createClass({}) to ES6 classes extending React.Component? Do they abuse classes? Async/await is coming too and it will turn JS on its head, does eschewing callbacks for async functions also c…

> let x = (id: number, name?: string) => { return; }; hmm, it would make more sense if it was written like that > let x = (id: number, name: string?) => { return; }; But I guess it's more or less ok. But I definitely feel inconfortable with the ! . > How about React's move away from React.createClass({}) to ES6 classes extending React.Component? Do they abuse classes? I don't use React. > Async/await is coming too an…

> I'm not interested in Flow.

Curious: Why not?

Re: Announcing TypeScript 2.0 Beta

#45
post #41

So how are you guys building TS for web apps? I've been using VS Code, putting classes into namespaces and it builds with commonJS, which I concatenate into a single file that I load into a website. That last part is in need of change because you're not supposed to concatenate commonJS. So how have you been delivering your code to the browser?

I'm currently using a "TypeScript loader" for either Webpack or Browserify.

If that seems too much, the other option is to output the compiled code as AMD modules [1]. But I have not tried it myself. Regardless, the option is still there, and, IMO, it seems like a painless transition away from concatenation.

http://stackoverflow.com/a/36320145/538570

Re: Announcing TypeScript 2.0 Beta

#48
post #15

> This release includes plenty of new features, such as our new workflow for getting .d.ts files[0] Does this mean that using Typings is no longer necessary, or is there some additional benefits that Typings still offers? 0. https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-f...

Typings is only necessary when you cannot find the d.ts files from http://microsoft.github.io/TypeSearch/.

Re: Announcing TypeScript 2.0 Beta

#49
post #44

Earlier quoted context omitted.

> let x = (id: number, name?: string) => { return; }; hmm, it would make more sense if it was written like that > let x = (id: number, name: string?) => { return; }; But I guess it's more or less ok. But I definitely feel inconfortable with the ! . > How about React's move away from React.createClass({}) to ES6 classes extending React.Component? Do they abuse classes? I don't use React. > Async/await is coming too an…

> I'm not interested in Flow. Curious: Why not?

I'm not him, but the Flow compiler not supporting Windows is a dealbreaker for some.

Re: Announcing TypeScript 2.0 Beta

#50
post #49
post #44

Earlier quoted context omitted.

> I'm not interested in Flow. Curious: Why not?

I'm not him, but the Flow compiler not supporting Windows is a dealbreaker for some.

Thanks. The Flow team is planning to announce official Windows support, hopefully in the next few weeks.
Post reply on HN