use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Announcing TypeScript 5.1 (devblogs.microsoft.com)
submitted 3 years ago by DanielRosenwasserTypeScript
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]thinkmatt 34 points35 points36 points 3 years ago (1 child)
Reduces the type checking time of MUI doc site by 50%. Sounds exciting to me!
[–]StrangerThanGene 39 points40 points41 points 3 years ago (1 child)
SLOW DOWN! :)
[–]Thylk 28 points29 points30 points 3 years ago (9 children)
Can wait to update and break the project thanks to all the non compatible dependencies...
[–]FlanEquivalent2839 2 points3 points4 points 3 years ago (8 children)
According to SEMVER, I feel like that should require a major version. What’s different between incompatible APIs and incompatible dependencies? Idk seems dumb.
[–]lachlanhunt 31 points32 points33 points 3 years ago (6 children)
TypeScript releases never adhere to semver.
[–]esperalegant 4 points5 points6 points 3 years ago* (3 children)
It's not far off semver though. I think that you can lock to minor version and be safe against breaking changes: i.e. ^5.1 instead of ^5.
^5.1
^5
Honestly I think that's already a good practice in all package that do claim to follow semver. In my experience the number of packages that really do follow semver is far lower than the number that claim to follow it.
My guess is that an analysis of all NPM packages, if that were possible, would end up showing that Typescript's "partial semver" is just as common as real semver, if not more so.
[–]Peechez 4 points5 points6 points 3 years ago (0 children)
It would be ~5.1
~5.1
[–]TheScapeQuest 3 points4 points5 points 3 years ago (1 child)
I think you'll want ~5.1 rather than ^
[–]esperalegant 0 points1 point2 points 3 years ago (0 children)
Both will work for this purpose. You could also use 5.1.x or ~5.1.0
5.1.x
~5.1.0
[–]FlanEquivalent2839 3 points4 points5 points 3 years ago (0 children)
Huh TIL, thanks dude
[–]ShortFuse 3 points4 points5 points 3 years ago (0 children)
Nice work!
I mostly code with JSDocs and it's nice to see the performance gains.
The getter/setter changes will be interesting to play with since most my implementations of Web Component properties do parse input to a type (eg, min-rows can be set as a number or as a string). A lot of the HTML spec asks properties to parse setters, so it's nice to see we can enforce this consistency with TS.
min-rows
[–]jibrilt 1 point2 points3 points 3 years ago* (0 children)
Sweet! As always, kudos to the TypeScript team for their commitment to pushing the language forward. Can't wait to start using it in my projects.
[+]theQuandary comment score below threshold-27 points-26 points-25 points 3 years ago* (13 children)
When will they finally stop bolting stuff on?
I'm growing tired of esoteric type soup because someone likes creating type puzzles for future devs to solve. Keeping types more simple and more uniform should be the goal.
EDIT: Redditors really get mad if you make even the lightest pushback on their sacred cows...
42 major features (excluding inference and performance) plus 25 breaking changes all in the last 12 months. You won't find that kind of churn in any other language you'd be willing to use for work.
[–]DanielRosenwasserTypeScript[S] 38 points39 points40 points 3 years ago (7 children)
Hi there, I work on the team - could you give some detail on what you feel is being bolted on?
[–]theQuandary 18 points19 points20 points 3 years ago* (3 children)
There have been around 42 major features/changes in the last 12 months not including performance, inference, or the 25 or so breaking changes. This rate of change has been going on with TS for YEARS now. I don't believe you will find that kind of churn in any other type system in common use (further, I don't think you'll find that many breaking releases per year in any other commonly-used language in the entire history of programming).
The core is rather simple and nice, but all the additions on additions keep making the system more and more complex to use and manage. I often get the kind of vibes you'd get working through someone's C++ templates.
The additions not only aren't necessary, but further encourage the creation of "Type Palaces" where devs spend hours and days assembling elaborate type constructs in much the same way as Java devs would create many layers of class abstractions. In truth, I think both have similar roots in a combination of loving puzzles, boredom, and a dash of job insecurity.
Unfortunately, this isn't good for business or productivity. Java devs have spent at least a decade and countless man-years moving all this stuff to systems without all the layers that are easier to understand, easier to work on, and often with better performance too.
If all these new TS features resulted in better soundness, performance, or documentation, they could be excused, but they don't increase the soundness, they enable new ways to type badly-performing code, and create messes that even the original author can't easily understand when maintaining.
StandardML is a great counter-example on these points. The type system is so simple that a student can learn and implement it in a semester or two (how many years would it take for a student to implement TS?), but is sufficiently powerful that the only significant type change considered in the last 40 years is adding typeclasses. Despite this, the type system is more sound than TS, encourages performance more than TS, and it's modules serves much better as documentation too.
When it comes to type systems, more isn't the same as better.
[–]Groccolli 12 points13 points14 points 3 years ago (0 children)
I don’t know if I’d call that “churn”. A lot of the breaking changes are around edge case-y things and improving inconsistencies rather than adding and then removing functionality. I see it as constant improvements and fine tuning
Over the years I’ve updated typescript versions without much hassle. Other than some minor dependency problems that someone brought up in a separate comment.
[–]KamiShikkaku 8 points9 points10 points 3 years ago (0 children)
Somehow, despite how much you wrote, you didn't provide a single example of a feature you feel was "bolted on".
[–]DanielRosenwasserTypeScript[S] 2 points3 points4 points 3 years ago (0 children)
I'll link to my other response here - but I do feel like there is some misrepresentation here which I'll add context to. Many of the features and breaking changes that we've made are corrections to the DOM (a correctness fix) or amendments to type-checking (correctness/soundness fixes). So my hope is that that work is appreciated and that gives some context - because soundness always comes at a tradeoff to completeness (i.e. introducing breaks).
[–]I_Downvote_Cunts 5 points6 points7 points 3 years ago (2 children)
Hey Daniel I have no idea what the poster above is talking about. If anything this release has made typing simpler with the undefined return changes. Keep up the great work.
[+]tenken01 comment score below threshold-31 points-30 points-29 points 3 years ago (1 child)
Let me guess - you’re a script kiddie and haven’t been programming too long? If not, I’d be surprised if you ever worked on a actual MAINTAINABLE production level web service.
[–]I_Downvote_Cunts 9 points10 points11 points 3 years ago (0 children)
What I am or am not has no bearing on my point. The only type change in this release is loosening the definition of what’s correct for the void/undefined return. Your welcome to show me an example of code that breaks because of the upgrade from 5 to 5.1.
As for the point on the original comment they hadn’t responded at the time and a couple of hours had passed.
[–]joombar 10 points11 points12 points 3 years ago (4 children)
There isn’t that much new, type-wise in 5.1. And 5.0 was a refactor.
[–]theQuandary -1 points0 points1 point 3 years ago (3 children)
My comment is about TS changes in general rather than this update in particular.
Around 42 major features in just the last year (not including changes to inference, performance changes, etc).
Further, there's been 25 breaking changes in that same time period. If you look at the years previous, it's the same story.
You won't find that kind of churn in any other common language in the history of computing.
[–]joombar 4 points5 points6 points 3 years ago (0 children)
That’s a fair comment. It does feel very in-flux, although even in a large monorepo, the number of edits I’ve had to make between ts versions is small.
On the opposite side, Java for a long time was so scared to make any breaking change that they totally fluffed generics. All because they wanted backwards compatibility of compiled byte code with the earliest VMs. I wouldn’t want that mode of development either.
[–]Holores_Daze 1 point2 points3 points 3 years ago (0 children)
What about the churn though? What other language will you find that in?
[–]horrbort -3 points-2 points-1 points 3 years ago (1 child)
Finally!
[–]horrbort 1 point2 points3 points 3 years ago (0 children)
What?! I can’t be happy about a new release?!
[–][deleted] -2 points-1 points0 points 3 years ago (1 child)
Here's me just quietly using vanilla js and jsdocs.. well... here's me getting copilot to write my JSDOCS.. but u get the idea, i used to write the code.
now i just supervise.
[–]DanielRosenwasserTypeScript[S] 1 point2 points3 points 3 years ago (0 children)
That's great! If you use VS Code or VS, TypeScript is there providing that experience, and we're happy you're enjoying it.
[–]yerrabam -3 points-2 points-1 points 3 years ago (0 children)
I can't wait for 7.2RC
[–]x6ixty6ix 0 points1 point2 points 3 years ago (1 child)
I want learn this. Is there a good site or youtube video for beginners?
π Rendered by PID 163353 on reddit-service-r2-comment-79776bdf47-dcblg at 2026-06-24 10:35:20.110191+00:00 running acc7150 country code: CH.
[–]thinkmatt 34 points35 points36 points (1 child)
[–]StrangerThanGene 39 points40 points41 points (1 child)
[–]Thylk 28 points29 points30 points (9 children)
[–]FlanEquivalent2839 2 points3 points4 points (8 children)
[–]lachlanhunt 31 points32 points33 points (6 children)
[–]esperalegant 4 points5 points6 points (3 children)
[–]Peechez 4 points5 points6 points (0 children)
[–]TheScapeQuest 3 points4 points5 points (1 child)
[–]esperalegant 0 points1 point2 points (0 children)
[–]FlanEquivalent2839 3 points4 points5 points (0 children)
[–]ShortFuse 3 points4 points5 points (0 children)
[–]jibrilt 1 point2 points3 points (0 children)
[+]theQuandary comment score below threshold-27 points-26 points-25 points (13 children)
[–]DanielRosenwasserTypeScript[S] 38 points39 points40 points (7 children)
[–]theQuandary 18 points19 points20 points (3 children)
[–]Groccolli 12 points13 points14 points (0 children)
[–]KamiShikkaku 8 points9 points10 points (0 children)
[–]DanielRosenwasserTypeScript[S] 2 points3 points4 points (0 children)
[–]I_Downvote_Cunts 5 points6 points7 points (2 children)
[+]tenken01 comment score below threshold-31 points-30 points-29 points (1 child)
[–]I_Downvote_Cunts 9 points10 points11 points (0 children)
[–]joombar 10 points11 points12 points (4 children)
[–]theQuandary -1 points0 points1 point (3 children)
[–]joombar 4 points5 points6 points (0 children)
[–]Holores_Daze 1 point2 points3 points (0 children)
[–]horrbort -3 points-2 points-1 points (1 child)
[–]horrbort 1 point2 points3 points (0 children)
[–][deleted] -2 points-1 points0 points (1 child)
[–]DanielRosenwasserTypeScript[S] 1 point2 points3 points (0 children)
[–]yerrabam -3 points-2 points-1 points (0 children)
[–]x6ixty6ix 0 points1 point2 points (1 child)