TypeScript
The official blog of the TypeScript team.
Latest posts
Announcing TypeScript 6.0 Beta
Today we are announcing the beta release of TypeScript 6.0! To get started using the beta, you can get it through npm with the following command: TypeScript 6.0 is a unique release in that we intend for it to be the last release based on the current JavaScript codebase. As announced last year (with recent updates here), we are working on a new codebase for the TypeScript compiler and language service written in Go that takes advantage of the speed of native code and shared-memory multi-threading. This new codebase will be the foundation of TypeScript 7.0 and beyond. TypeScript 6.0 will be the immediate pre...
Progress on TypeScript 7 – December 2025
Earlier this year, the TypeScript team announced that we've been porting the compiler and language service to native code to take advantage of better raw performance, memory usage, and parallelism. This effort (codenamed "Project Corsa", and soon "TypeScript 7.0") has been a significant undertaking, but we've made big strides in the past few months. We're excited to give some updates on where we are, and show you how "real" the new TypeScript toolset is today. We also have news about our upcoming roadmap, and how we're prioritizing work on TypeScript 7.0 to drive our port to completion. Editor Support and L...
Announcing TypeScript 5.9
Today we are excited to announce the release of TypeScript 5.9! If you're not familiar with TypeScript, it's a language that builds on JavaScript by adding syntax for types. With types, TypeScript makes it possible to check your code to avoid bugs ahead of time. The TypeScript type-checker does all this, and is also the foundation of great tooling in your editor and elsewhere, making coding even easier. If you've written JavaScript in editors like Visual Studio and VS Code, TypeScript even powers features you might already be using like completions, go-to-definition, and more. You can learn more about Type...
Announcing TypeScript 5.9 RC
Today we are excited to announce the Release Candidate (RC) of TypeScript 5.9! To get started using the Release Candidate, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.9! What's New Since the Beta? A few reported fixes have been made since the 5.9 beta, including the restoration of to the DOM library. Additionally, we have added a section about Notable Behavioral Changes. Minimal and Updated For a while, the TypeScript compiler has supported an flag that can create a within the current directory. In the l...
Announcing TypeScript 5.9 Beta
Today we are excited to announce the availability of TypeScript 5.9 Beta. To get started using the beta, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.9! Minimal and Updated For a while, the TypeScript compiler has supported an flag that can create a within the current directory. In the last few years, running created a very "full" , filled with commented-out settings and their descriptions. We designed this with the intent of making options discoverable and easy to toggle. However, given external feedback (a...
Announcing TypeScript Native Previews
This past March we unveiled our efforts to port the TypeScript compiler and toolset to native code. This port has achieved a 10x speed-up on most projects - not just by using a natively-compiled language (Go), but also through using shared memory parallelism and concurrency where we can benefit. Since then, we have made several strides towards running on large complex real-world projects. Today, we are excited to announce broad availability of TypeScript Native Previews. As of today, you will be able to use npm to get a preview of the native TypeScript compiler. Additionally, you'll be able to use a previe...
A 10x Faster TypeScript
Today I'm excited to announce the next steps we're taking to radically improve TypeScript performance. The core value proposition of TypeScript is an excellent developer experience. As your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases. Developers working in large projects can experience long load and check times, and have to choose between reasonable editor startup time or getting a complete view of their source code. We know developers love when they can rename variables with confidence, find all referen...
Announcing TypeScript 5.8
Today we're excited to announce the release of TypeScript 5.8! If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by adding syntax for types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with and , and more. Types also power TypeScript's editor tooling like the auto-completion, code navigation, and refactorings that you might see in editors like Visual Studio and VS Code. In fact, TypeScript and its ecosystem powers the JavaScript experience in both of those editors as well! To get sta...
Announcing TypeScript 5.8 RC
Today we are excited to announce the Release Candidate (RC) of TypeScript 5.8! To get started using the Release Candidate, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.8! What's New Since the Beta? Since our beta release, we have had to pull back some work on how functions with conditional return types are checked. Based on some of the limitations and changes we wanted to make, we decided to iterate on the feature with the goal of shipping it in TypeScript 5.9. However, as part of this work, we added more granular checks for branches within return ...
Announcing TypeScript 5.8 Beta
Today we are excited to announce the availability of TypeScript 5.8 Beta. To get started using the beta, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.8! Checked Returns for Conditional and Indexed Access Types Consider an API that presents a set of options to a user: The intent with is that it shows a UI element that can allow selecting either a single option or multiple options. When it does this is determined by the parameter. When is , the return type of should be , and when it is , the return type should be . The problem is that the typ...
Announcing TypeScript 5.7
Today we excited to announce the availability of TypeScript 5.7! If you're not familiar with TypeScript, it's a language that builds on JavaScript by adding syntax for type declarations and annotations. This syntax can be used by the TypeScript compiler to type-check our code, and it can also be erased to emit clean, idiomatic JavaScript code. Type-checking is helpful because it can catch bugs in our code ahead of time, but adding types to our code also makes it more readable and allows tools like code editors to give us powerful features like auto-completion, refactorings, find-all-references, and more. TypeScr...
Announcing TypeScript 5.7 RC
Today we are announcing the availability of the release candidate of TypeScript 5.7. To get started using the RC, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.7! Checks for Never-Initialized Variables For a long time, TypeScript has been able to catch issues when a variable has not yet been initialized in all prior branches. Unfortunately, there are some places where this analysis doesn't work. For example, if the variable is accessed in a separate function, the type system doesn't know when the function will be called, and instead takes an "...
Announcing TypeScript 5.7 Beta
Today we are announcing the availability of TypeScript 5.7 Beta. To get started using the beta, you can get it through npm with the following command: Let's take a look at what's new in TypeScript 5.7! Checks for Never-Initialized Variables For a long time, TypeScript has been able to catch issues when a variable has not yet been initialized in all prior branches. Unfortunately, there are some places where this analysis doesn't work. For example, if the variable is accessed in a separate function, the type system doesn't know when the function will be called, and instead takes an "optimistic" ...
Announcing TypeScript 5.6
Today we're excited to announce the release of TypeScript 5.6! If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by adding syntax for types. Types describe the shapes we expect of our variables, parameters, and functions, and the TypeScript type-checker can help catch issues like typos, missing properties, and bad function calls before we even run our code. Types also power TypeScript's editor tooling like the auto-completion, code navigation, and refactorings that you might see in editors like Visual Studio and VS Code. In fact, if you write JavaScript in either of th...
Announcing TypeScript 5.6 RC
Today we are excited to announce the availability of the release candidate of TypeScript 5.6. To get started using the RC, you can get it through npm with the following command: Here's a quick list of what's new in TypeScript 5.6! What's New Since the Beta? Since TypeScript 5.6 beta, we reverted a change around how TypeScript's language service searched for files. Previously the language service would keep walking up looking for every possible project file named that might contain a file. Because this could lead to opening many referenced projects, we reverted the beh...
Announcing TypeScript 5.6 Beta
Today we are excited to announce the availability of TypeScript 5.6 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.6! Disallowed Nullish and Truthy Checks Maybe you've written a regex and forgotten to call on it: or maybe you've accidentally written (which creates an arrow function) instead of (the greater-than-or-equal-to operator): or maybe you've tried to use a default value with , but mixed up the precedence of and a comparison operator like : or...
Announcing TypeScript 5.5
Today we're excited to announce the release of TypeScript 5.5! If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with and , and more. Types also power TypeScript's editor tooling like the auto-completion, code navigation, and refactorings that you might see in editors like Visual Studio and VS Code. In fact, if you write JavaScript in either of those editors, that experience is powered by Type...
Announcing TypeScript 5.5 RC
Today we are excited to announce the availability of the release candidate of TypeScript 5.5. To get started using the RC, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.5! What's New Since the Beta? Since the beta, we've made a few changes that we wanted to call out. For one, we added support for ECMAScript's new methods. Additionally, we've adjusted the behavior of TypeScript's new regular expression checking to be slightly more lenient, while still erroring on questionable escapes tha...
Announcing TypeScript 5.5 Beta
Today we are excited to announce the availability of TypeScript 5.5 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.5! Inferred Type Predicates This section was written by Dan Vanderkam, who implemented this feature in TypeScript 5.5. Thanks Dan! TypeScript's control flow analysis does a great job of tracking how the type of a variable changes as it moves through your code: By making you handle the case, TypeScript pushes you to write more robust code...
Announcing TypeScript 5.4
Today we're excited to announce the release of TypeScript 5.4! If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with and , and more. Types also power TypeScript's editor tooling like the auto-completion, code navigation, and refactorings that you might see in Visual Studio and VS Code. In fact, if you've been writing JavaScript in either of those editors, you've been using TypeScript all this...
Announcing TypeScript 5.4 RC
Today we're excited to announce our Release Candidate of TypeScript 5.4! Between now and the stable release of TypeScript 5.4, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.4! What's New Since the Beta? Since the beta, we've updated the release notes to document new notable behavioral changes, including restrictions around enum compatibility, restrictions on enum member naming, and improvements in mapped type behavior. Pre...
Announcing TypeScript 5.4 Beta
Today we are excited to announce the availability of TypeScript 5.4 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.4! Preserved Narrowing in Closures Following Last Assignments TypeScript can usually figure out a more specific type for a variable based on checks that you might perform. This process is called narrowing. One common pain-point was that these narrowed types weren't always preserved within function closures. Here, TypeScript decided that it wasn't "safe...
Announcing TypeScript 5.3
Today we're excited to announce the release of TypeScript 5.3! If you're not familiar with TypeScript, it's a language that adds type syntax to JavaScript to bring type-checking. Type-checking can catch all sorts of issues like typos and forgetting to check for and . But types go beyond type-checking - the same analyses of TypeScript's type-checker are used for rich editor tooling like auto-completion, code navigation, and refactorings. In fact, if you've been writing JavaScript in editors like Visual Studio or VS Code, that experience is powered by TypeScript! To get started using TypeScript, you can get i...
Announcing TypeScript 5.3 RC
Today we're excited to announce our Release Candidate of TypeScript 5.3! Between now and the stable release of TypeScript 5.3, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.3! What's New Since the Beta? The beta permitted to be used across module resolution settings, but did not document it. Since the beta was released, we've added an option to prefer -only auto-imports when possible. Import Attributes TypeScr...
Announcing TypeScript 5.3 Beta
Today we are excited to announce the availability of TypeScript 5.3 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.3! Import Attributes TypeScript 5.3 supports the latest updates to the import attributes proposal. One use-case of import attributes is to provide information about the expected format of a module to the runtime. The contents of these attributes are not checked by TypeScript since they're host-specific, and are simply left alone so that browsers and runt...
Announcing TypeScript 5.2
Today we're excited to announce the release of TypeScript 5.2! If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with and , and more. Types also power TypeScript's editor tooling like the auto-completion, code navigation, and refactorings that you might see in Visual Studio and VS Code. In fact, if you've been writing JavaScript in either of those editors, you've been using TypeScript all this...
Announcing TypeScript 5.2 RC
Today we're excited to announce our Release Candidate of TypeScript 5.2! Between now and the stable release of TypeScript 5.2, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.2! What's New Since the Beta? Since the Beta, we've added a type-checking optimization and made it possible to reference the paths of TypeScript implementation files in type-only imports. Declarations and Explicit Resource Management TypeScript 5.2 ...
Announcing TypeScript 5.2 Beta
Today we are excited to announce the availability of TypeScript 5.2 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.2! Declarations and Explicit Resource Management TypeScript 5.2 adds support for the upcoming Explicit Resource Management feature in ECMAScript. Let's explore some of the motivations and understand what the feature brings us. It's common to need to do some sort of "clean-up" after creating an object. For example, you might need to close network connec...
Announcing TypeScript 5.1
Today we're excited to announce the release of TypeScript 5.1! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript by adding constructs called types. These types can describe some details about our program, and can be checked by TypeScript before they're compiled away in order to catch possible typos, logic bugs and more. TypeScript also uses these types to provide editor tooling like code completions, refactorings, and more. In fact, if you already write JavaScript in editors like Visual Studio or VS Code, that experience is already powered up by TypeScript! You can learn mo...
Announcing TypeScript 5.1 RC
Today we're excited to announce our Release Candidate of TypeScript 5.1! Between now and the stable release of TypeScript 5.1, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.1! What's New Since the Beta? Since the beta, we've corrected some of our behavior for hooks in decorators as the proposed behavior has been adjusted. We've also made changes to our emit behavior under , ensuring that script files are not rewritte...
Introducing Deopt Explorer
Over the past few months, during the lead-up to the TypeScript 5.0 beta, our team spent a good portion of our time looking for ways to improve the performance of our compiler so that your projects build faster. One of the ways we improved was by looking into an oft overlooked aspect of many JavaScript VMs: inline caching. A Brief Primer on Inline Caching Inline caching is an optimization often used in both statically typed and dynamically typed languages. An inline cache, or IC, is a set of instructions whose goal is to speed up operations like method calls and property lookups. It does this by taking a slo...
Announcing TypeScript 5.1 Beta
Today we're announcing our beta release of TypeScript 5.1! To get started using the beta, you can get it through NuGet, or through npm with the following command: Here's a quick list of what's new in TypeScript 5.1! Easier Implicit Returns for -Returning Functions In JavaScript, if a function finishes running without hitting a , it returns the value . However, in previous versions of TypeScript, the only functions that could have absolutely no return statements were - and -returning functions. That meant that even if you explicitly said "this function returns " you were f...
Announcing TypeScript 5.0
Today we're excited to announce the release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript smaller, simpler, and faster. We've implemented the new decorators standard, added functionality to better support ESM projects in Node and bundlers, provided new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuration, and made many other improvements. If you're not familiar with TypeScript yet, it's a language that builds on JavaScript by adding syntax for types which can be used for type-checking. Type-checking can he...
TypeScript’s Migration to Modules
One of the most impactful things we've worked on in TypeScript 5.0 isn't a feature, a bug fix, or a data structure optimization. Instead, it's an infrastructure change. In TypeScript 5.0, we restructured our entire codebase to use ECMAScript modules, and switched to a newer emit target. What to Know Now, before we dive in, we want to set expectations. It's good to know what this does and doesn't mean for TypeScript 5.0. As a general user of TypeScript, you'll need to be running Node.js 12 at a minimum. s should go a little faster and take up less space, since the package size should be reduced by about 46...
Announcing TypeScript 5.0 RC
Today we're excited to announce our Release Candidate of TypeScript 5.0! Between now and the stable release of TypeScript 5.0, we expect no further changes apart from critical bug fixes. This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We've implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers, new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuration, and made many other improvements. While the 5.0 release includes correctness changes and depre...
Announcing TypeScript 5.0 Beta
Today we're excited to announce our beta release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We've implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers, new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuration, and made many other improvements. While the 5.0 release includes correctness changes and deprecations for less-used flags, we believe most users will have a similar upgrade experience as in previous releases. To g...
Announcing TypeScript 4.9
Today we are excited to announce the availability of TypeScript 4.9! If you're not familiar with TypeScript, it's a language that builds on JavaScript by adding types and type-checking. Types can describe things like the shapes of our objects, how functions can be called, and whether a property can be or . TypeScript can check these types to make sure we're not making mistakes in our programs so we can code with confidence. It can also power other tooling like auto-completion, go-to-definition, and refactorings in the editor. In fact, if you've used an editor like Visual Studio or VS Code for JavaScript, th...
Announcing TypeScript 4.9 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.9. Between now and the stable release of TypeScript 4.9, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.9! What's New Since the Beta? TypeScript 4.9 beta originally included auto-accessors in classes, along with the performance improvements described below; however, these did not get documented in the 4.9 be...
Ten Years of TypeScript
Today is TypeScript's birthday! But this birthday is a special one - 10 years ago today, on October 1st, 2012, TypeScript was unveiled publicly for the first time. The Early Days When TypeScript first debuted, there was a lot of skepticism - and understandably so. To some JavaScript users, a team trying to bring static types to JavaScript might have sounded like an evil plot or a joke. But the features had merit, right? Type-checking, catching bugs before you even save your file, and getting rich editor features like code-completion, navigation, and refactorings? We knew teams inside and outside of our com...
Announcing TypeScript 4.9 Beta
Today we're announcing our beta release of TypeScript 4.9! To get started using the beta, you can get it through NuGet, or- use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.9! The Operator TypeScript developers are often faced with a dilemma: we want to ensure that some expression matches some type, but also want to keep the most specific type of that expression for inference purposes. For example: Notice that we've written , whereas we probably should have written . We could try to catch that typo by usin...
Announcing TypeScript 4.8
Today we're excited to announce the release of TypeScript 4.8! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript and adds syntax for types. These types let you put your expectations and assumptions into your code, and those assumptions can then be checked by the TypeScript type-checker. This checking can help avoid typos, calling uninitialized values, mixing up arguments for functions, and more. Types go beyond checking though, and are used to give you a powerful editing experience for both TypeScript and JavaScript, enabling code completion, go-to-definition, renaming, and...
Announcing TypeScript 4.8 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.8. Between now and the stable release of TypeScript 4.8, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.8! What's New Since the Beta? Since our beta release, the RC now has support for excluding which files are considered in auto-imports. The beta release post also did not document a break around unused dest...
Announcing TypeScript 4.8 Beta
Today we're announcing our beta release of TypeScript 4.8! To get started using the beta, you can get it through NuGet, or- use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.8! Improved Intersection Reduction, Union Compatibility, and Narrowing TypeScript 4.8 brings a series of correctness and consistency improvements under . These changes affect how intersection and union types work, and are leveraged in how TypeScript narrows types. For example, is close in spirit to the union type because it accepts ,...
Announcing TypeScript 4.7
Today we're excited to announce the availability of TypeScript 4.7! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript and adds syntax for types. Types help describe what kinds of values you're working with and what kinds of functions you're calling. TypeScript can use this information to help you avoid about mistakes like typos, missing arguments, or forgetting to check for and ! But this type-checking isn't the only thing TypeScript does - it uses the information from these types to give you an amazing editing experience, powering things like code-completions, go-to-defin...
Announcing TypeScript 4.7 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.7! Between now and the stable release of TypeScript 4.7, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.7! What's New Since the Beta? In our beta release, we announced a stable target for our Node ESM support called ; however, Node.js 12 is no longer under maintenance, so we've started the stable targ...
Announcing TypeScript 4.7 Beta
Today we are excited to announce the beta release of TypeScript 4.7! To get started using the beta, you can use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.7! ECMAScript Module Support in Node.js For the last few years, Node.js has been working to support ECMAScript modules (ESM). This has been a very difficult feature, since the Node.js ecosystem is built on a different module system called CommonJS (CJS). Interoperating between the two brings large challenges, with many new features to juggl...
A Proposal For Type Syntax in JavaScript
Today we're excited to announce our support and collaboration on a new Stage 0 proposal to bring optional and erasable type syntax to JavaScript. Because this new syntax wouldn't change how surrounding code runs, it would effectively act as comments. We think this has the potential to make TypeScript easier and faster to use for development at every scale. We'd like to talk about why we're pursuing this, and how this proposal works at a high level. Background One recent trend our team has seen in the JavaScript world is a demand for faster iteration time and a reduction of build steps. In other words, &qu...
Announcing TypeScript 4.6
Today we're announcing the availability of TypeScript 4.6. If you're not yet familiar with TypeScript, it's a language that builds on JavaScript and adds syntax for types. Types help describe what kinds of values you're working with and what kinds of functions you're calling. TypeScript can use this information to help you avoid about mistakes like typos, missing arguments, or forgetting to check for and ! But this type-checking isn't the only thing TypeScript does - it uses the information from these types to give you an amazing editing experience, powering things like code-completions, go-to-definition, re...
Announcing TypeScript 4.6 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.6! Between now and the stable release of TypeScript 4.6, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by If you've already read our beta blog post, you can read up on what's changed since. Here's a quick list of what's new in TypeScript 4.6! What's New Since the Beta? When we announced our beta, we missed two great features - co...
Announcing TypeScript 4.6 Beta
Today we are excited to announce the beta release of TypeScript 4.6! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.6! Allowing Code in Constructors Before In JavaScript classes it's mandatory to call before referring to . TypeScript enforces this as well, though it was a bit too strict in how it ensured this. In TypeScript, it was previously an error to contain any code at the beginning of a constructor if its cont...
Announcing TypeScript 4.5
Today we're excited to announce the release of TypeScript 4.5! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript by adding statically checked types. When you use static types, you can run the TypeScript compiler to check for bugs like typos and mismatches in the shapes of your data, and get handy suggestions. These types don't change your program, and you can remove them to leave you with clean, readable JavaScript. Going beyond catching bugs in your code, TypeScript also assists you in writing code because types can power useful tooling like auto-complete, go-to-definition...
Announcing TypeScript 4.5 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.5! Between now and the stable release of TypeScript 4.5, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by If you've already read our beta blog post, you can read up on what's changed since. Some major highlights of TypeScript 4.5 are: What's New Since the Beta? Since our beta release post, 4.5 has gone through a...
Type | Treat – Wrap-up
Type | Treat Challenge Wrap-up That's all the challenges done! If you missed any of the challenges they're all available in the Playground here. Let's talk through the final answers to day 5's challenges. Yesterday's Solution Beginner/Learner Challenge In this challenge we were working with an existing object literal which had been 'd. The goal was to use and to extract interesting sets of strings from the object. The first being the keys in the object: Ideally, you might have noticed the 'key of' in the comment, which could have led you to , from there you needed to re-use to extract the type from . Th...
Type | Treat – Day 5
Type | Treat Challenge 5 Welcome to the fifth, and last, challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day five, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge This challenge aimed to be generics 101, first introducing the concept of making your function pass a type from the function to the argument: The acted as hint clue about where to look, and this example is almost the first code sample on the Generics ...
Type | Treat 2021 – Day 4
Type | Treat Challenge 4 Welcome to the fourth challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day four, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge I wonder if we over-indexed on the difficulty here, and we're interested if you dropped off somewhere through this task because we had less submissions than usual for this challenge. The goal was to have you build out a template string literal type which accounted for ...
Type | Treat 2021 – Day 3
Type | Treat Challenge 3 Welcome to the third challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day three, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge There is many ways to decide how to type existing data, you could use literal types when you're sure of the exact formats - or be more liberal and use when you expect a variety. We opted for literals, but using is totally cool too. The second part of the chall...
Type | Treat 2021 – Day 2
Type | Treat Challenge 2 Welcome to the second challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day two, which means going over the answers from yesterday and showcasing 2 new challenges. Yesterday's Solution Beginner/Learner Challenge The first part of the solution for this challenge used to trigger "Literal Inference" - basically telling TypeScript "Don't convert the array to but consider it a constant set of string literals. This meant that stopped returning and started returning . ...
Type | Treat 2021 – Day 1
Spooky TypeScript challenges for beginner and intermediate programmers, day 1.
Announcing TypeScript 4.5 Beta
Today we are excited to announce the beta release of TypeScript 4.5! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Some major highlights of TypeScript 4.5 are: ECMAScript Module Support in Node.js For the last few years, Node.js has been working to support running ECMAScript modules (ESM). This has been a very difficult feature to support, since the foundation of the Node.js ecosystem is built on a different module system called CommonJS (CJS). I...
Announcing TypeScript 4.4
Today we're excited to announce the availability of TypeScript 4.4! If you haven't heard of TypeScript yet, it's a language that builds on JavaScript by adding syntax for static types. Tools like the TypeScript compiler just erase those types, leaving you with clean readable JavaScript that you can run anywhere; but those types are there to be type-checked! Types make your intentions explicit, and tools can read and understand them to catch errors before you even run your code. By checking your types, TypeScript can catch errors like typos, logic errors, and more! Beyond catching errors, TypeScript also u...
Announcing the New TypeScript Homepage
Hey folks, we're happy to announce that the next iteration version of the TypeScript Website has been switched on for the TypeScript homepage. Last August we deployed a re-design and re-architecture of the entire TypeScript web presence. The goals were to provide new foundations for documenting TypeScript, re-organize our information architecture and to have a cohesive design wrapping it together. The transition to the new site aimed for evolution over revolution with all previous URIs still accounted for because "cool URIs don't change", and most decisions about how to describe TypeScript staying reasonably con...
Announcing TypeScript 4.4 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.4! Between now and the stable release of TypeScript 4.4, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Some major highlights of TypeScript 4.4 are: Let's explore these in more detail! Control Flow Analysis of Aliased Conditions and Discriminants In JavaScript, we often have to probe a variable in different ways to see if it ha...
Announcing TypeScript 4.4 Beta
Today we are excited to announce the beta release of TypeScript 4.4! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Some major highlights of TypeScript 4.4 are: Let's explore these in more detail! Control Flow Analysis of Aliased Conditions In JavaScript, we often have to probe a variable in different ways to see if it has a more specific type that we can use. TypeScript understands these checks and calls them type guards. Instead of having to convince TypeScrip...
Announcing TypeScript 4.3
Today we're excited to announce the availability of TypeScript 4.3! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript by adding syntax for static types. Tools like the TypeScript compiler can just erase TypeScript syntax, leaving you with clean readable JavaScript that works anywhere. So what's that syntax adding if it just gets erased away? Well, when you add types throughout your code, you're making your intentions explicit, and TypeScript can type-check your code to catch mistakes like typos, logic errors, and more! TypeScript also uses those types to power editor too...
Announcing TypeScript 4.3 RC
Today we're excited to announce our Release Candidate (RC) of TypeScript 4.3! Between now and the stable release of TypeScript 4.3, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Let's dive in to what TypeScript 4.3 brings! Separate Write Types on Properties In JavaScript, it's pretty common for APIs to convert values that are passed in before storing them. This often happens with g...
Announcing TypeScript 4.3 Beta
Today we're excited to announce our Beta of TypeScript 4.3! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Let's dive in to what TypeScript 4.3 brings! Separate Write Types on Properties In JavaScript, it's pretty common for APIs to convert values that are passed in before storing them. This often happens with getters and setters too. For example, let's imagine we've got a class with a setter that always converts a value into a before saving it in a private field. How would we type this JavaScr...
Announcing the New TypeScript Handbook
Hey folks, we're happy to announce that a fresh re-write of the TypeScript Handbook is out of beta and is now our website's primary resource for learning TypeScript! Read the handbook on Web / Epub / PDF In the last year, the TypeScript team has heavily focused on ramping up the scale, modernity and scope of our documentation. One of the most critical sections of our documentation is the handbook, a guided tour through the sort of TypeScript code you'll see in most codebases. We want the handbook to feel like the first recommendation you give for learning TypeScript. With the release of the revised website l...
Announcing TypeScript 4.2
Today we're excited to announce the release of TypeScript 4.2! For those who aren't familiar with TypeScript, it's an extension to JavaScript that adds static types and type-checking. With types, you can state exactly what your functions take, and what they'll return. You can then use the TypeScript type-checker to catch lots of common mistakes like typos, forgetting to handle and , and more. Because TypeScript code just looks like JavaScript with types, everything you know about JavaScript still applies. When you need, your types can be stripped out, leaving you with clean, readable, runnable JavaScript ...
Announcing TypeScript 4.2 RC
Today we're excited to announce our Release Candidate of TypeScript 4.2! Between now and the stable release of TypeScript 4.2, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Let's take a look at what's in store for TypeScript 4.2! Leading/Middle Rest Elements in Tuple Types In TypeScript, tuple types are meant to model arrays with specific lengths and element types. Over time, TypeScript's tuple types have become more and more sophisticat...
Announcing TypeScript 4.2 Beta
Today we're excited to announce the availability of TypeScript 4.2 Beta! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Let's take a look at what's in store for TypeScript 4.2! Leading/Middle Rest Elements in Tuple Types In TypeScript, tuple types are meant to model arrays with specific lengths and element types. Over time, TypeScript's tuple types have become more and more sophisticated, since they're also used to model things like parameter lists in JavaScript. As a result, they can have optio...
Announcing TypeScript 4.1
Today we're proud to release TypeScript 4.1! If you're unfamiliar with TypeScript, it's a language that builds on JavaScript by adding syntax for type declarations and annotations. This syntax can be used by the TypeScript compiler to type-check our code, and then output clean readable JavaScript that runs on lots of different runtimes. Static type-checking can tell us about errors in our code before we even run it, or before we even save our files thanks to TypeScript's rich editing functionality across editors. But beyond error-checking, TypeScript powers things like completions, quick fixes, and refactoring...
Announcing TypeScript 4.1 RC
Today we are making the Release Candidate (RC) of TypeScript 4.1 available. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by For this release, we have some exciting new features, new checking flags, editor productivity updates, and speed improvements. Let's get a look at what 4.1 has in store for us! Template Literal Types String literal types in TypeScript allow us to model functions and APIs that expect a set of specific strings. This is pretty nice because ...
Announcing TypeScript 4.1 Beta
Today we're announcing the availability of TypeScript 4.1 Beta! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by For this release, we have some exciting new features, new checking flags, editor productivity updates, and speed improvements. Let's get a look at what 4.1 has in store for us! Template Literal Types String literal types in TypeScript allow us to model functions and APIs that expect a set of specific strings. This is pretty nice because string l...
Announcing TypeScript 4.0
Today we are thrilled to announce the availability of TypeScript 4.0! This version of the language represents our next generation of TypeScript releases, as we dive deeper into expressivity, productivity, and scalability. If you're not familiar with TypeScript, it's a language that builds on top of JavaScript by adding syntax for static types. The idea is that by writing down the types of your values and where they're used, you can use TypeScript to type-check your code and tell you about mistakes before you run your code (and even before saving your file). You can then use the TypeScript compiler to then stri...
Announcing TypeScript 4.0 RC
Today we're announcing our release candidate of TypeScript 4.0. While this RC brings us closer to a new major version of TypeScript, don't fret - there are no larger breaking changes than usual. Our philosophy in evolving TypeScript has always been to provide an upgrade path that minimizes disruptive breaking changes while still giving ourselves some flexibility to flag suspicious code as errors when appropriate. For this reason, we're continuing with a similar versioning model to that of past releases, so 4.0 is just the natural continuation from TypeScript 3.9. To get started using the RC, you can get it ...
Announcing the new TypeScript Website
The new TypeScript website is live, with big changes to the handbook, playground and a new section covering the tsconfig.json.
Announcing TypeScript 4.0 Beta
Today we're excited to release the beta of the next major milestone in the TypeScript programming language: TypeScript 4.0. This beta takes us on our first step into TypeScript 4.0, and while it brings a new major version, don't fret - there are no substantially larger breaking changes than usual. Our philosophy in evolving TypeScript has always been to provide an upgrade path that minimizes disruptive breaking changes while still giving ourselves some flexibility to flag suspicious code as errors when appropriate. For this reason, we're continuing with a similar versioning model to that of past releases, so 4...
Changes to How We Manage DefinitelyTyped
For the past year, we’ve been working on tooling to protect the stability of the Definitely Typed ecosystem to the point where we can offer a more streamlined experience when contributing to DT repo – definition owners can now help merge PRs to their modules.
Announcing TypeScript 3.9
Today we're excited to announce the release of TypeScript 3.9! If you're unfamiliar with TypeScript, it's a language that builds on JavaScript by adding syntax for type declarations and annotations. This syntax can be used by the TypeScript compiler to type-check our code, and then output clean readable JavaScript that runs on lots of different runtimes. Static type-checking can tell us about errors in our code before we even run it, or before we even save our files thanks to TypeScript's rich editing functionality across editors. But beyond error-checking, TypeScript powers things like completions, quick fixe...
Announcing TypeScript 3.9 RC
Today we're announcing the availability of TypeScript 3.9 RC, the release candidate of TypeScript 3.9. Between now and the final release, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by For this release our team been has been focusing on performance, polish, and stability. We've been working on speeding up the compiler and editing experience, getting rid of friction and papercuts, and reducing bugs and crashes. We've also received a number of usefu...
Announcing TypeScript 3.9 Beta
Today we're announcing the availability of TypeScript 3.9 Beta! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by For this release our team been has been focusing on performance, polish, and stability. We've been working on speeding up the compiler and editing experience, getting rid of friction and papercuts, and reducing bugs and crashes. We've also received a number of useful and much-appreciated features and fixes from the external community! Improvements in Infe...