FIELD GUIDE 32Developer tools

microsoft / TypeScript

TypeScript 7 changes which implementation the main repository holds

TypeScript remains the type system and editor foundation for much of the JavaScript ecosystem, but its source map changed in 2026. The stable TypeScript 7 compiler and language service are a native Go port, built in the separate microsoft/typescript-go repository and moved into microsoft/TypeScript in August 2026, where it replaced the JavaScript implementation on the main branch.

WHAT TO KNOW FIRST

  1. Types disappear at runtime, so untrusted network, file, and user input still needs runtime validation.
  2. Module resolution must model the actual runtime or bundler; a green type check cannot rescue imports that load differently in production.
  3. TypeScript 7 is a stable native Go implementation, but its missing 7.0 programmatic API requires some tools and embedded-language projects to remain on 6.x temporarily.

01The repository boundary changed in 2026

For more than a decade, microsoft/TypeScript contained the compiler, language service, tests, and release work most developers associated with TypeScript. The TypeScript 7 implementation was built as a native Go port in a separate staging repository, microsoft/typescript-go. In August 2026 the team replayed that code and its commit history into microsoft/TypeScript, where it replaced the JavaScript implementation on the main branch, and the staging repository was then archived. A guide that treats the main branch as the JavaScript compiler will therefore give the wrong picture of current development.

The move does not make the older implementation obsolete. The JavaScript code that culminated in TypeScript 6 remains on the repository's release-6.0 branch, alongside a vast issue history, design notes, tests, and the Apache-2.0 license trail. It is also relevant when diagnosing a regression shared by 6.x and 7.x. For active compiler architecture, new 7.x behavior, and contribution work, the main branch and current release notes matter, while the archived microsoft/typescript-go repository still holds the port's earlier issues and pull requests. Repository readers should begin by stating which implementation and version they are investigating.

02The language adds checks without replacing JavaScript

TypeScript builds on JavaScript by adding syntax for types and a checker that analyzes how values flow through a program. The compiler can catch a missing property, an impossible branch, or a function called with the wrong shape before the code reaches a user. It also powers completion, rename, find references, and inline documentation in editors. The emitted program is JavaScript, so developers retain the language's runtime, package ecosystem, and deployment targets.

That erasure is the central constraint. An interface does not validate an HTTP response, a type assertion does not transform a value, and a private type does not create an authorization boundary. Code that accepts JSON, environment variables, database rows, messages, or user input needs runtime parsing and error handling. Types are strongest after a trusted boundary has been established. Treating static and runtime validation as complementary prevents the most dangerous kind of TypeScript bug: a confidently typed value whose data never satisfied the claimed type.

03Inference is useful when contracts remain visible

TypeScript can infer local variable types, generic arguments, return shapes, and narrowed branches from ordinary JavaScript structure. Good code lets that inference remove repetition while adding annotations at boundaries that readers and consumers need to understand. Exported functions, public class methods, callback contracts, and persisted data shapes benefit from deliberate types. Filling every local expression with an annotation can make refactoring harder without increasing safety.

Structural typing means compatibility depends primarily on members rather than declared names. That is convenient for composition and library interoperation, but identifiers with the same primitive representation can still be mixed accidentally. Branded or opaque patterns can protect values such as account IDs and cents when the distinction matters. Discriminated unions are particularly effective for product state because the tag and data travel together. An exhaustive switch then turns an added state into a compiler-guided list of places that need attention.

04Strictness changes the economics of maintenance

Strict checking enables a family of rules that make absence, implicit any values, function variance, and class initialization harder to ignore. New TypeScript 7 projects also inherit modern defaults introduced through the 6.0 transition, including strict mode by default. Existing projects should still make the intended options explicit so an upgrade does not silently redefine their contract. The first strict migration can expose many errors, but each repaired boundary reduces future search work during refactors.

The goal is not to drive the error count down with assertions. Non-null assertions, broad any types, and double casts can make the checker quiet while discarding the evidence it needs. Start at inputs, narrow unknown values, and let trusted types flow inward. Temporary exceptions should be local and carry a reason plus a removal path. Options such as noUncheckedIndexedAccess or exactOptionalPropertyTypes can add useful precision, but they should be piloted against the team's real data patterns rather than enabled as a badge.

05Modules are a runtime agreement

The hardest TypeScript failures often live at the point where static resolution meets Node.js, a browser bundler, package exports, or CommonJS interop. The tsconfig module and moduleResolution settings should describe how the code will actually load. Node applications commonly need the Node-aware modes, while bundled applications may use the bundler mode. Paths can teach the checker an alias, but they do not automatically teach a runtime or packaging tool to resolve that alias.

