By the end of the course, the viewer will be equipped to explain why TypeScript is advantageous for you and your team while also having a foundational knowledge of language features such as the type system, classes, interfaces, modules, and generics.
About The Author
Kamran Ayub is a WebApps consultant and has been associated with the web industry since 2000. He specializes in both front-end and back-end development, and is heavily involved in open source.
Kamran has used TypeScript in large-scale open source projects since version 1.0. Currently situated in Minnesota, he has given talks on Demystifying TypeScript and TypeScript in Action multiple times over the past few years to different audiences and at different conferences such as his own workplace, the Twin Cities Code Camp, Minnesota Developer Conference, and Midwest.js.
He has only received positive feedback on the sessions and is always excited to revamp them each year to update them and spread the love for TypeScript. He is excited to formally record a course on TypeScript where he can take the appropriate time to go over each of the topics he covers in his talks more in-depth and with the ability to focus on important points and explain.
We must set up a code editor to be able to use the TypeScript SDK and compile code, as well as edit files. This video will help walk through the installation process for Visual Studio Code, and explain the parts of the editor the user will need to be familiar with.
We will be using Node.js to work with modules and build a sample application later on, so we must install and configure it.
Learn how to set up your first TypeScript application and take advantage of the advanced editor tooling in the cross-platform Visual Studio Code editor.
Get started writing TypeScript by learning about basic types and syntax through implementing a base64 encoding function.
Now that we have a base64 encoding algorithm, you will learn how to leverage TypeScript interfaces to ensure that when we add new encoding implementations they have a consistent API.
Our base64 implementation only supports simple strings. We will use the Node.js runtime library to switch out our implementation while ensuring calling code still works as expected. TypeScript uses declarations to allow us to interact with third-party libraries.
By adding another encoder implementation, we'll see how TypeScript can help us ensure consistency within our codebase through interfaces.
A more robust application would accept arguments passed in from the command-line; so we will leverage the minimist npm module to add support, but we will also want to ensure only a small part of the code depends on minimist.
We have a working application, but it will be hard to test. We use a combination of TypeScript features and encapsulation to ensure we decouple our dependencies and ready our application for testing.
To help create maintainable code, the SOLID principles of software design can be used as a tool to help ensure our codebase stays in a testable and robust state.
Learn what the Jasmine testing framework is and how it works, so we can describe our application specifications so that we can test it. Once Jasmine is configured, write our first test and execute it using npm.
Our application code is not the only code we'd like to debug. We can leverage Visual Studio Code to interactively debug tests to help find and solve errors. We can also customize how Jasmine runs to display more verbose test output.
Draggabilly.js is a DOM manipulation library that has external dependencies. To begin the migration, we'll need to understand how it's built and put together.
To prepare to migrate the library, we will need to set up our TypeScript project and install any needed type declaration dependencies.
Where do you start when migrating to TypeScript? We'll cover adding declarations, type annotations, and common compiler errors.
To begin migrating the application, we will need to configure our Visual Studio project to add any dependencies and TypeScript project settings.
To convert the server-side code, we will go file-by-file and extract any type information we can share into shared interfaces. We will also see how we can leverage some more advanced TypeScript features to ensure how we can prevent the incorrect use of the Socket.IO API.
The sample Node library is a small URL parsing library part of the core Node runtime. It depends on two small modules that have no TypeScript declarations anywhere.
Before migrating the Node library, we will need to configure our TypeScript project in Visual Studio Code.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.