DEV Community

Remo H. Jansen
Remo H. Jansen

Posted on

TSConf 2019: Types on every desk, in every home, for every JS developer

Alt Text

I was fortunate to join the second TypeScript conference last Friday, and, in this blog post, I would like to share my thoughts about it.

About my expectations

There were no big announcements or surprises in TSConf 2019, but I was not disappointed. When I decided to join TSConf 2019, I was not expecting big surprises. TypeScript is an open-source project, which means that there are not many secrets about it. If you want to know what are the most recent additions to the language, all you need to do is to visit the GitHub repo.

Also, I'm very enthusiastic about TypeScript, and I try to stay up to day regularly, so I was also not expecting to learn a lot of new things. My main reason for attending the conference was to meet the TypeScript team and other members of the community once more.

I was not disappointed. I enjoyed the talks, learned about some cool new projects, and met other members of the TS community.

The keynote

The day started with a keynote by Anders Hejlsberg about the evolution of the TS community and all the new features since TSConf 2018.

A few months ago, Daniel Rosenwasser wrote that he would like to see "Types on every desk, in every home, for every JS developer". Well, it looks like it is happening!

Alt Text

Alt Text

It was nice to see how much the language has improved in a bit over a year. We get a new release every couple of months, and it is easy to forget how much the TS can evolve in just one year. The main improvements have been:

  • Better error developer experience. The error messages have been formatted, so we don't see more pyramids of doom in the error messages:

Alt Text

  • Build performance improvements, in particular, the build of large codebases.

  • Improvements in the type system, in particular, improvements in the support for functional programming patterns.

Pushing the type system to the limit

You may have heard that the TypeScripts type system is Turing complete. Being Turing complete means that it is possible to implement any computable problem using only the type system. The name is a reference to the Turing machine. I do understand the implications of this. However, I have never been able to imagine how one could do such a thing. Josh Goldberg showed us how to implement basic operations such as addition with binary numbers (Binary Arithmetic) using the TypeScript type system. The talk was entertaining, and it helps to realize how powerful the TypeScript type system can be when it is pushed to the extream.

Alt Text

Josh's talk was my favorite talk of the day, and I encourage you not to miss it once it is available online.

An exciting alternative to Node.js

Deno is an alternative to Node.js from Ryan Dahl (the original creator of Node.js). It tries to reduce the complexity of the tooling around Node.js by simplifying its module system. Deno also supports .ts files and includes some built-in tools such as a bundler and a code beautifier. I was interested in Deno before, but I didn't know that version 1.0 is expected to be out before the end of this year.

Testing types with dtslint

Dan Vanderkam introduced us to dtslint, a utility that allows us to test type definitions. This project is only useful for people that are interested in contributing to the TypeScript type definition files of JavaScript libraries that can be found at the DefinitelyTyped. I was not aware of this project. I guess that this is the case for many of us because this project has a small number of stars on GitHub.

TypeScript in microcontrollers

The Static TypeScript project is a compiler that allows us to compile a subset of TypeScript into machine code that can be executed in microcontrollers. This project is very interesting because it enables web developers to experiment with embedded applications without having to learn a completely different toolchain. The project is used by MakeCode. A tool that allows kids to learn to code.

Making a case for types at Netflix

Lauren Tan explained to us how difficult it was to make a case for types in JavaScript at Netflix. In the end, the main problem turned out to be a communication problem. Lauren managed to make a case for types by demonstrating that the more concrete a type definition is, the less likely we are to encounter a problem. This story has a happy ending, Netflix is now using TypeScript at scale without regrets and Lauren has been promoted to Engineering Manager πŸŽ‰

TalkScript with the TypeScript team

The day ended with a Q&A panel with some of the members of the TS team. Including Anders Hejlsberg (Technical Fellow), Daniel Rosenwasser (TypeScript Program Manager) & Ryan Cavanaugh (TypeScript Software Engineering Manager).

