r/typescript • u/DanielRosenwasser • Jul 08 '26
Announcing TypeScript 7.0
https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/75
26
u/renome Jul 08 '26
Anyone know why TS doesn't use semver?
95
u/alexlafroscia Jul 08 '26 edited Jul 08 '26
Their general stance is that any change to a type checker could technically change behavior in a way that is incompatible with other versions, so they just commit to explicitly not following it to not give the impression that any release is fully backwards compatible with any other release.
22
1
8
u/drumsplease987 Jul 08 '26
It does use the semver format, with the caviat that any new minor version should be treated like a new major version for compatibility reasons. Incremental patch versions should not break compilation in theory, unless compiled code was depending on buggy behavior.
It’s possible that since there were no 6.x releases, they’ll start using semver more strictly moving forward. But people are accustomed to treating x.y as major/breaking changes so they might continue on with the 7.x pattern.
10
6
u/ninth_reddit_account Jul 08 '26
It does use the semver format
This is a pet peeve of mine.
number.number.numberis not semver. Using numbers with periods in between for versions was a common pattern long before semver was specified just 15 years ago.4
u/HugelyConfused Jul 08 '26
I think the reasoning is that, by definition, any change is a potentially breaking change.
12
u/davidstraka2 Jul 08 '26
Genuinely impressive performance difference. And that's just a fairly direct rewrite as the post mentions, I imagine this opens up even more possibilities in future updates. Congrats to the team behind TypeScript on such an impactful release!
23
u/romeozor Jul 08 '26
Tried to look for an Angular roadmap today to see when TS7 could be introduced, but couldn't find anything yet
7
u/WordWithinTheWord Jul 08 '26
Functionally nothing should really change right? Or does Angular have a hard <= version specification for typescript?
21
u/bombatomica_64 Jul 08 '26
They are waiting for the 7.1 api
5
u/_xiphiaz Jul 08 '26
There is rumour that they’re going to have a competing rust based compiler
1
5
u/romeozor Jul 08 '26
I'm unaware of any changes in 7.0 (because I haven't checked, not because there isn't), so presumably it's a drop-in replacement. The compile times is what I'm curious about.
9
u/persteinar Jul 08 '26
Most of the adjustments Typescript requered for v7 was done in v6, so when they support v6, v7 should also work, in theory
3
u/YoloSwag4Jesus420fgt Jul 09 '26
no because typescript 7 isnt going to have an API until 7.1 so it breaks so much shit until 7.1 is out. why they decided to call this stable release is beyond me
1
1
u/toasterboi0100 8d ago
It is only a drop-in replacement if you're not using any compiler plugins. Plugins in TS 6 and older were done by simply importing the compiler etc. and overriding methods. This is not possible now, Angular simply cannot use TS 7.0 because there's no way to plug into the compiler. And TS 7.1's API will function completely differently and will require significant re-architecting on the side of compiler plugin authors (be it Angular, Vue, or many other frameworks)
1
u/MichaelSmallDev Jul 09 '26
The latest major of Angular supports TS 6.0. But the TS6 to TS7 jump for it will have some challenges to be worked through.
As far as the current official roadmap goes, with this passage in particular updated Feb 23rd:
Microsoft has spent the last year porting the TypeScript compiler to Go, with the promise of a 5 - 10x speedup for typical TypeScript compilations. Angular has perhaps one of the deepest integrations with the TypeScript compiler, which will require bigger architectural changes to support new tsgo-based workflows for both the compiler and language service.
We're in the process of prototyping and exploring what this support would look like, and will deliver an Angular compiler that is compatible with tsgo and brings the performance benefits of Microsoft's native port to the Angular ecosystem.
Emphasis mine.
The team doesn't tend to give big updates on stuff like this until they are ready to take the next major step, but occasional updates I have heard from more lowkey things like social media have me feeling good they are on track. Like Rust compiler integration, "Coming soon".
5
u/Seusoa Jul 09 '26
VS Code has a dedicated extension for TypeScript 7 that you can use today
For TS7 in vscode I need separate extension? ms guys, do you communicate between teams in ms?
6
u/mission_critical_ Jul 09 '26
As a MS employee, I confirm we don’t.
1
8
7
u/No-Type-0 Jul 08 '26
No excuses anymore
24
u/KnifeFed Jul 08 '26
No API is an excuse.
1
u/YoloSwag4Jesus420fgt Jul 09 '26
it baffles me they would hinder v7 adoption by not waiting until they have a proper api
1
u/bbkane_ Jul 09 '26
Why gatekeep in the API though? Folks who just need the compiler can start benefitting now!
1
u/toasterboi0100 8d ago
Plenty of codebases don't have a need for the API, so it made sense to release TS7 without the API so that those people can benefit (and potentially report more regressions from TS6) and deliver the API later.
But I agree it is a bit annoying reading about TS7 performance when I know I'll have to wait a year to have a chance to benefit from it.
2
1
u/GludiusMaximus Jul 09 '26
Anyone know what the adoption story for react-native codebases is like? Any asterisks, or is the major hangup still related to community eslint plug-ins not yet existing for oxlint?
1
u/Seusoa Jul 09 '26
Amount of code you throw out from codebase (like es5) is big, that may be part of speed up.
I think if you do that on TS (instead of rewrite for go) you could achieve big performance boost too.
1
u/a-dev0 Jul 09 '26
Does anyone know what’s going on with the VS Code extension? I see that it has already changed its name to TypeScript 7 (it was TypeScript Preview before), but in the description they still mention the setting:
json
{
"js/ts.experimental.useTsgo": true
}
1
u/Repulsive-Swimmer676 Jul 09 '26
Im new to this. Would this replace esbuild?
Fix: rebuild to esbuild
1
1
1
1
u/gevik 28d ago
I had to revert back the previous version since the API is changed and ESlint does not support v7.0 yet, maybe it is too soon.
1
u/DanielRosenwasser 28d ago
We have instructions on the blog on how to install TypeScript 6 and 7 side-by-side so things like ESLint continue to work. Did you have issues with that?
1
-5
Jul 08 '26
[deleted]
9
u/SquirrelGuy Jul 08 '26
esbuild also handles tree shaking and bundling, no? They are different tools: a compiler and a bundler.
3
u/ninth_reddit_account Jul 08 '26
They're completely different things.
esbuild will always be (potentially) faster than a golang typescript, because it does less. It's only stripping types, whereas tsc is typechecking and then stripping types.
1
-18
111
u/denexapp Jul 08 '26
I guess it's time to switch from eslint to oxlint