OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

TypeScript vs JavaScript: when the type system is worth it

TypeScript's current release line is 7 - a native Go port of the type checker, latest 7.0.2 - while plain JavaScript can run with no separate build step when it matches the target runtime. What static types actually catch, what they never change at runtime, how gradually you can adopt them, and what they cost - from TypeScript's own handbook and release posts, read 21 November 2026.

OOmnistu
Reviewed 2026-11-21 · 4 min read

TypeScript's own handbook describes it as a static type-checker: a tool that predicts what your code will do before it runs and flags where it might go off the rails. JavaScript needs none of that machinery in the simple case: it is the language browsers and Node.js execute directly, and when your syntax, modules and APIs match the target runtime, no separate build step is required. As of 21 November 2026, TypeScript's latest stable release is 7.0.2 (20 August 2026 per its GitHub releases and the npm registry): version 7, announced 8 July 2026, is a native Go port of the compiler that Microsoft says was written to keep results consistent with the previous codebase. Choosing between TypeScript and JavaScript is not a language war; it is a decision about when compile-time checking pays for its overhead. This article works from TypeScript's own handbook and release posts, all read 21 November 2026, and names no default winner.

What types actually buy you

Per the handbook, the type-checker catches certain classes of bugs before your code runs - calling something that isn't callable, touching properties that don't exist, and what it calls "non-exception failures": code JavaScript would run without complaint while silently doing the wrong thing. A clean type-check is not proof the program is correct, and it is no security boundary; it is one class of mistakes caught early. The same type information powers editor tooling: accurate autocomplete, jump-to-definition and tooling-assisted renames. Types also serve as checkable documentation at function boundaries - the next reader sees the expected shape without reading the implementation. And in TypeScript 7's current line, the check itself got dramatically cheaper: Microsoft's announcement reports 8x to 12x faster full builds on several large open-source codebases it measured. That is build and check time on Microsoft's chosen repos - it says nothing about how fast your application runs for users.

What types never do

The handbook's exact sentence is worth quoting: "Type annotations never change the runtime behavior of your program." Note its precision - it speaks about annotations: the handbook says most TypeScript-specific code is erased at compile time, while some TypeScript-only constructs do emit runtime code, and downleveling rewrites newer JavaScript syntax for older targets. The practical rule stands: a type says nothing about data that arrives at runtime - an API response, a form payload, a parsed file. Code that trusts unvalidated external data is unsafe in TypeScript exactly as it is in JavaScript; runtime validation is still your job. TypeScript also doesn't turn JavaScript into a different language: the output is JavaScript, and every JavaScript program is already valid input to the type-checker, which is what makes gradual adoption possible.

The cost side

JavaScript's advantage is real: for a plain script that matches its runtime, there is no separate build step, no configuration and nothing to learn beyond the language itself. (Engines still compile JavaScript internally - that is their job, not yours - and many real projects add bundlers or transpilers anyway; the contrast is that plain JS doesn't require them.) TypeScript adds a compile or check step in your pipeline, a tsconfig to own - and configuration is a moving target: per the 7.0 announcement, TypeScript 7 adopts TypeScript 6's new defaults (strict on by default, module set to esnext, target set to the current ECMAScript version) and turns flags deprecated in 6.0 into hard errors, which is why Microsoft encourages moving to 6.0 before 7.0. Types also add a second thing to learn and maintain, and codebases sometimes pay a "type-wrangling" tax: time spent satisfying the checker rather than the user.

Adoption is a ladder, not a leap

TypeScript's own JavaScript documentation describes the levels between plain JS and full strict TypeScript: the editor's inference over plain .js files; JSDoc type annotations where inference runs out; a // @ts-check comment per file to turn on checking without renaming anything; a jsconfig or tsconfig to check many files at once; and only then .ts files, optionally with strict enabled. Files can opt back out with // @ts-nocheck, and individual lines with @ts-ignore or @ts-expect-error. The practical consequence: on an existing JavaScript codebase you can start getting value the day you add a comment, and a migration guide exists for going further. The same ladder works in reverse as a commitment dial - you stop where the checking pays for itself.

Which one to pick

Tie it to the project's shape. A short script, a prototype, a small site you'll throw away: plain JavaScript's build-optional path is the honest choice, with JSDoc hints as a free middle ground in any decent editor. A codebase with several developers, a long life ahead, or APIs others consume: type-checking tends to pay for itself, and the current TypeScript 7 line has made the check fast enough that "the build got slow" is a weaker objection than it used to be - per Microsoft's own benchmarks, at least. On an existing JavaScript project, the handbook's ladder applies: start with inference and JSDoc, add // @ts-check where it matters, and let the strictness grow only as it proves useful.

Sources, all read 21 November 2026: TypeScript Handbook, The Basics (static type-checker, non-exception failures, types erased - "Type annotations never change the runtime behavior of your program" - downleveling, types for tooling); TypeScript documentation, JS Projects Utilizing TypeScript (strictness ladder: inference, JSDoc, // @ts-check, @ts-nocheck/@ts-ignore/@ts-expect-error); TypeScript Handbook, Migrating from JavaScript (migration guide); Microsoft Dev Blogs, Announcing TypeScript 7.0 (8 July 2026 - native Go port, 8x-12x build speedups on Microsoft's measured codebases, TypeScript 6 defaults adopted, 6.0 deprecations become hard errors); GitHub, TypeScript releases (v7.0.2, 20 August 2026) and npm registry, typescript (dist-tag latest 7.0.2).

Frequently asked questions

What is the current version of TypeScript?

As read on 21 November 2026: v7.0.2 (20 August 2026) per the GitHub releases and the npm registry's latest tag; a 7.1 beta is also published. TypeScript 7 is the line built as a native Go port of the compiler.

Does TypeScript change how my code runs?

Type annotations don't: the handbook states they never change runtime behavior - they are erased during compilation, and the output is JavaScript. Two qualifications from the same docs: most, not all, TypeScript-specific syntax is erased (some constructs emit runtime code), and downleveling can rewrite newer JavaScript syntax for older targets. And types check code before it runs; they do not validate data while it runs.

Is TypeScript 7 a rewrite, and is it safe to upgrade?

Microsoft describes TypeScript 7 as a native port written to keep results consistent and compatible with the previous codebase, and reports 8x-12x faster full builds on codebases it measured. Note that 7.0 turns flags deprecated in 6.0 into hard errors, and Microsoft encourages adopting 6.0 first to smooth the transition.

Do I have to convert a JavaScript project all at once?

No. TypeScript's own docs describe a gradual path: editor inference over plain .js files, JSDoc annotations, // @ts-check per file, a shared config, then .ts files and strict mode when you want them. You can stop at any rung.

Does TypeScript make runtime validation unnecessary?

No. Types are gone by the time code runs, so anything arriving from outside - API responses, user input, files - still needs runtime validation in TypeScript exactly as in JavaScript.

When is plain JavaScript the better choice?

When tooling overhead outweighs checking benefit: short scripts, prototypes, throwaway sites, or contexts where a build step is genuinely unavailable. JSDoc plus // @ts-check covers a useful middle ground without leaving .js files.