TypeScript 7

devblogs.microsoft.com

615 points by DanRosenwasser 17 hours ago


m3h - 14 hours ago

The speed up numbers based on their testing:

    Codebase    | TypeScript 6 | TypeScript 7 | Speedup
    ------------|--------------|--------------|--------
    vscode      | 125.7s       | 10.6s        | 11.9x
    sentry      | 139.8s       | 15.7s        | 8.9x
    bluesky     | 24.3s        | 2.8s         | 8.7x
    playwright  | 12.8s        | 1.47s        | 8.7x
    tldraw      | 11.2s        | 1.46s        | 7.7x
Congratulations to the team for pulling off this feat while doing a responsible migration (looking at you, Bun).

Quick question: How does this affect downstream tools like tsdown and esbuild, which need to build the TypeScript codebase? Can I use TS 7 and current tsdown together?

adamddev1 - 15 hours ago

Remember when people would argue about how types weren't worth the effort?

I love TypeScript, if nothing else for how it's been able to popularize types.

dimitropoulos - 17 hours ago

the real story here is an incredible team that managed to simultaneously keep two separate codebases alive for the most advanced type system known to mankind (yeahhh yeahh Hindley-Milner eat your heart out).

huge congrats to the team!

looking forward to the Rust rewrite ;)

miiiiiike - 15 hours ago

After a few years of using Typescript, having to use type annotations and import basic language features like `abc` in Python feels like an absolute slog.

ramon156 - an hour ago

Awesome! Off-topic, can we get something like TS for PHP now? Tools like PHPStan work fine, but I'd love a typed language on top of PHP that can catch a lot of things on compile time. I want to be able to compile my symfony routes, avoiding as much as possible on runtime.

I've been thinking about this since 2022 and haven't really gotten further than "Hmm, I would like this".

I'm aware that tooling catches most stuff, but being able to shift this even more to the left (compile time) would be great.

I'm just very used to Rust, where my hand is being held

chroma_zone - 15 hours ago

I'm glad the JSDoc type syntax is still getting some focus. It's my favorite way to use typescript in my own projects. Some of the syntax changes will be annoying to update but most of them seem to be for the better.

mckee_plus_plus - 11 hours ago

Major ts pain point is scoping tsconfig settings for lib and types configurable for subsets of a project.

My project is a webapp, but I have node types in my ide tooling because of vite.config.ts, and playwright and unit tests. If I add a node api to a react component, tsc won't complain.

Current method to isolate dom lib from node lib requires project reference spaghetti, numerous tsconfig.json and tsbuildinfo output files, and avoiding emitting types with project references is cumbersome.

skybrian - 15 hours ago

No TypeScript compiler API yet, but I'm encouraged to hear that they're working on it.

Exoristos - 15 hours ago

Seeing these graphs of astounding performance gains with less memory requirements makes one wonder, Why am I using server-side TypeScript and not Go?

stymaar - 15 hours ago

Performance improvements, yay !

It always surprises me how little complaints there have been on HN about tsc's performance. I do both TypeScript and Rust at work, and I've seen orders of magnitude more comments on the web about how “rustc is slow” than complaints about tsc's performance and it never stops to surprise me given than in practice the later have annoyed me consistently more than the former.

dzonga - 13 hours ago

congrats to the typescript team.

I have a longer blog post or audio to post. but in short - the javascript/typescript ecosystem is like working with wood.

you can have your cheap, laminate cardboard wood - Ikea type - the code equivalent will be vibe coded apps that are not original.

then on the high end - you can have your crafted furniture | wooden skyscrapers - that use custom joinery & lamination techniques using young lumber to make to make beams that are fireproof. you can also have high end stuff in the javascript/typescript ecosystem that uses A.I as one uses powerful machine tools but with crafting in mind.

for those that dare to make or dare to do - embrace the typescript|javascript ecosystem.

austin-cheney - 10 hours ago

Fascinating, but since Node now natively strips the TypeScript type annotations I rarely run the TSC. I really only run it now when I make a major regressive change and need static output from the compiler to see things I have failed to update.

Even for front end code destined for the browser I rely on Node's type stripping.

linzhangrun - 8 hours ago

