Course contentsShow
← TypeScript
Lesson 1757 of 1,79640. The Future of TypeScriptFree lesson

Decorators: The Long Journey

How the decorators proposal evolved over years and TypeScript's experimental vs standard implementations.

Decorators: The Long Journey

You'll learn: How the decorators proposal evolved over many years and the difference between TypeScript's experimental implementation and the standard one.

Decorators have had one of the longest, most complicated histories in TypeScript. Think of it like a building project where the architectural plans kept changing while construction was already underway—TypeScript started building based on early blueprints, but the final approved design turned out quite different.

The Early Experimental Phase

TypeScript introduced decorators around version 1.5 (2015) based on an early Stage 1 TC39 proposal. These "legacy" or "experimental" decorators required the experimentalDecorators compiler flag and became widely adopted in frameworks like Angular.

The problem? The TC39 proposal kept evolving, and the final specification that emerged years later was fundamentally different from what TypeScript had implemented.

The Standard Arrives

After nearly a decade, decorators finally reached Stage 3 in 2022 and were standardized. But the standard decorators work differently:

  • Different signature and execution order
  • Different metadata handling
  • Different capabilities for parameter decorators
  • Not directly compatible with legacy experimental decorators

TypeScript's Dual Implementation

Starting with TypeScript 5.0, you now have two decorator systems:

  1. Experimental decorators (experimentalDecorators: true) — the original implementation most libraries still use
  2. Standard decorators (default in TS 5.0+) — following the finalized ECMAScript spec

You typically can't mix them in the same project. This creates a challenging migration path for the ecosystem.

Key Takeaway: Decorators took nearly a decade from experimental TypeScript feature to ECMAScript standard, and the two implementations are incompatible—most codebases still use experimental decorators while the ecosystem slowly migrates to the standard version.