Recent TypeScript Versions

TypeScript has changed a lot since 2023. The 5.x releases added language features, 6.0 modernised the defaults, and 7.0 replaced the compiler with a much faster native one. Here's what each step changed, so you can read older code with confidence and know what a current setup looks like.

The big picture

VersionReleasedHeadline
5.0 – 5.92023 – 2025Standard decorators, using, smarter inference, options for type-stripping tools
6.0March 2026Last JavaScript-based compiler; new defaults and deprecations to prepare for 7.0
7.0July 2026Native compiler written in Go, roughly 10× faster; legacy options removed

TypeScript 5.x highlights

  • 5.0 — standard ECMAScript decorators with no flag (lesson 35); const type parameters (lesson 21); moduleResolution: "bundler"; verbatimModuleSyntax.
  • 5.2 — using declarations for automatic cleanup (below).
  • 5.4 — NoInfer<T> (lesson 27); narrowing preserved inside closures created after the last assignment.
  • 5.5 — inferred type predicates (below); the JSDoc @import tag (lesson 42); syntax checking of regular expressions.
  • 5.6 – 5.8 — errors for conditions that are always truthy or always nullish; stricter checking of conditional return expressions; the erasableSyntaxOnly option.
  • 5.9 — a short, modern tsc --init output and import defer syntax.

using declarations (5.2)

A variable declared with using is cleaned up automatically when its scope ends, by calling its [Symbol.dispose]() method — like a try/finally without the boilerplate:

TS using.ts
function openConnection(name: string) {
  console.log(`open ${name}`);
  return {
    query: (sql: string) => console.log(`  ${name}: ${sql}`),
    [Symbol.dispose]() {
      console.log(`close ${name}`);
    },
  };
}

function report() {
  using db = openConnection("db");
  db.query("SELECT 1");
}   // db is disposed here, even if query threw

report();
Output
open db
  db: SELECT 1
close db

await using does the same for asynchronous cleanup via [Symbol.asyncDispose].

Inferred type predicates (5.5)

TS inferred-predicate.ts
const raw = ["3", null, "7", undefined];

const present = raw.filter(x => x != null);
console.log(present.map(s => Number(s) * 2));
Output
[ 6, 14 ]

Before 5.5, present was still (string | null | undefined)[]. Now TypeScript works out that the callback is a type guard and gives string[].

Always-truthy checks (5.6)

TS always-truthy.ts
function check(value: string) {
  if (/^\d+$/) {
    return "digits";
  }
  return value;
}
tsc output
error TS2872: This kind of expression is always truthy.

The developer forgot .test(value) — a regex object is always truthy. Similar checks catch if (x => 0) and if (obj ?? {}).

erasableSyntaxOnly (5.8)

Node.js (22.18+ / 23.6+), Deno and Bun can run .ts files by deleting the type syntax. That only works for syntax that can be deleted, so this option reports the TypeScript features that generate code:

TS erasable.ts
// With "erasableSyntaxOnly": true, each of these is an error:
enum Color { Red, Green }                 // generates an object
namespace Utils { export const x = 1; }   // generates a function wrapper
class Point {
  constructor(private x: number) {}       // generates an assignment
}

TypeScript 6.0: the bridge release

6.0 was deliberately the last version of the original compiler. It changed defaults to match how modern projects are configured anyway, and deprecated options that the new compiler would drop:

  • New defaults: strict: true, module: esnext, target set to the latest ECMAScript version, types: [] and noUncheckedSideEffectImports: true. Lesson 38 has the full table.
  • Deprecated: ES5 output, downlevelIteration, moduleResolution: node/classic, AMD/UMD/SystemJS modules, baseUrl, outFile, the old module Foo {} spelling of namespaces, and import … assert { } (use with { } instead).
  • New library types: the ES2025 target, the Temporal date/time API, Map.prototype.getOrInsert, RegExp.escape, and #/ subpath imports.

The most common upgrade surprise is types: []: projects that relied on @types/node or test-runner globals being picked up automatically now need them listed in tsconfig.json (lesson 33).

TypeScript 7.0: the native compiler

7.0 is a line-by-line port of the compiler to Go. Because it follows the original code closely, it produces the same errors for the same code — every example in this course gives identical results on 6.0 and 7.0. What changes is speed and tooling:

  • Speed. Full builds are typically 8–12× faster, thanks to native code and multi-threaded type checking (--checkers controls the number of threads). Editor feedback on large projects is dramatically quicker too.
  • Removed options. Everything deprecated in 6.0 is now a hard error.
  • No JavaScript API yet. Tools that call the compiler from JavaScript — typescript-eslint, and template checkers for Vue, Svelte, Astro and Angular — still need TypeScript 6 until a new API arrives in a later 7.x release. The two versions can be installed side by side (lesson 41 shows how).
  • Single-file builds. Running tsc file.ts inside a folder with a tsconfig.json is now an error unless you pass --ignoreConfig.

Upgrading an older project

  1. Move to the latest 5.x first and fix any new errors.
  2. Upgrade to 6.0. Work through the deprecation warnings — the error messages name the replacement for each option. Set "types" explicitly.
  3. Once 6.0 builds with no deprecation warnings, try 7.0 for builds, keeping 6.0 for any tool that needs the JavaScript API.

Keeping up

  • Each release is announced on the official TypeScript blog with examples of every change.
  • New versions sometimes find real bugs that older ones missed, so expect a few new errors when you upgrade a large codebase.
  • The TypeScript Playground lets you switch compiler versions to try features before upgrading.