Back to All Events

Advanced TypeScript Techniques

  • Holiday Inn Gent Expo Maaltekouter 3 9051 Gent Belgium (map)
Advanced TypeScript Techniques - Workshop - NG-BE 2023

Description

In this workshop, Stefan and Bernhard teach you TypeScript beyond the basics.

You learn about the inner workings of the type system, the trade-offs it makes, and how you can work around the most annoying TypeScript bugs.

After the workshop, you will have an eye for flaws and pitfalls in your code, and will write the most readable, robust, and helpful types for your code-base.

Join this workshop to become the TypeScript expert in your organization!

Trainers

  • Stefan Baumgartner

  • Bernhard Mayr

Schedule

07:30 - 08:30

  • Continental breakfast buffet with the trainers

08:30 - 10:30

The inner workings of TypeScript's type system

We start by learning all about the inner workings of TypeScript's type system. Where does it get its type information, how does inference work, and what techniques you have to describe your types.

  • Using annotation and inference to your advantage

  • The hidden power of overloads

  • Tuples and Variadic Tuples

  • Type vs Value Namespaces

  • Error Handling

  • Any, Never, Unknown

  • Using Declaration Merging

  • The troubles with Enums

10:30 - 11:00

  • Break with coffees, teas, juices, energizers and snacks

11:00 - 12:30

Meta Programming

Once we set the baseline, we start working with advanced type definitions based on conditional types, string template literal types, and generics. Here, we learn how to do meta programming in the type system, and if and how this is useful to you.

  • Conditional Types

  • Working with String Template Literal Types

  • Built-in Helper types

  • Defining Custom Helper Types

  • Rules and Guidelines for Meta Programming in the Type System

  • What does a type hold

  • Debugging and Testing Types

12:30 - 14:00

  • Lunch with fresh soup, salads, selections of cold and warm fish and meat dishes, dessert

14:00 - 15:30

Boundaries and Workarounds

TypeScript always needs to prepare for edge cases, that's why some of your scenarios might cause weird bugs and error messages in TypeScript, even though you are 100% certain that your code works. In this section, we see what common pitfalls you might encounter, what's the reason behind it, and how you can work around it.

  • Making unsafe operations visible

  • Patching built-in assumption

  • Working with Object.keys

  • Index Access Operations gone wrong

  • A small tale of fetch

  • Declaring boundaries

  • Type predicates, type assertions, assertion signatures

  • Validation Libraries

15:30 - 16:00

  • Break with coffees, teas, juices, energizers and snacks

16:00 - 17:30

Type Development

Last, but not least, we look into strategies on how we can write the best types for our software. Where can we leverage the incredible powers of TypeScript's type system, and where is it ok to stop.

  • Low Maintenance Types

  • Step by Step Refinement

  • Satisfies and other TypeScript 5 features

  • Handling multi-library project setups

  • Sharing Types

  • Dealing with complex type errors

  • Knowing where to stop


About Stefan Baumgartner

Stefan Baumgartner

Stefan Baumgartner is a software architect working at Dynatrace, and the owner of oida.dev. He is the author of “TypeScript in 50 Lessons”, published by Smashing Magazine, and the TypeScript cookbook, to be published by O'Reilly. He organizes ScriptConf, TSConf:EU, DevOne and Rust Linz. Stefan enjoys Italian food, Belgian beer and British vinyl records.

About Bernhard Mayr

Bernhard Mayr

Bernhard Mayr currently does his Psychology and Mobile Computing master's degrees.

Alongside studying, he is working as a software engineer at the SIMS research group at University of Applied Sciences Upper Austria. His research interests cross the boundaries between psychology and software engineering resulting in topics such as statecharts, hole-driven development, mental models and improving employee satisfaction beyond the scope of technology as the silver bullet.

Bernhard enjoys living in the Alps and doing sports without having to worry about work are the roots of his motivation to improve software and software engineering quality.