官术网_书友最值得收藏!

TypeScript Basics

Facebook has become an incredibly popular app. As its popularity grew, so did the demand for new features. React was Facebook's answer to help more people work on the codebase and deliver features quicker. React worked so well for Facebook that they eventually open sourced it. Today, React is a mature library for building component-based frontends that is extremely popular and has a massive community and ecosystem.

TypeScript is also a popular, mature library maintained by a big company – namely, Microsoft. It allows users to add strong types to their JavaScript code, helping them to be more productive, particularly in large code bases.

This book will teach you how you can use both of these awesome libraries to build robust frontends that are easy to maintain. The first couple of chapters in the book focus solely on TypeScript. You'll then start to learn about React and how you can compose robust frontends using Typescript components with strong typing.

In this chapter, we'll cover TypeScript's relationship to JavaScript and the benefits it brings. A basic understanding of JavaScript is therefore required. We'll also cover the basics of TypeScript that you'll commonly use when writing code for the browser.

You'll come to understand the need to use TypeScript for building a frontend and the sort of projects for which TypeScript really shines. You will also see how to transpile your TypeScript code into JavaScript so that it can run in a browser. Last but not least, you'll learn how you can perform additional checks on your TypeScript code to make it readable and maintainable.

By the end of the chapter, you'll be ready to start learning how you can use TypeScript for building frontends with React.

In this chapter, we'll cover the following topics:

  • Understanding the benefits of TypeScript
  • Understanding basic types
  • Creating interfaces, types aliases, and classes
  • Structuring code into modules
  • Configuring compilation
  • TypeScript linting
  • Code formatting
主站蜘蛛池模板: 崇明县| 奎屯市| 松原市| 德安县| 南昌市| 郸城县| 石城县| 邳州市| 泽州县| 喀什市| 叙永县| 南宁市| 都江堰市| 鄱阳县| 长丰县| 普陀区| 新竹县| 贵州省| 五常市| 龙陵县| 长沙县| 沁水县| 金门县| 乌鲁木齐市| 香格里拉县| 寿光市| 阿勒泰市| 安义县| 白山市| 武穴市| 台江县| 米泉市| 务川| 土默特右旗| 玛纳斯县| 土默特右旗| 武夷山市| 孝昌县| 九江县| 东宁县| 泊头市|