Giter VIP home page Giter VIP logo

type-level-typescript-workshop's Introduction

Type-Level TypeScript Workshop logo

by @flegall and @gvergnaud

Welcome to the ✨ Type-Level TypeScript Workshop ✨

Type-Level TypeScript is a course to take your TypeScript skills from intermediate to advanced. It will give you a solid understanding of the type system's fundamentals and guide you through its most advanced features. You will find everything you need to become a real TypeScript Pro — not only in-depth content, but also fun challenges to practice your new skills.

This repository contains many of these challenges. their difficulty gradually increases from beginner to super advanced! Give them a try!

Introduction

Over the years, the type system of TypeScript has grown from basic type annotations to a large and complex programming language. If you have ever looked into the code of an open source library you may have found types that looked intimidating and foreign, like some esoteric language coming from another planet.

Library code often needs to be much more abstract than the code we are used to writing; that's why it makes extensive usage of advanced TypeScript features such as Generics, Conditional Types, Mapped Types or even Recursive Types. I personally learned these concepts while working on TS-Pattern, an open-source library that has the particularity of being extremely hard to type. In this course, I hope to share what I've learned by reading too much source code and tinkering for hundreds of hours with the type system.

Note on naming conventions

While it's very common to use upper-case single letters for generics because it works well for simple types: Array<T>, it doesn't read very well when types become more complex.

In this workshop we will be using these naming conventions instead:

  • Generics should use TitleCase: type List<a> = ...
  • Type parameters should use camelCase: type List<first, restOfTheList> = ...
  • Inferred types (local variables), should use camelCase as well: type GetName<input> = input extends { name: infer name } ? ...

type-level-typescript-workshop's People

Contributors

brunocrosier avatar flegall avatar gvergnaud avatar morinokami avatar sandoche avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.