Book Image

Learn TypeScript 3 by Building Web Applications

By : Sebastien Dubois, Alexis Georges
Book Image

Learn TypeScript 3 by Building Web Applications

By: Sebastien Dubois, Alexis Georges

Overview of this book

TypeScript is a superset of the JavaScript programming language, giving developers a tool to help them write faster, cleaner JavaScript. With the help of its powerful static type system and other powerful tools and techniques it allows developers to write modern JavaScript applications. This book is a practical guide to learn the TypeScript programming language. It covers from the very basics to the more advanced concepts, while explaining many design patterns, techniques, frameworks, libraries and tools along the way. You will also learn a ton about modern web frameworks like Angular, Vue.js and React, and you will build cool web applications using those. This book also covers modern front-end development tooling such as Node.js, npm, yarn, Webpack, Parcel, Jest, and many others. Throughout the book, you will also discover and make use of the most recent additions of the language introduced by TypeScript 3 such as new types enforcing explicit checks, flexible and scalable ways of project structuring, and many more breaking changes. By the end of this book, you will be ready to use TypeScript in your own projects and will also have a concrete view of the current frontend software development landscape.
Table of Contents (15 chapters)

Installing VS Code

In this section, let's install the VS Code together.

Note that we will only cover the installation in Windows and Linux, as we don't own a Mac. Don't worry, though, the procedure is quite similar on macOS.

Windows

Let us assume that you have administrator privileges on your machine, but if you don't, note that you can also download a portable version, as shown in the following steps:

  1. Go to the official website of VS Code and download the installer: https://code.visualstudio.com:
  1. Click on Download for Windows:
  1. Once the installer has been downloaded, click on Run to start it:
  1. Click on Next >.
  2. Make sure to read the license agreement and get it reviewed by your favorite lawyer. Once you're fully aware of what it all means, click on the Next > button:
  1. Change the target location if needed, then click on Next >:
  1. Click on Next >.
  2. On the next screen, make sure to check the Add to PATH (available after restart) option. This is for ease of use only. Then, click on Next > and Install in the next screen.
  3. Once completed, click on Finish:

Congratulations, you're now officially among the cool kids with the code command on their machine.

Windows (shell)

On Windows, you can also easily install VS Code directly from the command line, for example using Chocolatey (https://chocolatey.org).

Linux (GUI)

For Linux, if you're using Ubuntu, you can really easily install VS Code using the native package manager of Ubuntu called Ubuntu Software:

Let's perform the steps as follows:

  1. Open Ubuntu Software.
  2. Then, search for Visual Studio Code and install it:
  1. Once you have found it, click on Install:

Installation should be pretty quick:

  1. Once completed, you should be able to start it:

The following screenshot shows that you are all ready to go:

Let's see how to do the same on Linux.

Linux (shell)

Now, if you're anything like us, at this point you are probably feeling nauseous already. You might not like installing software using a GUI.

Indeed, things have changed, it seems. However, rejoice because if you prefer the command line, then you can still do it (phew!). Microsoft loves open source, so they have great documentation: https://code.visualstudio.com/docs/setup/linux.

For Debian/Ubuntu-based distributions, follow these steps:

  1. Open the Terminal.
  2. Download the latest .deb package from the official website: https://code.visualstudio.com/docs/?dv=linux64_deb.
  3. Execute the following commands:
    • sudo dpkg -i <file>.deb
    • sudo apt-get install -f

Extensions

In order to install extensions for VS Code, you have two options:

  1. First, you can visit the Visual Studio Marketplace and install extensions from there through the Install links, which will open up in VS Code (that is, vscode:// links):

  1. Once you're on an extension's page, click on Install:

And if all goes well, VS Code should be opened and it should ask whether you would like to install the extension:

This approach is nice because it allows you to easily browse the catalog of extensions. As an alternative, you can use Ctrl + Shift + X (Windows and Linux) in order to install extensions directly from within VS Code:

Here's a small list of nice-to-have extensions (in no particular order). You will not need to have any of these for the purposes of this book, but they'll probably help you, should you decide to install them:

You can find a ton more on the official Marketplace website: https://marketplace.visualstudio.com/vscode.