Transcript from the "Introduction" Lesson
>> Welcome, everybody to Professional TypeScript. I'm Mike North, I'm a senior staff engineer at LinkedIn, where I lead infrastructure product design. And I'm the company's TypeScript language expert. So today, we're going to be talking about the use of TypeScript in non-trivial projects. So we're calling this Professional TypeScript.
[00:00:22] And the idea here is we take you from knowing a little bit about the programming language. Such as having completed one of the earlier TypeScript courses in the Frontend Master catalog. To being able to be proficient with this language for your everyday use. One of the most important things I hope to leave you with at the end of this course is being able to speak about TypeScript in terms of the benefits it brings to your project.
[00:00:48] In addition to being aware of the limitations, and knowing how to de-risk some of those limitations, so to speak. So TypeScript is obviously a programming language, it's a compiler, right? We we run the TSC command in our command line, and it's also a language server. This is part of the magic behind Visual Studio Code, the thing that gives you those great autocompletes.
[00:02:46] As you get more and more code as more contributors during the project, things become more difficult to manage, right? It starts to become harder to keep these contracts between modules under control. And when I say that informal contracts grow organically, I'm not talking about organic groceries or organic food.
[00:03:07] And we're talking about organic mold that's growing in someplace you don't want it, right? This is the idea of things just keep getting added, and added, and added as people tack on more features. And you want things to sort of, at any given state, you want them to look like they were designed, with intent, right?
[00:04:23] So that they're caught as you're compiling your code before you even open a pull request, as opposed to being something that a user will report as a bug, right? Catching these things earlier is always a good thing. We're gonna learn about TypeScript today in the context of building a real world app, or a simplified version of one.
[00:04:44] And this of course, is Slack, right? Where you have several teams, each team has a channel or one or more channels, and the channel has messages here. So this is designed to be a non-trivial project. It's still small enough that we can get a feel for some of the real world challenges you're likely to face when using TypeScript every day as a professional and in production.
[00:05:12] The topics that we're going to talk about, begin with a little recap of recent advancements in the TypeScript programming language. So we're gonna talk about new language features that have been added. We'll touch a little bit on library versus app concerns, there are certain things that only libraries care about.
[00:05:31] We're going to go from an empty folder to my preferred set up for a TypeScript project. And this will include API documentation, it'll even help us understand for a given pull request. What are the ramifications on the API surface of my little library? So a lot of automation there with minimal tooling, just to keep things nice and simple.
[00:05:58] We're going to have a deep understanding by the end of this course around, how things build, how things are limited, and how to test them? And we're gonna really understand each one of these little config files that are in the project, so that you can take this back to your team.
[00:06:58] We'll talk about definitely typed, which is a community repository for ambient type information. This is where you would get types for something like react, or lodash. And dealing with these ambient type files, these declaration files is a bit tricky. There are things that you need to know about, how these work and what the limitations are?
[00:07:20] And I'll show you, how I debug these, and how I work with these? And set you up for success in the likely event that you find something wrong with one of these things. You will be able to go to GitHub and fix it, and keep your app moving.
[00:07:39] One of the biggest problems that we deal with in in the TypeScript world is runtime values, right? These are API responses we get from a JSON API. How do we deal with those when the TypeScript piece of your app, the type information it disappears after build time? How do we make sure that we're treating API responses in a way that keeps our type base guarantees strong?
[00:08:28] And then finally, towards the end of the day we'll talk about automated API change detection. Meaning, if you have a component and it makes certain, like functions available, how do you know when your contracts between things are changing? I'll introduce you to a tool called API Extractor that makes this process easier than you ever thought possible.
[00:08:51] And then finally, I'm gonna share some of the knowledge I have from LinkedIn about using TypeScript at scale, right? This is teams with 200 contributors and hundreds of code changes being merged every day. How does a project like that stay fast? And you can take some of these tips, and you can bring them into your own app.
[00:09:10] And if it makes a huge codebase fast, it'll make your app fast too. So with that, please click this link should be pretty easy to remember. Click this link, and it'll take you to a Git repo. And the next thing we're going to do is follow the instructions in the README.
[00:09:28] And be careful to read the README, there are some steps in there you may not have seen before. And we're gonna get set up with this workshop project, the Slack app.