TypeScript 5.0 is here! 🎉🎉
Learn about what's new and try it today!
devblogs.microsoft.com/typescript/ann…
Learn about what's new and try it today!
devblogs.microsoft.com/typescript/ann…
30
1,380
4,722
819,339
Want to know what's new in TypeScript 5.0 at a glance? Here's a thread about what's packed into this release that makes it great. 🧵
x.com/typescript/sta…
x.com/typescript/sta…
TypeScript 5.0 is here! 🎉🎉
Learn about what's new and try it today!
devblogs.microsoft.com/typescript/ann…
1
18
115
54,922
We'll make this one fast: TypeScript's now way speedier.
You can expect at anywhere from 10%-20% of your compile times to disappear with TypeScript 5.0!
You can expect at anywhere from 10%-20% of your compile times to disappear with TypeScript 5.0!
2
15
117
22,073
TypeScript's also lighter too! Unzipped from npm, TypeScript 5.0 now takes about 41% less space compared to TypeScript 4.9!
1
11
136
16,928
Ever gotten into an argument about decorating? Now you can decorate without any red flags. 🚩🚩🚩🚩
TypeScript 5.0 ships the latest version of decorators! ✨
Use them without setting --experimentalDecorators 🧪.
TypeScript 5.0 ships the latest version of decorators! ✨
Use them without setting --experimentalDecorators 🧪.
1
7
92
16,476
TypeScript 5.0 brings '--moduleResolution bundler' to model how most modern bundlers and loaders work.
It understands classic Node-style resolution while respecting rules for 'exports', 'imports', etc. in your dependencies.
It understands classic Node-style resolution while respecting rules for 'exports', 'imports', etc. in your dependencies.
Mar 16, 2023 · 7:12 PM UTC
2
20
99
21,229
If you're a library author, maybe you've told your users to write 'as const' when they call a function.
With 'const' type parameters, you can hint which values should get literal & read-only types.
With 'const' type parameters, you can hint which values should get literal & read-only types.
3
7
107
15,631
Does your linter fight with your editor?
We're lovers, not fighters. Let's all get along. ☮️✌️
TypeScript 5.0 is smarter about respecting upper/lower-casing in already-sorted imports.
We're lovers, not fighters. Let's all get along. ☮️✌️
TypeScript 5.0 is smarter about respecting upper/lower-casing in already-sorted imports.
2
2
54
12,079
We're pretty sure you love coding with TypeScript - but just in *case*, we added a new feature to our code-completions.
If you write a 'switch' statement and you're using literal types, we'll scaffold out all your 'case's automagically. 🪄
If you write a 'switch' statement and you're using literal types, we'll scaffold out all your 'case's automagically. 🪄
7
30
358
86,972
Speaking of literal types - every enum member now acts kind of like a literal type. This is way safer, and pushes us to be tidy and consistent. 🤓
2
12
114
17,095
TypeScript 5.0 also makes it possible to mix and match options from different 'tsconfig.json' files.
6
11
109
20,443




![/**
* Ensures a method is bound to every instance.
*/
function bound(method: Function, context: ClassMethodDecoratorContext<any>) {
if (context.private) {
throw new Error("Cannot bind private methods.");
}
context.addInitializer(function (this) {
this[context.name] = method.bind(this);
});
}](/pic/media%2FFrXRYseagAATr05.jpg)


![declare function frozen<const T>(x: T): T;
// inferred type is 'readonly ["elsa", "anna", "olaf"]'
let itSnow = frozen([
"elsa", "anna", "olaf"
]);](/pic/media%2FFrXS2zEaIAA9FQO.jpg)

![// tsconfig1.json
{
"compilerOptions": {
"strictNullChecks": true
}
}
// tsconfig2.json
{
"compilerOptions": {
"noImplicitAny": true
}
}
// tsconfig.json
{
"extends": ["./tsconfig1.json", "./tsconfig2.json"],
"files": ["./index.ts"]
}](/pic/media%2FFrXTn5RaYAEgQc6.jpg)