Author: : a tuque warehouse: Github Tuque community main station (first) : Tuque community blog: Excavation gold, Zhihu, MOOC public number: Tuque community contact me: after paying attention to the public number can add Tuque sauce wechat oh original is not easy, ❤️ like + comment + collection ❤️ three even, encourage the author to write a better tutorial.

origin

Tim berners-lee invented the WorldWideWeb in 1989 and released the world’s first Web browser, WorldWideWeb, in 1991, kicking off the Web era.

In 1994 Netscape made a splash when it released version 0.9 of Navigator, the first moderately mature web browser.

Brendan Eich, hired by Netscape, designed JavaScript in ten days in 1995. Then came the dark hour of browser compatibility and contention, and by 1997, when ECMA began publishing public standards, JavaScript was on the verge of standardization. Thanks to the ECMA standards, JavaScript is becoming more powerful and with Babel standards and browser implementation compatibility, we can write the most modern code without worrying too much about browser compatibility. In addition, node. js, React Native and other server-side and mobile JavaScript operation modes were born. No one would expect that today, twenty years later, JavaScript seems to confirm the advantage of Write Once Run Anywhere. Brendan Eich left his mark on the history of programming as the father of JavaScript.

Over time, Microsoft found that outside customers were struggling with the language’s shortcomings in developing large-scale JavaScript applications. In October 2012, Microsoft released the first public version of TypeScript on June 19, 2013. Microsoft has released TypeScript after a preview release. The latest version is TypeScript 3.9.

TypeScript is a strict superset of JavaScript, so any JavaScript is legitimate TypeScript (much like the RELATIONSHIP between C and Objective-C). TypeScript brings a powerful type system and ES2015 support to JavaScript, and its compilation tools can run on any server and task system. The type system is actually a very good document that enhances the editor’s ability in intelligent hints, jump definitions, code completion, etc., and can find most errors at compile time, which is a great contribution to the readability and maintainability of large projects.

TypeScript trends

In fact, TypeScript has an active community. Most third-party libraries provide TypeScript type definition files, and even well-known front-end and back-end libraries such as Google’s Angular are developed entirely in TypeScript. Nest.js, and some well-known UI component libraries, such as Ant Design of Ant Financial, And Material Design of Google:

Any libraries or frameworks we actually use in our daily work are built in TypeScript or are under investigation…

Here’s some data to get a sense of TypeScript trends:

What are the benefits and benefits of TypeScript?

  • The type system catches most errors at compile time
  • The type system is also an intuitive programming document that allows you to view the input and output types of any function or API
  • The type system enhances the functionality of an editor or IDE
  • TypeScript can automatically derive types
  • Everything JavaScript is legal TypeScript lowers the cost of use
  • TypeScript embraces the ES2015 and ESNext draft specifications
  • Almost all third-party libraries have TypeScript type definition files

Of course, there are always two sides to TypeScript. There are costs to learning about concepts like Interfaces, Generics, and Enums that front-end engineers are not familiar with, which can add some development costs in the short term, and some work to integrate and build libraries.

My observation

After understanding the advantages and trends of TypeScript, most people are eager to learn the powerful language. However, I found that there are few TypeScript learning resources on the market, and even fewer high-quality and free ones. I mainly refer to the following materials:

  • TypeScript official documentation: Now I am testing version V2 in A/B. The previous version V1 was boring, and many people died reading this document. However, the current version V2 has A clear hierarchy, which alleviates the fatigue of learning to A certain extent, but it is only friendly to students who need good English. If you are confident in your English, you can study and watch the V2 version of the document.
  • Check out TypeScript writing tips in React: typescript-Cheatsheets
  • Ruan yifeng’s TypeScript tutorial is short and concise.
  • TypeScript Deep Dive by Basarat, the maintainer of the DefinitedType community, and the Chinese version. This book is large and comprehensive, but recommended asa TypeScript query manual, not a good place to learn.
  • TypeScript Chinese, but it hasn’t been updated for a long time.
  • There’s more…

Effort and Gain

It is no doubt painful to read the above materials, so I hope to write a TypeScript primer series to help more people who want to learn TypeScript but can’t find a way to get started quickly. Therefore, this series of articles is developed: Type is Justice: TypeScript takes you from the get-go to the hands-on experience with a concise and in-depth look at some of the most commonly used TypeScript concepts, and then links them together with a do-it-yourself React to-do app. With over 30,000 words written, 111 likes, 4,845 views, and 16 comments, I hope this hands-on series of articles will make learning TypeScript a little easier.

Star code repository

Because all of the Tuture tutorials are written using Tuture, an open source writing tool developed by the Tuture community, and are based on one project, type is justice: The source code behind TypeScript from scratch is also proven and runs directly, which has encouraged many readers to download the source code and run the service themselves, thus giving the repository a Star. Thank you for your encouragement:

Warehouse address: github.com/tuture-dev/…

Of course, if you prefer Gitee, you can also find our source: gitee.com/tuture/type…