Package authors have an additional obligation: declaration files, exports, emitted JavaScript, and package metadata must agree for both consumers and tools. Test the packed artifact in a small consumer rather than only importing source code inside the monorepo. Type-only imports make runtime intent clearer. Avoid relying on editor auto-imports as proof that a path is publishable. The official module reference is worth reading as architecture documentation because many apparent type bugs are actually mismatched loader models.

  • Match module resolution to the deployed runtime or bundler, not to the option that removes the most errors.
  • Test the tarball or published package from an external consumer project.
  • Keep generated declaration output under CI scrutiny when it is part of the public API.

06JavaScript can adopt the checker gradually

A codebase does not have to rename every file before TypeScript helps. The compiler can include JavaScript, infer common patterns, and use JSDoc annotations where an explicit contract is needed. CheckJs can then surface errors in selected files. This route is valuable for mature systems where a flag-day conversion would stop feature work or produce thousands of unreviewed assertions. Teams can begin with leaf utilities and external boundaries, then move toward central modules as contracts stabilize.

TypeScript 7 reworked parts of JavaScript and JSDoc analysis to align them more closely with TypeScript files, so JavaScript-heavy projects should read the current changes before upgrading. A gradual migration still needs one target configuration and a rule for which files are checked. Mixing editor-only hints, several compiler versions, and undocumented exclusions creates false confidence. Track checked surface area, remaining any values, and runtime validation separately from the file extension count.

07TypeScript 7 is faster, with an ecosystem transition cost

The official TypeScript 7 announcement presents a stable compiler and language service written in Go, with parallel parsing, checking, emit, project builds, and a Language Server Protocol foundation. The practical promise is shorter compiler and editor feedback on large projects. It also changes the tooling seam. TypeScript 7.0 does not ship a programmatic API. The TypeScript 7.1 beta, published in October 2026, introduces a new and different API split across several entry points, but 7.1 has not yet reached a stable release. Tools that embed the old API may need the compatibility package or a side-by-side TypeScript 6 installation.

The official release guidance specifically warns that embedded-language workflows such as Vue, MDX, Astro, Svelte, and specialized Angular tooling may need TypeScript 6 until integration catches up. This is a point-in-time constraint, not a reason to ignore the native port. Inventory compiler API consumers, editor plugins, framework type checkers, lint integrations, and declaration tools before changing the version. Compare diagnostics and emitted artifacts in CI, and keep the rollback path explicit until the whole toolchain agrees.

08When TypeScript earns its place

TypeScript pays off when code lives long enough for interfaces to change, several people must understand it, or a mistake can reach customers. It is especially useful in libraries, service clients, UI state, domain workflows, and refactors that cross module boundaries. The documentation and Handbook are approachable, and the Apache-2.0 license supports broad use. The transition to a native implementation also shows the project's willingness to invest in the feedback loop that makes static checking tolerable at scale.

It cannot define good domain concepts, validate production data, or replace tests. Elaborate type puzzles can also make a public API harder to use than a simpler runtime function with a clear return type. Adopt TypeScript to communicate and check real contracts, not to maximize type-level cleverness. In 2026, add one operational rule: every source investigation and bug report should name whether it concerns the 6.x JavaScript implementation or the 7.x native implementation. That detail now determines where the truth lives.

A SENSIBLE FIRST HOUR

Start small enough to learn the repo

  1. Install the current TypeScript compiler locally, initialize a tsconfig, and keep the compiler version pinned through the project's package manager.
  2. Turn on strict checking, choose module and moduleResolution settings that match the real runtime or bundler, and list required global type packages explicitly.
  3. Convert one boundary-heavy module first, replace implicit any values with narrow types, and validate external input at runtime rather than trusting an assertion.
  4. Run the compiler with no emit in CI, verify the editor uses the workspace version, and test TypeScript 7 compatibility with any framework or tool that embeds the compiler API.

SOURCE LEDGER

What this review is built on

We use the project repository and first-party documentation. Access, licenses and project direction can change, so recheck the linked source before making a production decision.

  1. TypeScript repositoryrepository
  2. TypeScript native port staging repository (archived)repository
  3. TypeScript 7 repository migration pull requestrepository
  4. TypeScript Handbookdocumentation
  5. TypeScript 7 release announcementrelease
  6. TypeScript 7.1 Beta announcementrelease
  7. TypeScript licenselicense