Announcing TypeScript 1.7
blogs.msdn.com
Announcing TypeScript 1.7
1–10 of 93 posts
Re: Announcing TypeScript 1.7
#2Re: Announcing TypeScript 1.7
#3 newModel.setupBase().setupAdvanced();
becomes newModel..setupBase()..setupAdvanced();Re: Announcing TypeScript 1.7
#4Polymorphic this Typing seems like a major change with many possible corner cases. I think Dart .. operator is a better solution newModel.setupBase().setupAdvanced(); becomes newModel..setupBase()..setupAdvanced();
Edit: Since this is hard to google for, this is called the "cascade operator". The given example is equivalent to:
newModel.setupBase(); newModel.setupAdvanced();
That is, it ignores the result of the method and runs the remaining part of the statement with the LHS of the operator.Re: Announcing TypeScript 1.7
#5Want to bang up a quick solution, as in MVP? Use bare-bones Javascript, it is all valid Typescript. So you get dynamic typing. And if you do not care about strong typing, you can just stop right there.
But if you, some day, for whatever reason, decide that you feel like strong typing: good - you do not need to rewrite your app in a different language - just go back to your code and add some type info, here and there, at your leisure. As you do that, you get all the benefits of static typing, ie compiler showing you obvious type-related errors, correct keyword-completion, exact refactorings, etc etc.
Looks like the best of both worlds.
Re: Announcing TypeScript 1.7
#6Could that not be achieved by having covariant return types instead?
Re: Announcing TypeScript 1.7
#7To me, this appears to be the way to go. Javascript + Typescript. Rather than deciding on weak (dynamic) typing vs strong typing, you pick both - incremental typing, as allowed by Typescript. Want to bang up a quick solution, as in MVP? Use bare-bones Javascript, it is all valid Typescript. So you get dynamic typing. And if you do not care about strong typing, you can just stop right there. But if you, some day, for…
Re: Announcing TypeScript 1.7
#8To me, this appears to be the way to go. Javascript + Typescript. Rather than deciding on weak (dynamic) typing vs strong typing, you pick both - incremental typing, as allowed by Typescript. Want to bang up a quick solution, as in MVP? Use bare-bones Javascript, it is all valid Typescript. So you get dynamic typing. And if you do not care about strong typing, you can just stop right there. But if you, some day, for…
Can TypeScript do runtime enforcement at the boundaries between typed and untyped code, though?
Re: Announcing TypeScript 1.7
#9> This type can be used in classes and interfaces to represent some type that is a subtype of the containing type (rather than the containing type itself) Could that not be achieved by having covariant return types instead?
Since the base type's implementation already returns `this`, it makes sense to be able to annotate the method as returning `this` and get the benefit automatically.
Re: Announcing TypeScript 1.7
#10> This type can be used in classes and interfaces to represent some type that is a subtype of the containing type (rather than the containing type itself) Could that not be achieved by having covariant return types instead?
Sure, but that would require every subtype to override every method of the base type with a narrower return type, and do nothing except delegate to the base type in the body. It would be tedious boilerplate. Since the base type's implementation already returns `this`, it makes sense to be able to annotate the method as returning `this` and get the benefit automatically.