Marius Schulz
Marius Schulz
Front End Engineer

Angular 2 and TypeScript

Yesterday at #ngconf, the program manager of the TypeScript team at Microsoft, Jonathan Turner, announced that his team and the Angular team at Google have been working together on Angular 2 for the last couple of months. They also unveiled that Angular 2 will be based on TypeScript rather than AtScript, which was only introduced in October 2014.

#TypeScript vs. AtScript

TypeScript is a superset of JavaScript that adds optional static typing to the language. It typechecks your programs at compile-time and then transpiles them to pure JavaScript. At this point, all type information is gone, thus making TypeScript a tool used only during development.

AtScript, on the other hand, is a superset of TypeScript which additionally adds runtime type annotations. It was created by Google as the language for the upcoming Angular 2 framework. Transpilers such as Traceur can automatically generate type assertion statements which perform type checking at runtime.

#The Future of TypeScript

Now, the TypeScript and AtScript languages have been converged, and Angular 2 will be built with TypeScript. I believe this will benefit both projects as it means type safety for Angular and more exposure for TypeScript. It's also nice to see Microsoft and Google cooperate on open-source software for the web.

Because of the collaboration of the TypeScript and Angular teams, AtScript is TypeScript now. The metadata annotation feature for which AtScript was built in the first place has found its way into the upcoming TypeScript 1.5 release. For more information on what's shipping with this release, check out the TypeScript roadmap.

#Migrating to Angular 2

Last October when Angular 2 was first talked about publicly, I was a little skeptical of the path the Angular team chose for their second major version: an entirely new syntax, lots of breaking changes, a new programming language for development, and no migration path for existing projects.

After watching the ngconf keynote and going through the keynote slides, I feel a lot better now. I find it relieving to see that the Angular team seems to have been listening to the community reactions: They will offer a migration guide allowing for incremental migration of existing Angular applications.

#The Future of Angular

As stated in the keynote, the Angular team envisions Angular 2 to be

  • simpler,
  • consistent,
  • fast,
  • flexible, and
  • productive.

All of that sounds good to me, and right now I'm optimistic. What I see is the possibility to develop rich client-side applications with a modern JavaScript framework in a type-safe manner, both at compile-time and at runtime. Hopefully, we'll see more robust applications and a better tooling experience, all enabled by static typing.

Angular 2, TypeScript, and ECMAScript 6: I think this is going to be good.