Command Palette

Search for a command to run...

Hectal
PHASE 0Beginner TypeScript 7.0+ ~19 min· topic 3 of 4

Topic 0.3

TypeScript Today: Versions 6 and 7

In one line

TypeScript 7.0 (July 2026) is the compiler rewritten in Go: the same type checking, about ten times faster. TypeScript 6.0 was the last JavaScript-based version and switched on modern defaults, such as strict mode, that 7.0 keeps.

Think of it like this

A restaurant moves its kitchen into a new building with faster ovens. The recipes stay exactly the same, so every dish tastes the same, but meals come out ten times quicker. Before the move, the chef cleaned up the menu: dishes nobody should order any more were taken off. TypeScript 7 is the new kitchen; TypeScript 6 was the menu clean-up.

Words you'll meet

New words in this topic, in plain English. Come back here whenever one feels fuzzy.

Version number
Like 7.0.2: the first number changes for big releases, the second for each new feature release (7.1 comes next), the last for bug fixes.
Native code
Machine instructions your computer's processor runs directly, without a JavaScript engine in between. Usually much faster.
Go
A programming language from Google that compiles to fast native code and makes using many processor cores easy.
Port
Rewriting a program in another language while keeping what it does the same.
Deprecated
Still works for now, but marked for removal. You should stop using it.
Default
The setting you get when you don't choose one yourself.
strict
A tsconfig setting that turns on TypeScript's strongest checks. On by default since 6.0.
API
A way for other programs to use a tool from their own code. TypeScript 7.0 doesn't have one yet; 7.1 should.

Step by step

01Check your version

Each project installs its own TypeScript, so different projects can use different versions. Ask the one in the current project:

terminal
$ npx tsc --version
── expected output ──
Version 7.0.2

02What got faster

Numbers from the TypeScript team's announcement, full type-check of real open-source projects, TypeScript 6 vs 7 (default settings, 4 checker threads):

build timeswhole filetext
project      TypeScript 6   TypeScript 7   faster
vscode       125.7 s        10.6 s         11.9x
sentry       139.8 s        15.7 s          8.9x
bluesky       24.3 s         2.8 s          8.7x
playwright    12.8 s         1.47 s         8.7x
tldraw        11.2 s         1.46 s         7.7x

03Strict by default

Before 6.0, a new project without "strict": true silently allowed things like parameters with no type (they became any). Now strict is the default, so the first live example below reports TS7006 for an un-annotated parameter.

Old projects that never set strict may see new errors after upgrading. The fix is to fix them (recommended), or set "strict": false explicitly while you migrate (Topic 15.4).

04Globals need their types listed

Node.js has globals like process and Buffer. Their types come from the @types/node package. With types: [] (the new default), they aren't loaded unless you list them, so process is unknown, and the error tells you exactly what to do.

tsconfig.json (a Node.js project)whole filejson
{
  "compilerOptions": {
    "types": ["node"]
  }
}

05The one visible change in 7.0's type checking

Splitting a string type into its first character and the rest now keeps an emoji together. Same code, real output from each compiler:

index.tswhole filets
type HeadTail<S extends string> = S extends `${infer H}${infer T}` ? [H, T] : never;
const x: HeadTail<"😀abc"> = 0;

// TypeScript 7.0:
// error TS2322: Type 'number' is not assignable to type '["😀", "abc"]'.
// TypeScript 6.0 (split in the middle of the emoji, shown as broken characters):
// error TS2322: Type 'number' is not assignable to type '["�", "�abc"]'.

06Running 6 and 7 side by side

While a tool you use still needs the 6.0 API, install both. 7 is tsc; 6 is available as tsc6 from the compatibility package:

terminal
$ npm install -D typescript @typescript/typescript6
Then `npx tsc` runs 7.0 and `npx tsc6` runs 6.0. Topic 15.2 shows the typescript-eslint setup.

Try it yourself

  1. 1

    Satisfy strict mode

    In the first example, change the parameter to n: number. Predict the new error before you look.

    Now double("21") is the error (TS2345). Strict mode made you state the promise; the promise caught the real bug. Change the call to double(21).

  2. 2

    Use a browser global instead

    In the third example, replace the line with console.log(navigator.language);. No error: the DOM types (navigator, document, window) are part of the default library, not a @types package.

Code & diagrams

strict is the default: a parameter needs a type

Strict mode reports the parameter with no type. Notice the bug it would catch: double("21") only works by accident, because * turns text into a number.

Console

(nothing was printed)

Expected console output

42
The old behaviour: strict switched off

This example uses { strict: false, exactOptionalPropertyTypes: false } (the second option needs strict null checks, which strict: false turns off). No error: n is silently any. This is how projects before 6.0 behaved unless they opted in.

Console

(nothing was printed)

Expected console output

42
types: [] means Node's globals aren't known

This page is a browser, so process really doesn't exist at runtime either. In a Node.js project you would install @types/node and add "types": ["node"].

Console

(nothing was printed)

Expected console output

Uncaught ReferenceError: process is not defined

Break it on purpose

Errors are the best teachers. Make each change, read the error, guess what went wrong, then reveal the answer.

Break #1

Turn strict off on its own