There were no surprises here, but there was a nice feeling of confidence and security. I think we can all trust that TypeScript is in good hands, and it is a technology that is going to continue to evolve in the right direction. The entire team wants to focus on:

  • Adherence to standards
  • Developer experience
  • Performance
  • More type-safety
  • Introduce complexity into the compiler only when it is truly justified.

I think no one in the community disagrees with these goals.

Alt Text

My takeaways

During the conference, there were a few projects that I found very interesting and that I plan to explore at home when I have some free time.

  • TypeScript is the new JavaScript, and we are close to having "Types on every desk, in every home, for every JS developer".

  • The literate-ts project is a utility that allows us to check TypeScript code snippets in documents. Dan Vanderkam created it while he was working on his upcoming TypeScript book Effective TypeScript. I have published a couple of books on TypeScript, and I have experienced some of the challenges that Dan described. In TypeScript, things move so fast than before you finish the book, the first few chapters could be already outdated! With literate-ts, we can keep track of breaking changes in all our code snippets in our documentation and ensure that they work with the latest version of TypeScript. Thank you, Dan! 😍

  • The deno project. Now that Deno is starting to be ready for production, I will play with it in the upcoming months for sure.

Summary

TSConf 2018 was a significant milestone. The language had matured, and its community was large enough to sell out the first conference dedicated exclusively to TypeScript. TSConf 2019, solidifies in this foundation with an even larger crowd and an ever-growing list of exciting projects. Please visit tsconf.io to learn more about future editions.

I'm writing this blog post while I wear my new TypeScript socks (thank you, TSConf! 😍) at the Seattle airport, and I cannot wait to see what TSConf 2020 will bring to the table!

Alt Text

Top comments (10)

Collapse
 
danvk profile image
Dan Vanderkam

Thanks for the kind words about literate-ts, Remo! I've found it extremely useful for Effective TypeScript and think it has great potential as a tool for other books and even blog posts. I'm curious what we'd need to do to verify your books using it.

Collapse
 
remojansen profile image
Remo H. Jansen

In the past I have worked with Packt Publishing and they don't use a markdown-based editing environment so it would be hard to integrate with literate-ts but in the future I plan to self-publish so that should not be a problem.

Collapse
 
danvk profile image
Dan Vanderkam

It currently works with Asciidoc (which O'Reilly uses for books) but it should be possible simple to extend to Markdown. Please get in touch if you'd like to work together on this!

Collapse
 
antonrusak profile image
Anton Rusak

Thanks for your great report Remo! TS is really an awesome language moving things forward.

Type system is Turing-complete. Mind = blown.

Collapse
 
expalmer profile image
Palmer Oliveira • Edited

How do I start with TS ?

Collapse
 
emptyother profile image
emptyother

If you know javascript ES6, you already know most of it. And if you know nodejs, you should be able to set up a compile step. Then just go through Microsofts own basic types documentation to figure out how to do types. Best part is that you don't need to know all of it.. You can slowly turn your javascript into typescript as you learn more.

I'd recommend you use VSCode as editor because of its very good integration with typescript. I've not tested it in editors like sublime or atom but I've tried VS2019, it is sub-optimal.

I would also recommend this git-book. Wow, they've added a lot of stuff since last time I've read it. But take the opinions in the book with a grain of salt.

Collapse
 
giogonzo profile image
Giovanni Gonzaga

Thanks for the summary ❀

Could you elaborate a bit on "Improvements in the type system, in particular, improvements in the support for functional programming patterns."?

Collapse
 
remojansen profile image
Remo H. Jansen

You can check what has been added in the last few releases here. In the blog post I was referring to a few additions that help while working with higher-order functions:

Anders did a few demos with good examples, so please check the recording of the talk once it is available online.

Collapse
 
giogonzo profile image
Giovanni Gonzaga

makes sense, thank you. I missed the keynote was about "all the new features since TSConf 2018", and not just the latest 3.7 :)

Collapse
 
gavinr profile image
Gavin Rehkemper

Any mention during the conference about getting TypeScript into Svelte?