TypeScript A Decade On
Written by Mike James   
Wednesday, 12 October 2022

TypeScript, Microsoft's alternative to JavaScript created by Anders Hejlsberg first became public in October 2012. At the time Microsoft and JavaScript seemed an unlikely pairing - but TypeScript was a radical flavor of JavaScript that over time has proved popular. We have followed Typescript's progress from the beginning - here are some milestones.

typescriptlogo

In my initial report on TypeScript on October 1st, 2012 I wrote:

TypeScript is open source - Apache 2.0 license - and a superset of JavaScript. As you would expect from a Hejlsberg language it incorporates type checking, interfaces and lots of syntactic sugar. 

The good news is that it is compatible with JavaScript - you can simply load JavaScript code and run it. JavaScript programs are TypeScript programs. The TypeScript compiler outputs JavaScript so compiling a JavaScript program is just a pass through operation.  To improve on JavaScript, TypeScript lets you include annotations that allow the compiler to understand what objects and functions support. The annotations are removed by the compiler, making it a zero overhead facility. It also adds a full class construct to make it more like traditional object-oriented languages.

Concluding that report on TypeScript on October 1st, 2012, my opinion was wrote:

At this early stage it is difficult to see the development as good. It isn't particularly good for JavaScript developers who already have alternatives, and it isn't good for C# developers who now have confirmation that Anders Hejlsberg is looking elsewhere.

In a blog post "Ten Years of TypeScript", Daniel Rosenwasser, Microsoft's Senior Program Manager for TypeScript recalls that there was a lot of skepticism when the language was first unveiled, commenting:

To some JavaScript users, a team trying to bring static types to JavaScript might have sounded like an evil plot or a joke... So how was this team going to convince JavaScript developers of the value of static types in a dynamically typed language?

To a certain extent TypeScript has just hardened the debate on types versus no-types but it has given JavaScript developers the choice and in some environments TypeScript is preferred over JavaScript - notably DevOps where recently it surpassed JavaScript as the most popular programming languages, see Top 25 Languages for DevOps. The main reason suggested for TypeScript's ascendance was its type safety, enabling developers to identify bugs early on and another reason was types aiding collaboration across projects by making code easier to read.

TypeScript has evolved rapidly. It had already been underdevelopment at Microsoft for two years when it first became public. In June 2013, nine months after its debut it reached version 0.9, a release that is important for the inclusion of Generics and a re-engineered compiler. The first release candidate of TypeScript 1.0. arrived in February 2014 at the same time as we reported TypeScript Fully Accepted into Visual Studio.

In July 2014 the TypeScript project moved in its entirety to GitHub, something we reported as being in response to feedback from its community. This coincided with a new faster and lighter compiler that was able to compile existing real-world TypeScript code five times faster than the previous compiler.

TypeScript 2.0 arrived in September 2016. We reported that this version was more aligned with ECMAScript’s evolution, and had better support for JavaScript libraries and tools. Its headline features was the addition of some new types - null, undefined and never. Thanks to a frequent release schedule it was only about 18 months later we reported TypeScript 2.7 Improves Type Inference and two months after that, in April 2018, TypeScript Adds Conditional Types

The next major version, TypeScript 3.0, introduced project reference support - specifically tsconfig.json files can reference other tsconfig.json files and in general, according to Rosenwasser:

"means things like faster builds that work incrementally, and support for transparently navigating, editing, and refactoring across projects." 

This version also introduced the unknown type, a type-safe alternative to any, and the ability to use tuples in parameter lists.

TypeScript 4.0 arrived in August 2020 and while it didn't introduce any major breaking changes there were plenty of new features starting with variadic tuple types. 

Also in August 2020, Microsoft announced a new website for TypeScript with better code samples, improved visibility of JavaScript, and the use of a new TypeScript markup format called twoslash. Its Playground code explorer area was been redesigned to include interactive interwoven code samples within the existing documentation.TypeScript was given a new logo at the same time. 


typeslogo

We've reported the new releases in the TypeScript 4.x as they have arrived. One that stands out is TypeScript 4.5 which introduced a new utility type called Awaited. This can be used to model operations like await in async functions, or the .then() method on Promises, and in particular, the way that they recursively unwrap Promises.

The most recent release, in September 2022, TypeScript 4.8 was notable for a bug fix, eliminating a long-standing bug that until now has caused problems when some changes occurred in files in  --watch mode and editor scenarios. This sometimes manifested as displaying stale or inaccurate errors that might show up that require restarting tsc or VS Code. This problem should be consigned to history thanks to reworking of how it decides when to use a new watcher. 

According to Rosenwasser new features in TypeScript are also contributed to the wider JavaScript world:

Nowadays, when TypeScript is missing a useful runtime feature, we don’t just add it to TypeScript. We work within TC39 (the JavaScript standards body) to guide or champion new features so that all JavaScript developers can benefit from them.

More Information

Ten Years of TypeScript

TypeScript website

TypeScript On GitHub

Related Articles

TypeScript - Microsoft's Replacement For JavaScript

TypeScript 0.9 Released

New TypeScript Website Launched

TypeScript 4 Released

TypeScript 4.5 Adds Awaited

TypeScript 4.8 Improves Intersection Reduction

TypeScript 4.7 Adds Node.js ECMAScript Module Support

TypeScript 4.6 Improves Constructors

TypeScript 4.4 Improves Control Flow Analysis

TypeScript 4.3 Adds Separate Property Write Types

TypeScript 4.2 Release Candidate Available

TypeScript 4.1 Adds Temporal Literal Types

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Natives In Tech Accuse Apache Of Cultural Appropriation
13/01/2023

The Apache Software Foundation is being urged to change its name and the names of the projects it hosts by members of Natives In Tech, a collective of Native technologists crafting free and open  [ ... ]



More Rust - Chrome And Servo
18/01/2023

Rust is the language we are all expecting to save us and it has just scored two more goals. The Chromium project has decided to support it and Mozilla, the original home of Rust, has a revitalized Ser [ ... ]


More News

picobook

 



 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962420>

<ASIN:B0896SDK1Y>

 

 

 

 

Last Updated ( Wednesday, 12 October 2022 )