Imagine the second example with only { strict: false } in its settings (this course's projects also set exactOptionalPropertyTypes, as tsc --init does).

terminal
$ tsc
── what you'll see ──
tsconfig.json(4,5): error TS5052: Option 'exactOptionalPropertyTypes' cannot be specified without specifying option 'strictNullChecks'.

Myth vs fact

Myth

TypeScript 7 is a new language with new syntax to learn.

Fact

It's the same language and the same type checking, compiled by a faster program. Everything in this course works the same in 6.0 and 7.0.

Myth

You need a special package for TypeScript 7.

Fact

It ships as the normal typescript package (7.0.2 at the time of writing). The @typescript/native-preview package was only for the preview period.

Myth

Every tool works with 7.0 on day one.

Fact

7.0 has no programmatic API yet, so tools built on the compiler API (typescript-eslint, Vue/Svelte/Astro/Angular template checking) use 6.0 alongside it until 7.1.

Pro corner

Extra depth for experienced readers. New to this? Skip it for now and come back later.

  • ▸

    7.0 parallelises parsing, checking and emit. --checkers (default 4) sets type-checker workers, --builders sets how many project references build at once, --singleThreaded turns it off. More checkers use more memory; the team notes that in rare cases, changing the checker count can surface order-dependent results.

  • ▸

    stableTypeOrdering is always on in 7.0. In 6.0 it's an opt-in flag that orders union members deterministically, so 6.0 output matches 7.0; it can slow checking down, so use it to preview the migration rather than leaving it on. Code that's clean in 6.0 with it on and without ignoreDeprecations should behave the same in 7.0.

  • ▸

    Other 7.0 hard changes: rootDir defaults to the tsconfig folder (set "rootDir": "./src" if your sources live there), esModuleInterop can't be false, alwaysStrict is always on, namespace can't be spelled module, and import assertions use with, not asserts. JSDoc type checking in .js files lost several Closure-style forms (Topic 11.6).

  • ▸

    Watch mode in 7.0 uses a native file watcher (a Go port of the Parcel bundler's watcher) instead of polling, which matters on large monorepos and laptops on battery.

Remember this

  1. 1

    The problem this solves: On large projects, type checking took minutes, and the editor was slow to show errors. Waiting makes people skip the checks. Until 2026, the TypeScript compiler was itself written in TypeScript and ran on JavaScript. That made it easy to run anywhere, but big projects waited a long time for checks: VS Code's own codebase took about 125 seconds to type-check. In TypeScript 7.0 (released July 8, 2026) the team ported the compiler to Go, a language that compiles to fast native code (machine instructions your processor runs directly) and can use many processor cores at once.

  2. 2

    "Port" here means a faithful translation, not a redesign. The Go code keeps the same structure and logic, so type checking gives the same answers. VS Code's check went from 125.7 s to 10.6 s; typical projects build 8–12x faster. The editor gets the same speed-up: VS Code's time to show the first error went from about 17.5 s to under 1.3 s. You install and run it exactly as before: npm install -D typescript, then npx tsc.

  3. 3

    TypeScript 6.0 (March 23, 2026) was the bridge release: the last version written in JavaScript, made to get projects ready for 7. It changed defaults to match how modern projects are set up: **strict is on by default** (the strongest checks, Topic 12.2), module defaults to esnext, and **types defaults to []**, meaning type packages for globals like Node's process are no longer included automatically; you list them, e.g. "types": ["node"]. It also deprecated old options (target: es5, moduleResolution: node, baseUrl, AMD/UMD modules, outFile and more). In 7.0 those are gone for good.

  4. 4

    7.0 has one big missing piece: no programmatic API yet (an API is a way for other programs to use the compiler from code; one is planned for 7.1). Tools built on the old API, such as typescript-eslint and the Vue, Svelte, Astro and Angular template checkers, keep using 6.0 for now. Both can live side by side: the package @typescript/typescript6 provides 6.0 as a tsc6 command next to 7's tsc. Topic 15.2 shows the setup.

  5. 5

    There is one small behaviour change you can see: template literal types (Topic 9.4) now split strings by Unicode code points, so an emoji stays one piece. Otherwise, code that type-checks cleanly in 6.0 type-checks the same way in 7.0. New versions now come every three to four months.

  6. 6

    How this course runs it: TypeScript 7 is a native program, and a web page can't run native programs. So the live editor runs TypeScript 6.0.3, the last JavaScript compiler, inside your browser, set up like 7 (stableTypeOrdering on, 7's defaults). Every example on these pages is also run through the real TypeScript 7.0.2 tsc before it is published, and the errors must match line for line.

Explain it without notes

01

What is TypeScript 7, and what changed for you as a user?

02

Why was TypeScript 6.0 called a bridge release?

03

Which tools can't use TypeScript 7.0 yet, and what do teams do about it?

04

A project that compiled fine on TypeScript 5 shows many errors after upgrading to 7. What are the likely causes?

Practice

01

A Node.js project upgraded to TypeScript 7 now reports error TS2591: Cannot find name 'process'. The package @types/node is installed. What one change fixes it?

02

Write a package.json devDependencies section that gives a project both TypeScript 7 (as typescript) and TypeScript 6 for a tool that needs the old API.

Trade-offs

  • ↔

    Upgrading to 7.0 now gives big speed gains in CI and the editor; tools that need the API mean running two versions for a while. Most teams accept that, because both give identical type checking.

  • ↔

    Strict-by-default makes new projects safer but makes upgrades noisier. Fixing the errors pays off; turning strict off forever throws away most of TypeScript's value.

Done when you can

  • I can say what TypeScript 7 changed (native Go compiler, same checking, ~10x faster) and what it didn't.

  • I can list the main 6.0 default changes: strict, module, types, rootDir.

  • I can fix a missing-globals error with the types option.

  • I can explain why some tools still use TypeScript 6.0 and how both versions are installed.

  • I can explain how this course's live editor checks code (6.0.3 in the browser, verified against 7.0.2).