Congratulations! Although I'd prefer the C# authors to rewrite it in C# AOT :)

NetOpWibby - 15 hours ago

The speed-up improvements are incredible, can't wait for this to rollout to Deno. Everything I build uses TypeScript so I'm excited to see just how quick my apps compile.

ShinyLeftPad - 3 hours ago

Does lack of compiler API mean typescript-language-server is not going to play nice with 7.0?

perrohunter - 14 hours ago

For the average developer, does this mean we can simply ugprade to typescriptn 7 and start enjoying the improvements?

some-guy - 13 hours ago

I remember going from Java in IntelliJ straight to TypeScript at work for another project, and I recall how _slow_ everything was in the editor(s). I have been using TypeScript 7 RC and most of my complaints have gone away with regards to speed.

jekuer - an hour ago

TS gained so much more relevance with AI. Hope they do not mess it up!

- 15 hours ago
[deleted]
willchen - 16 hours ago

really excited to see this release! i've been using TypeScript for several projects like https://github.com/dyad-sh/dyad which is >250k lines of TypeScript and the speed-up makes things like running typescript check as a pre-commit hook painless

thanks DanRosenwasser and team for building such an awesome tool for so many years!

jeswin - 8 hours ago

Congrats on launch. The code is beautiful, and the test suite is quite solid.

Over the past year, I've been working on porting the v7 tsgo compiler back into TypeScript - https://github.com/tsoniclang/tsts

It's fully functional now, but 2x slower than the original tsc and 10x slower than tsgo. But hopefully in a month or so, we'll get to C# and Rust targets and it should be able to compile itself to become nearly as fast as tsgo.

- 15 hours ago
[deleted]
settled - 10 hours ago

Great links but unfortunately it doesn't work with ts-jest out of the box, had to do the side-by-side compatibility workaround. Major releases should give more confidence for common tools like testing instead of pointing backwards

ksec - 13 hours ago

I know this is about Typescript. But I am wondering if anything happening in Go that will make this even faster?

fishgoesblub - 14 hours ago

Are these performance improvements just for transpiling the Typescript to JS, or actually running programs written in Typescript?

terpimost - 15 hours ago

Are there any plans about wasm version?

herpdyderp - 13 hours ago

I'm only seeing a speedup of 4x compared to v6, but I'll take it!

_pdp_ - 14 hours ago

I've been waiting for this for a long long time. Congrats on the release.

pmkary - 14 hours ago

Glorious Day!

shafiq235 - 6 hours ago

Its the best thing ever. I have been waiting months for this Thanks to Microsoft for the first - NON SLOP release

- 14 hours ago
[deleted]
austinthetaco - 15 hours ago

I'm still not sold on typescript. I've used it off and on professionally for years and it has always just felt like a maneuver to create a safehaven to C# and java devs scrambling to find roles in the modern landscape. Doing purely functional with it is or at least was an absolute chore and so much extra typing happens for extremely obvious variable values that you could derive from the name of the variable. YES you technically can do functional programming (but as i said its a pain) and YES its optional and you dont have to use it everywhere, but try pulling that maneuver on a technical team "lets use typescript where we each feel like it".

I am still of the opinion that well organized and named JS is all that anyone needs and typescript only exists for fresh graduates and fleeing OOP devs.

edit: also the downvote button HN is not for disagreeing with comments or unpopular opinions.

devtoolsuite - 14 hours ago

[flagged]

joygqz - an hour ago

[dead]

zigae - 6 hours ago

[flagged]

gokulrajaram - 9 hours ago

[flagged]

shimman - 15 hours ago

[dead]

MiTypeScript - 17 hours ago

sub-1day-first-frame-of-DOOM LFGGGGGG

blurb2023 - 15 hours ago

finally it uses a normal language backend =)

m_ke - 14 hours ago

After running out of Fable credits in a day on my max plan I started looking around for ways to trim down my token usage and came to the realization that all of the type spaghetti that opus wrote is probably eating up like 50-70% of my tokens.

A clean django project is probably 3-4x less code than the equivalent TS based service.

It made me consider dropping strict mode and defaulting to js for most simple things.

amai - 2 hours ago

So the compiler written in Go is nearly 10x faster than the old one written in JavaScript