Skip to content
Tutorials Center
My learning

Topics

TypeScript Reference ยท Concepts and Comparisons

TypeScript versions and what changed

A tour of the TypeScript releases from 5.0 onward: decorators, const type parameters, using, NoInfer, inferred type predicates, erasable syntax and the move to 7.

TypeScript ships a new minor version roughly every three to four months. Releases are cumulative: code that compiles on one version almost always compiles on the next, but new checks (and occasionally new errors) arrive with each release. Knowing when a feature appeared tells you what a team's minimum version must be, and what to expect when you upgrade.

This page lists the headline changes from 5.0 on. Reference pages mention "added in" notes for individual features; this is the overview. Always read the official release notes before upgrading a large codebase, since they list breaking changes this summary leaves out.

JSON
{ "devDependencies": { "typescript": "~5.9.0" } }

Using ~ in a version range keeps patch updates but holds the minor version steady, which is the usual way to avoid surprise errors from a new release.

Try it

TypeScript Features from 5.x in one file

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or readFileSync(0)), it gets the next line from this box.

TypeScript Newer syntax and runtime support

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or readFileSync(0)), it gets the next line from this box.

Release highlights

Version Notable changes
5.0 Standard (ECMAScript) decorators, const type parameters, all enums are union enums, multiple configs in extends, --moduleResolution bundler, --verbatimModuleSyntax
5.1 Easier implicit undefined returns, unrelated getter and setter types
5.2 using and await using (explicit resource management), decorator metadata, tuple spreads of named elements
5.3 Import attributes, narrowing with switch (true), resolution-mode for import type
5.4 NoInfer, closures keep narrowing after last assignment, --module preserve
5.5 Inferred type predicates, regular expression syntax checking, --isolatedDeclarations, control-flow narrowing for constant indexed access
5.6 Checks for conditions that are always truthy or nullish, --noCheck, the --strictBuiltinIteratorReturn flag
5.7 --rewriteRelativeImportExtensions, errors for variables never initialized in closures, ES2024 target and lib
5.8 --erasableSyntaxOnly, require() of ES modules under nodenext, --module node18, checked branches of conditional expressions in returns
5.9 import defer, --module node20, a leaner default tsc --init file
6.0 Transition release before the native compiler; deprecations and new defaults ahead of 7
7.0 The native (Go) compiler; see TypeScript 7 native compiler

Usage notes

  • A new compiler can add errors without changing your code. Pin the version and upgrade on purpose.
  • Syntax and type features have different requirements. A syntax feature needs your tooling (bundler, Babel, Node) to understand the emitted or erased result; a type-only feature does not.
  • Lib versions matter. Many "new" APIs need the right lib or target, not just a newer compiler; see lib and target.
  • Declaration files can need a minimum version. Packages publish typesVersions to serve different .d.ts files to older compilers.
  • Run the type tests of your own library against several versions if you publish types.
  • Use tsc --version to print the compiler a project actually uses; editors may bundle a different one.