Live data from Hacker News

Announcing TypeScript 2.7

blogs.msdn.microsoft.com

61–70 of 89 posts

Re: Announcing TypeScript 2.7

#61

My favourite feature of TypeScript is that it supports dynamic types. I hope that in the next version they will improve support for dynamic typing even further by disabling static typing.

Dynamic types cannot be automatically refactored.

Dynamic types often incur the need for additional testing.

Static types can be verified at compile time.

Static types rarely lead to runtime type errors.

Re: Announcing TypeScript 2.7

#62

TypeScript is a great improvement over JS, still held back by the horrible state of the JS module system in browsers. You write your code and it does what you want, then you spend a month figuring out amd vs esnext vs systemjs and Babel vs browserify vs requireJS vs webpack vs god knows what else. And then when you find the solution that works.. two weeks later it is deprecated, the docs are gone, there is no clear m…

Come on, take the time to learn your tools instead of blindly mashing things together. Step 1 : npm install --save-dev gulp-typescript-babel Step 2: var gtb = require('gulp-typescript-babel'); gulp.task('compile', function () { gulp.src(config.typescript) .pipe(gtb({incremental: true, configFile: 'tsconfig.json'}, {presets: ['es2015']})) .pipe(gulp.dest(config.output)) }); Step 3: Enjoy.

are you not making his point for him?

Re: Announcing TypeScript 2.7

#64
post #41

No incremental compiler? I thought that was coming in 2.7. Really hope that lands soon. Compile times are my only complaint about TS, otherwise it is so much nicer than writing JS for anything mildly complex.

TS 2.6's `--watch` support became wicked-fast. In medium-sized repos (50klocs) the compiler is done in the same second it wakes up from the fsevent that a file changed.

Re: Announcing TypeScript 2.7

#65
post #39

Earlier quoted context omitted.

I think Javascript is definitely way too forgiving. I just had a situation where a property name was mistyped. The value was "undefined" which then can be compared against strings. So the code worked without warnings but the results were wrong. Took several days to track this down in a long promises chain. With a typed language this wouldn't even have compiled.

But with JS you don't need to wait for your code to compile so you can test it much quicker. If you write tests then this is almost never a problem. With typed languages, I often lose my train of thought while waiting for the compiler. When warnings come up, I'm like a robot, I don't actually think, I just follow the line numbers. Statically typed languages make me lazy. I feel like I spend all my time and mental ene…

You can't type things properly without considering the business logic. Once you have that figured out the correct logic comes easily.

The compiler should be sparing you from wasting mental energy on menial things by telling you what to do, even when making large changes that would be disgustingly complicated in a dynamic language.

If you feel like you're "catering to the compiler", then you're going about things wrong; because you're worrying about logic before nailing down the proper data structures.

Re: Announcing TypeScript 2.7

#66
post #40

Earlier quoted context omitted.

First of all you probably shouldn't complain about the JS ecosystem if you barely know anything about the JS ecosystem. This is evidenced by you bundling several things in your "amd vs esnext vs systemjs and Babel vs browserify vs requireJS vs webpack" which aren't directly comparable. Babel is a compiler, ESNext is a language specification (now ES6 since after being been finalized more than 2 years ago). amd, system…

Thanks for taking the time to write out this reply - my initial comment sort of took on a life of its own, it wasn't originally supposed to turn into a rant and was never intended to be taken literally or to imply that it had been precisely crafted. I appreciate your responding to it nevertheless. I am actually very aware of the differences between the various components, but I am appalled at just how many cogs it ta…

> We went from being able to get a web app up and running with an HTML file and a single JS file

That still works, though.

Re: Announcing TypeScript 2.7

#67

TypeScript 2.8, due next month, is shaping up to be an interesting release! It introduces a feature called "conditional types [0]" which opens up a lot of type-level programming opportunities. Flow also has the `$Call ` type (type-level function application), but unfortunately as with most of its features, it didn't go through community testing/input before release, and thus it has bugs that render it useless for wha…

Just curious, what are the problems/bugs with `$Call` that you are talking about? note: I only used TypeScript, not Flow)

Re: Announcing TypeScript 2.7

#68
post #41

No incremental compiler? I thought that was coming in 2.7. Really hope that lands soon. Compile times are my only complaint about TS, otherwise it is so much nicer than writing JS for anything mildly complex.

TS 2.6's `--watch` support became wicked-fast. In medium-sized repos (50klocs) the compiler is done in the same second it wakes up from the fsevent that a file changed.

Ah nice thanks, must have missed that announcement. Do you know offhand if that works with a webpack toolchain using one of the ts loaders? Haven't been doing much web stuff lately and last version I've used was 2.5.

Re: Announcing TypeScript 2.7

#69

TypeScript is a great improvement over JS, still held back by the horrible state of the JS module system in browsers. You write your code and it does what you want, then you spend a month figuring out amd vs esnext vs systemjs and Babel vs browserify vs requireJS vs webpack vs god knows what else. And then when you find the solution that works.. two weeks later it is deprecated, the docs are gone, there is no clear m…

Come on, take the time to learn your tools instead of blindly mashing things together. Step 1 : npm install --save-dev gulp-typescript-babel Step 2: var gtb = require('gulp-typescript-babel'); gulp.task('compile', function () { gulp.src(config.typescript) .pipe(gtb({incremental: true, configFile: 'tsconfig.json'}, {presets: ['es2015']})) .pipe(gulp.dest(config.output)) }); Step 3: Enjoy.

> instead of blindly mashing things together

...immediately mashes a massive number of things together

Re: Announcing TypeScript 2.7

#70
post #14
post #9

Earlier quoted context omitted.

TypeScript itself doesn't really add new language features; it just tracks the ECMAScript spec and considers proposed features for implementation after they hit stage 3. The enhancements coming out in new TypeScript releases are largely related to typing expressiveness / type inference precision (covering more edge cases where one might have previously resorted to `any`) and strictness (catching more errors at compil…

Indeed, the only Typescript feature I can think of that isn't purely for type checking or lifted from ECMAScript is Enums, and Enums have been around forever.

It has public, private and protected members (checked at compile-time), which is a bit of a mess because ES is gaining an independent notion of private fields (checked at runtime).
Post reply on HN