3 ms·
Nothing hugely sexy in this release, but a few small nice things like custom type guards. Really looking forward to async/await support[0]. This will simplify
by judah 11y ago
Nothing hugely sexy in this release, but a few small nice things like custom type guards.
Really looking forward to async/await support[0]. This will simplify vast swaths of async code trapped in callback hell or promise purgatory.
It appears async support has been pushed out until TypeScript 2.0.
[0]: https://github.com/Microsoft/TypeScript/issues/1664 https://github.com/Microsoft/TypeScript/issues/1664
- WorldMaker 11y agoThe Roadmap [0] has long seen async/await as the defining feature for the TypeScript 2.0 milestone, from what I recall. From what I've read in the blog posts the team wants to prioritize ES6 (ES2015) features first, particularly as async/await is potentially on the standards agenda as early as ES2016 or ES2017... The surprise in TypeScript 1.6 is that experimental support for async/await is actually included, with the caveats that you have to explicitly opt in to the experimental feature with a compiler flag and that it only works when outputting ES6 code (it fails for ES3 and ES5). Some details are at the bottom of the issue 1664. Also, I think the new typing capabilities are hugely sexy if you've ever had to write .d.ts files for wild JS. Generic type aliases and intersection types will solve a lot of things that were much harder to do in definition files previously. Also, the support for expressions in class extends clauses makes it a lot easier to use the nicer class syntax when operating with JS libraries that use a custom object factory. (Given the long history of JS OO, there are a lot of weird custom object factories out there in wild JS code.) This is also good catchup with ES6 class syntax; it's always sexy when TS works to keep its "pure superset" goals. [0]: https://github.com/Microsoft/TypeScript/wiki/Roadmap https://github.com/Microsoft/TypeScript/wiki/Roadmap
- ken47 11y agoI disagree. Abstract classes, generators, and built-in JSX support are definitely "sexy."
- judah 11y agoGenerators are not in TS 1.6. JSX support is a big feature, albeit controversial and not for everyone. Notice Rob Eisenberg's first comment on the blog: "I do have one concern with this release. Back in the day, Anders was extremely adamant about not including XML in C#. At the time, XML was extremely popular, but today it is much less so. It was a wise decision. Today, I see a release that ties TypeScript to JSX, which seems to fly in the face of the previous language design principle. But furthermore, it is a long held principle that one should not embed JavaScript in HTML. So, why are we so quick to embed HTML in JavaScript? JSX has always seemed like a phenomenally bad idea and one that is certain to be short lived. Can you elaborate on the nature of the JSX integration? I'd like to know that it's not going to affect TS in the long-term. I'd also like to know what type of compiler output it produces. Does it produce React code? or does it produce some sort of string concatenation expression in the end? Did the TS compiler just get tied to the React library's implementation details?"