TypeScript 6.0: The Last JS Release Before the Go-Based Native Compiler

TypeScript 6.0: The Last JS Release Before the Go-Based Native Compiler

lschvn

TypeScript 6.0 shipped this month, and it carries a weight most point releases don't: this is the last version built on the current JavaScript codebase. Everything from 7.0 onward will run on a Go-based native compiler that the team has been building for over a year.

A Bridge to TypeScript 7.0

The headline story is what you don't get in 6.0. Microsoft describes it as a "bridge release" β€” aligning APIs and behavior so the jump to TypeScript 7.0's new codebase goes smoothly. The team is candid: "TypeScript 7.0 is actually extremely close to completion." You can already try the native preview in VS Code or via npmx.dev/package/@typescript/native-preview.

Most changes in 6.0 exist to smooth that transition. But there are still features worth knowing about.

Less this-Sensitivity in Method Inference

A long-standing rough edge gets fixed. When TypeScript infers type parameters from a callback, it skips over "contextually sensitive" functions β€” functions with untyped parameters. Methods written with shorthand syntax were always treated as sensitive because they carry an implicit this, even when this is never used. Arrow functions didn't have this problem.

TypeScript 6.0 checks whether this is actually referenced before flagging a method as sensitive. If you never use this, the method participates in type inference normally. The fix was contributed by Mateusz BurzyΕ„ski (PR #62243).

Subpath Imports Now Support #/

Node.js recently added support for subpath imports that start with #/ rather than #/something. TypeScript 6.0 picks this up under --moduleResolution nodenext and bundler. You can now write:

{
  "imports": {
    "#/*": "./dist/*"
  }
}

This aligns with the way bundlers typically handle path aliases and removes the need for a dummy segment after #.

Combining --moduleResolution bundler with commonjs

Previously --moduleResolution bundler required --module esnext or --module preserve. With the deprecation of moduleResolution: node, this constraint is lifted. The new valid combination is --module commonjs with --moduleResolution bundler, which is a practical upgrade path for many existing projects (PR #62320).

Stable Type Ordering for 6.0-to-7.0 Migrations

TypeScript 7.0's parallel type checker sorts internal objects deterministically. TypeScript 6.0 introduces --stableTypeOrdering to make its output match that order. This is primarily a migration tool β€” the flag can slow type-checking by up to 25% β€” but it ensures declaration files and error messages don't shift unexpectedly when you eventually upgrade. The flag is not recommended for permanent use.

ES2025 Target and New Built-in API Types

TypeScript 6.0 adds es2025 as a valid value for --target and --lib. This brings RegExp.escape (stage 4) and moves Promise.try, iterator methods, and set methods into the stable lib. The Temporal API β€” the long-awaited date/time replacement for Date β€” also gets full built-in types in 6.0. The Map and WeakMap types gain getOrInsert and getOrInsertComputed (stage 4) for the common "get or create" pattern.

DOM Lib Consolidation

The contents of lib.dom.iterable.d.ts and lib.dom.asynciterable.d.ts are now fully merged into lib.dom.d.ts. You no longer need to add dom.iterable to your lib array just to iterate a NodeList.

Breaking Changes That Will Likely Affect You

TypeScript 6.0 flips several defaults that older projects may have relied on:

  • strict now defaults to true β€” if you relied on implicit strictness being off, set "strict": false explicitly
  • module defaults to esnext β€” ESM is now the assumed format for new projects
  • target defaults to the current year (effectively es2025 right now) β€” the es5 target is deprecated
  • types now defaults to [] instead of enumerating everything in node_modules/@types β€” this alone has cut build times 20-50% in the projects the team studied. Add explicit types: ["node", "jest"] etc.
  • rootDir defaults to the tsconfig directory rather than inferring from file locations β€” nested source directories may need explicit rootDir configuration
  • noUncheckedSideEffectImports now defaults to true

The Bottom Line

If you're starting a new project, 6.0 is a solid choice with sensible modern defaults. If you're on an existing codebase, budget time to add explicit types entries and check your rootDir before upgrading blindly. The Go-based 7.0 is close β€” the team wants you on 6.0 now so the transition is clean.

Install it: npm install -D typescript@latest

Frequently Asked Questions

Related articles

More coverage with overlapping topics and tags.

Node.js 26.3.0: Buffer Pool Doubles, Permission API Gains drop(), Intel Macs at Risk
TypeScript

Node.js 26.3.0: Buffer Pool Doubles, Permission API Gains drop(), Intel Macs at Risk

Node.js 26.3.0 lands with a doubled default Buffer.poolSize to 64 KiB, a new permission.drop() method for granular capability surrender, macOS universal binary warnings, and hardened WebCrypto. npm is bumped to 11.16.0.
Oxc v0.134: oxlint v1.68 Adds Vue Linter Rules and TypeScript Accessor Checks
JavaScript

Oxc v0.134: oxlint v1.68 Adds Vue Linter Rules and TypeScript Accessor Checks

Oxc's June release ships oxlint v1.68.0 with two new Vue rules, a TypeScript method-signature-style linter rule, and parser improvements that reject ambient context misuse. oxfmt v0.53.0 ships formatter updates alongside performance work on token parsing.
Turborepo v2.9.16 Lands Heap Allocation Profiling and pnpm Fixes
JavaScript

Turborepo v2.9.16 Lands Heap Allocation Profiling and pnpm Fixes

Turborepo's latest stable releases add heap allocation profiling via OpenTelemetry traces, fix pnpm injected peer package handling, harden OTEL endpoint validation, and address PTY shutdown hangs and npm tlog publish retries.

Comments

Log in Log in to join the conversation.

No comments yet. Be the first to share your thoughts.