No one who can sum up has too much luck

Better learning to help dig the friends TypeScript development, is a good way, after digging friends of feedback and Suggestions, figure before birds community decided to send the article make a summarize, convenient leak fill a vacancy and system study, the following will make a outline, and then give the corresponding summary, then give the corresponding data visualization, Display the number of views, likes, comments, and words gained from this article. It helps digg friends to build a system, and at the same time, it is very convenient to understand a summary and data details of each article.

The outline

We’ll include the cover, link and abstract of each article below for readers to enjoy:

  • Type is Justice: TypeScript from Starter to Practice (Prologue) : Use create-React-app to quickly initialize a React TypeScript project and use the Ant Design component library to aid interface writing, using ANTD V4 dark mode. This allows us to focus on learning the core knowledge of TypeScript and quickly apply it to React projects, instead of talking about tsconfig.json and TypeScript compilation principles.

  • Learn about TypeScript’s type system, enumerations, and interfaces, and complete the interface and data preparation for our React to-do application.

  • Type is Justice: TypeScript from Getting Started to Practice (PART 2) : Explain TypeScript functions, cross types, union types, literal types, and type guards. We’ll just show you how TypeScript compares to JavaScript and how TypeScript works in JavaScript. Then we use what we have learned to implement the React backlog logic for state modification, function triggering, event handling, etc.

  • Type Aliases and classes: We introduce TypeScript aliases and classes that are similar to interfaces, analyze the unique features of TypeScript classes from the outside to the inside, and continue to complete some types and class components in the React to-do applet, and introduce the concept of generics.

  • I wrote an entire article on TypeScript generics, the foundation of TypeScript type programming, as well as how to build a TypeScript development environment from scratch.

– overview

Text data

The total number of writing words: 30,300, in each of the distribution as follows:

  • Type is Justice: TypeScript from Getting Started to Practice (prologue) : 2983 words
  • Type is Justice: TypeScript from Getting Started to Practice (I) : 8412 words
  • Type is Justice: TypeScript from Getting Started to Practice ii: 6933 words
  • Type is Justice: TypeScript from Getting Started to Practice (3) : Type aliases and classes: 6919 words
  • Rediscovering generics in 5,000 words: 5752 words

Here is the data

Tosparrow sauce

The first article is a small episode, but the following several articles are very even, the highest has 8000 ✌️

Reading overview

Text data

The total number of readings is 4845, which is distributed as follows:

  • Type is Justice: TypeScript from Starter to Practice (prologue) 1155 times
  • Type is Justice: TypeScript from Getting Started to Practice 1:1376 times
  • Type is Justice: TypeScript from Getting Started to Practice ii: 952 times
  • Type is Justice: TypeScript from Start to Practice (3) : Type aliases and classes: 988 times
  • Type is Justice: TypeScript from The Beginning to practice (4) : 5000 words that rediscover generics 374 times

Here is the data

Tosparrow sauce

Why the most important generic, read but little of the poor 🤕, can dry up!

Thumb up overview

Text data

The total number of likes received: 111, which is distributed as follows:

  • Type is Justice: TypeScript from Starter to Practice (prologue) : 34 upvotes
  • Type is Justice: TypeScript from Getting Started to Practice I: 28 upvotes
  • Type is Justice: TypeScript from Getting Started to Practice ii: 19 upvotes
  • Type is Justice: TypeScript from Getting Started to Practice (3) : Type aliases and classes: 20 likes
  • Type is Justice: TypeScript from The Beginning to practice (4) : 5000 words rediscovering Generics: 10 upvotes

Here is the data

Tosparrow sauce

Overall praise or a little low, praise point praise point praise, is my biggest power 😆

Overview of number of comments

Text data

The total number of comments was 16, which were distributed as follows:

  • Type is Justice: TypeScript from Starter to Practice (prologue) : 0 comments
  • Type is Justice: TypeScript from Getting Started to Practice I: 2 reviews
  • Type is Justice: TypeScript from Getting Started to Practice ii: 5 Reviews
  • Type is Justice: TypeScript from Getting Started to Practice (III) : Type Aliases and Classes: 9 Reviews
  • Type is Justice: TypeScript from Getting Started to Practice (4) : 5000 words rediscovering Generics: 0 reviews

Here is the data

Figure finches sauce

Is the programmer really cruel words not much? Comments a little less, want to hear your voice!

Summary and Prospect

This series of articles presents some of the most commonly used TypeScript knowledge points in a practical way. Times are changing. JavaScript is the only scripting language that implements Write Once Run Anywhere. But JavaScript has its own language flaws, and new standards may fill in the gaps in the future. At least for now, let’s use TypeScript to solve any problems you might face.

The resources

The TypeScript baidu encyclopedia: baike.baidu.com/item/typesc…

The origin of all things – from JavaScript to TypeScript:zhuanlan.zhihu.com/p/61345416

Sketch library: github.com/jwilber/rou…

Want to learn more exciting practical skills tutorial? Come and visit the Tooquine community.