Long-Term Vision: Types in JavaScript
You'll learn how TypeScript's collaboration with TC39 on bringing native type syntax to JavaScript itself could reshape TypeScript's role in the ecosystem.
The Collaboration with TC39
TypeScript and the TC39 committee (which governs JavaScript's evolution) are exploring a future where type annotations could exist natively in JavaScript files. This doesn't mean JavaScript would perform type checking — rather, the JavaScript runtime would simply ignore the type syntax, treating it as comments.
What This Means for TypeScript's Future Role
Instead of being a separate language that must be transpiled, TypeScript could become:
- A type checker for JavaScript — You'd write
.jsfiles with type annotations, and TypeScript would validate them without needing to transform the code - Optional, not mandatory — Browsers and Node.js would run typed JavaScript directly, no build step required for simple projects
- One ecosystem, not two — The split between "JavaScript files" and "TypeScript files" would blur
The Analogy: Built-In Comments vs External Documentation
Think of it like this: Today, you write comments in your code, but the documentation tool (like JSDoc) reads those comments. Similarly, type syntax would live in JavaScript, but TypeScript (the tool) would read and validate it.
TypeScript's Evolving Purpose
If this vision succeeds:
- TypeScript the language becomes less distinct from JavaScript
- TypeScript the tool becomes more essential as the de facto type checker
- The compiler's job shifts from "translate TypeScript to JavaScript" toward "validate types that are already JavaScript-compatible"
This would validate TypeScript's original goal: enhancing JavaScript without fragmenting it.
Key Takeaway: TypeScript's long-term vision involves native type syntax in JavaScript itself, transforming TypeScript from a separate language into the standard type-checking layer for JavaScript — making types native but optional, checked but not executed.