Vezi pagina în română

IT Glossary

What is TypeScript?

JavaScript with declared data types checked before the code runs: mistakes show up in the editor, not for users.

7
sections
7
questions answered

TypeScript is an open-source programming language developed by Microsoft that adds optional static types on top of JavaScript, checked before the code runs, and is then turned into ordinary JavaScript. It is a superset: any valid JavaScript is, broadly, valid TypeScript too, and the types disappear completely from the code that runs. The current version is TypeScript 7 (7.0 shipped on 8 July 2026), the first compiler rewritten natively, in Go, about 10 times faster. Since 2025 TypeScript is also the language with the most monthly contributors on GitHub (Octoverse 2025 and 2026). Checked on 18 November 2026.

For a company commissioning an application, types are documentation that never goes stale and a safety net for change: alter a data structure and the compiler lists every place to update, before release. Adoption can be gradual, file by file, and the code runs wherever JavaScript runs. On a small project the difference is a matter of taste; on a business application with several developers and years of maintenance, it shows with every change.

Why it matters for your business

Errors caught while typing, not by clients

Whole classes of defects — wrong data, missing fields, incompatible calls — die in the developer's editor, before any release.

Changes with a complete map

Reshaping a data structure automatically reveals every spot to update — the silent regressions of “small” changes disappear structurally.

Code that explains itself

Types are documentation that never goes stale — new teams and vendor changes start from clear signatures, not from guesswork.

How TypeScript works: types, checking, compilation

The developer adds type annotations: what data a function takes and returns. In many places the compiler infers the type itself, and data shapes are described with interfaces. Example: for `function totalCuTva(suma: number, cota: number): number`, the call `totalCuTva("100", 21)` is flagged as an error in the editor, because the amount is text, not a number. In plain JavaScript the call runs with no warning and, if the function adds (for example suma + suma * cota / 100), returns “10021” instead of 121.

The `tsc` compiler (or a build tool) checks the types, strips the annotations and emits JavaScript. Type errors are reported at compile time, not at runtime. The `any` type switches checking off for that value, so using it everywhere cancels the benefit.

TypeScript and JavaScript: the difference

They run the same JavaScript, in the same browser or the same Node.js, with the same libraries. TypeScript adds two things: types and a compile step. For a few scripts on a brochure site, plain JavaScript is enough. TypeScript pays off from a business application maintained by several people over years.

Our JavaScript Development page explains what we keep and what we clean up in an inherited JavaScript front end; our TypeScript Development page, how we migrate an existing project file by file.

Want an estimate for your project?

Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.

Book a free call

TypeScript 7 and the native compiler

TypeScript 7.0, released on 8 July 2026, is the native port of the compiler, written in Go. It installs as the same `typescript` npm package and the command is still `tsc`. Microsoft reports full builds typically 8 to 12 times faster than 6.0 (for example 11.9 times on the VS Code codebase). The `strict` mode stays on by default, as since 6.0, and the options `target: es5`, `baseUrl`, `downlevelIteration` and `moduleResolution: classic` were removed. TypeScript 6.0 (23 March 2026) is the last release on the old JavaScript-based codebase.

What does not work yet in 7.0: it ships without a programmatic API, and template checking for Vue, Svelte, Astro, MDX and Angular does not work; for those projects Microsoft recommends TypeScript 6.0, which runs alongside through the `@typescript/typescript6` package (command `tsc6`). TypeScript 7.1 Beta (20 October 2026) brings the new API and first adapters for Vue, Svelte, Astro and MDX (prototyped or initial implementations); the release candidate is announced for “about a month”, with no date, and the final release shortly after.

For a buyer: an older project on TypeScript 5.x is not urgent, but a supplier should be able to say which version they work on and why.

Running .ts files directly in Node.js

Browsers do not run TypeScript, but Node.js does: from v23.6.0 and v22.18.0 it can run .ts files with no compile step, and the feature is stable from v25.2.0 and v24.12.0. The current long-term support (LTS) line is Node.js 26. The widespread claim that “TypeScript does not run directly in JavaScript engines” is out of date for Node.js.

Node.js only strips the types, it does not check them. It ignores tsconfig.json, does not run syntax that produces runtime code (`enum`, `namespace` with code, constructor parameter properties), requires the `.ts` extension in imports and does not support `.tsx`. Type checking remains the job of `tsc --noEmit` in the build or CI, and in the browser compilation is still required.

What TypeScript means for a company commissioning an application

An offer saying “we build in TypeScript” is normal practice, not a pricing gimmick: Next.js, for example, creates TypeScript projects by default. An inherited JavaScript application is not rewritten; in our practice it is migrated gradually, alongside maintenance.

The quality question at contracting: “strict TypeScript, or in name only?”. Since TypeScript 6.0, `strict` is on by default (and still is in 7.0), so a `"strict": false` in tsconfig.json means someone turned it off on purpose. The explanation is worth asking for.

Frequently asked questions

Does TypeScript make development more expensive?

Slightly at writing time, because type declarations take effort, less so with current tooling. In our experience the saving comes in maintenance: fewer production defects, safer changes, faster onboarding of new people. This is not a measured figure, it is the practice of the projects we have delivered.

Our existing application is plain JavaScript: must it be rewritten?

No. TypeScript allows gradual adoption: files migrate individually, and JavaScript and TypeScript coexist in one project. In our typical projects, code touched during maintenance and new features are written typed, the rest waits. Require strict checks on new code, so the migration delivers the net, not just the file extension.

What does “strict TypeScript” mean, and why should I care?

Strict mode forces honest type declarations and handling of “might be missing” cases. Since TypeScript 6.0 (23 March 2026) it is on by default, and 7.0 keeps the rule, so `"strict": false` in tsconfig.json means someone turned it off on purpose; ask why. An auditor checks this in minutes, and checks excessive use of `any` the same way.

TypeScript or JavaScript: which is better?

Neither in general, since both run on the same engine. Plain JavaScript is enough for small scripts. TypeScript wins on applications maintained by several people over years, where types prevent change errors. The choice depends on the size and lifespan of the project.

Is TypeScript still worth it in 2026?

Yes. According to GitHub Octoverse 2026 (28 October 2026), TypeScript is the most used language by monthly contributors, for the second year running. It has a native compiler since TypeScript 7.0, and Next.js creates TypeScript projects by default. The metric is contributor count, not lines of code.

What is the latest version of TypeScript?

On 18 November 2026 the stable version on npm is 7.0.2 (published 8 July 2026), and 7.1 has been in beta since 20 October 2026. TypeScript 6.0 (March 2026) was the last release on the old JavaScript-based codebase. Check the `typescript` package on npm for the current state.

Can a browser or Node.js run TypeScript code directly?

A browser cannot. Node.js can, from v22.18.0 and v23.6.0, but it only strips the types without checking them. Checking stays with `tsc --noEmit`. `enum`, `namespace` with runtime code and `.tsx` are not supported, and imports need the `.ts` extension.