2022/07/30 (新增連結)
Everything you need to learn TypeScript in just 4 minutes **
Interfaces
Types
Utility types
Control Flow Analysis
Effective TypeScript: 62 Specific Ways to Improve Your TypeScript **
Getting to know TypeScript (Item1 to 5)
TypeScript’s Type System (Item 6 to 18)
Type Inference (Item 19 to 27)
Type Design (Item 28 to 37)
Working with any (Item 38 to 44)
Types Declarations and @types (Item 45 to 52)
Writing and running your code (Item 53 to 57)
Migrating your code (Item 58 to 62)
TypeScript, Part 1: An Introduction
Statically Typed vs. Dynamically Typed
The Benefits of Types
Top 5 TypeScript Features You Should Master
Unions
Generics
Tuples
Mapped Types
Type Guards
TypeScript Types Explained — A Mental Model to Help You Think in Types
A TypeScript Startup Guide for the Impatient
Installation and Setup
Your first TypeScript code
Making your tsconfig.son
Compile your code
Last step: put it into the index
Get Started With TypeScript — Part 1
Basic Types and What They Mean
Static Types vs. Dynamic Types
Get Started with TypeScript — Part 2
Setting Up VS Code
Compiling TypeScript the Hard Way
Compiling TypeScript the Easy Way
What’s a tsconfig?
Create a New Type for State
Adding Types to Our New State Type
Using Your New Type
Typescript in the real world — Why and how you should use it
Why
Typescript reduces the number of unit tests you need to write
Typescript helps you with regression
Typescript helps in discovering a project
How
Stop 1: At the beginning, was tsc, and tsc was with Typescript
Most basic usage
A word on config
Stop 2: And Typescript said: “Let there be types”
Basic typing
When to type
Stop 3: And Typescript said: “Let there be a vault between projects to separate projects from projects”
Typing libraries
Stop 4: And Typescript said: “I can’t think of another title”
Advanced types
Casting
Custom lib types
TypeScript Rescued the JavaScript Language: It brought scalability through static typing, improved developer tooling, and OOP features to a flawed and frustrating language for the web.
How TypeScript Fixed (some of) JavaScript?
A different, easier way to write JavaScript
Improved developer experience
Scalability & multiple output targets
Closes the junior-to-senior skill gap (slightly)
Interfaces, Type Guards, Unions, Intersections, Enums
TypeScript works by adding enhanced syntax to JavaScript and then transforming it to JavaScript after the TypeScript compiler does its own checks.
Why I always use TypeScript: The core reasons for why you should always use TypeScript instead of JavaScript
Is TypeScript the way forward?: Is it really checkmate for JavaScript?
To sum up the differences,
TS is known as an Object Oriented Programming language while JS is known as a scripting language(Although JS is Object Oriented)
TS includes support for optional parameters while JS does not support it.
TS has a feature known as static typing while JS has no such feature.
TS supports interfaces while JS does not.
7 really good reasons not to use TypeScript
It is risky
It is messy
It does not solve the problem
It is not a superset, it is a subset
It is open-source, but nothing more
But big companies use it…
But it has more features…
Please Put TypeScript Down for a Moment: In the era of typed JavaScript, sometimes we need to take a step back and weigh the negatives
3 tips I wish someone had given me when I started my adventure with TypeScript
The Ultimate TypeScript Development Configuration: How I configure for development with ts-node-dev, ESLint with Airbnb style guide, Prettier, and TypeScript
Gradually Migrating To Typescript: This article covers how to start using TypeScript modules in an existing project alongside JavaScript modules.
The Best Way To Create A New TypeScript Project
A common practice is to use a generator, template, boilerplate, or starter project.
Creating your own Application or Library
typescript-starter from @bitjison
A TypeScript tale — episode 1: The first of a series of articles about TypeScript
What is a type system?
Why do we use type systems?
Do they replace tests?
What can we do to introduce a type system in a JavaScript project?
A TypeScript Runtime Data Validators Comparison : Part 6: zod
A TypeScript Runtime Data Validators Comparison : Part 7: superstruct
4 simple steps you can take now to improve your TypeScript codebase
Make your TS Config as strict as possible so you can agree on naming conventions, avoid typing errors, etc
Use a linter and formatter tool so your team can focus on the real deal
Agree on a project architecture
Leverage the power of pair programming to solve complex issues
Union and intersection types
Keyof
Typeof
Conditional types
Utility types
Infer type
Mapped types
Solve any external library error in TypeScript with module augmentation
TypeScript: Use polymorphism in place of the switch and other conditionals : Write better code with OOP principles.
Test
TypeScript Unit Testing with Test Coverage : Walkthrough of a typed carousel with Formik and Styled Components integration
Faster TypeScript Testing with Baretest: Use this extremely fast and simple JavaScript test runner in a TypeScript project now
JSON
Object
Decorators
Error
Expressive error handling in TypeScript and benefits for domain-driven design
Try/Catch In TypeScript : Escape any error exception in Typescript 4.0 with unknown
Practical introduction to algebraic datatypes (ADTs) in TypeScript : Product types? Sum types? Variants? Unions? …in TypeScript?!
React
Typescript: Working with Paths, Packages and Yarn Workspaces
Type Yoga: Typing flexible functions with TypeScript’s advanced features
Building an ES6 application with the help of TypeScript's DOM types
4 Ways to Write More Effective TypeScript
Use Strict Mode
How TypeScript’s Strict Mode Actually Fixes TypeScript : There is no reason not to turn it on by default
Don’t Suppress Types
Don’t Ignore Type Guards
Don’t Ignore the Power of Generics
TypeScript Done Wrong : Top 5 mistakes you’re most likely making — the last one was a surprise to me too!
10 TypeScript features you might not be using yet or didn't understand.
Clean Code
How to Write Clean TypeScript Code : 8 knowledge points to write elegant TypeScript code
TypeScript tricks that allow you to scale your app endlessly
TypeScript Best Practices —Useless Interfaces, Classes, and Promises
TypeScript Best Practices — Namespaces, Exceptions, and Type Definitions
TypeScript Best Practices — Comparisons, Useless Types, and any
TypeScript Best Practices — Slash Directives, Types, and Unbound Methods
8 Best Practices for Future-Proofing Your TypeScript Code
Turn Strict Checks On
Use Babel Instead of tsc
Pin Your Versions
Opaque Types FTW
Use Utility Types
Use Prettier
Use Objects As Payloads for Functions
Use ESLint and SonarJS
Const
‘as const’ in TypeScript : What can the const assertion be used for?
How to Share Constants in Typescript Project
const keyword (single const file)
Multiple Constants Files and Generate types using typeof
I’ll Never Go Back to JavaScript: How I feel about Web Development after learning TypeScript
Basic Data Structures in TypeScript: Queues, stacks, linked lists, and generics
Positional Lists in TypeScript : Deal with Lists without dealing with indexes
GraphQL
Dependency Injection
Make your redux actions type-safe : Use TypeScript to type your redux store to avoid bugs
7 Advanced Usages of TypeScript : Are you coding a lot of redundant types? Here are some advanced features.
TypeScript on Testosterones — What Is AssemblyScript? : Getting started with WebAssembly easily
TypeScript — Into the Unknown : An introduction to the unknown type: a better any (typescript 3.0)
TypeScript 3.8 Finally Fixes Private Fields: The latest release borrows from ES10 to give you the encapsulation you always wanted
TypeScript 4.0 finally delivers what I’ve been waiting for : A list of generic params with good labels!
What’s New in TypeScript 4.5? : Awaited Type, type-only modifier, import assertions, and more
TypeScript Is Getting a Big Update! (Typescript 4.6 Beta)
Understanding Types in Typescript
Basic types (number, string, etc.)
Function Type
Tuples
Nullable Types
How to handle deeply-nested nullable fields in JavaScript and TypeScript
Option 0: A naive approach to traversing
Option 1: Enter idx
Option 2: Maybe: a monadic adventure
Option 3: Optional chaining (Typescript 3.7)
Enums
TypeScript allows us to convey enumeration using either enumeration types or literal types and it is possible to use both approached interchangeably. Personably, I prefer using literal types as the structure is way shorter and I get the same type support from the TypeScript compiler as compared to using enumeration types.
Enums vs String Literals in TypeScript
Use string literals over string enums all the times
If the values in string literals are harder to read or makes no sense, you can use const objects to give meaningful references.
For scenarios where a reference makes sense rather than a value, and it’s used for conditional logic, an enum can be used.
Top 8 functions you’ll ever need to work with Enums in TypeScript
Interfaces
Introduction to TypeScript (7 Types & Interface)
null & undefined Type
number & literal Type
any Type
void & never Type
object Type
intersection & union Type
enum Type
function Type
Interface
TypeScript: Anonymous Types, Type Aliases, and Interface Declarations : A complete guide on type definitions
There are three ways to define a type: Anonymous types, Type aliases, and Interface declarations
Sharing TypeScript Types between Backend and Frontend Repos : Keeping backend and client in sync with shared types and Bit
Introduction to TypeScript Data Types (Part 1): Null, void, undefined, never, and object types
Introduction to TypeScript Data Types (Part 2): Numbers, strings, and objects
As of TypeScript 4.1, there exist 4 intrinsic types : Lowercase, Uppercase, Capitalize and Uncapitalize
TypeScript: Anonymous Types, Type Aliases, and Interface Declarations
Type Annotation vs Type Inference in TypeScript : A look into how to add types to variables in TypeScript
How to Use TypeScript Generics: A quick tutorial on one of TypeScript’s best features
TypeScript: Typing Dynamic Objects and Subsets with Generics
In-Depth Look at TypeScript Generics: Part 1 — Intro to Generics
In-Depth Look at TypeScript Generics: Part 2 — Advanced Inference
React
Create wonders with advanced TypeScript types
Mapped types
An important TypeScript feature you might not be using yet : Mapped Types in TypeScript: Understand the syntax and create your own types
Conditional types
Combining mapped and Conditional types
Recursion in Typescript
Infer Type
Understanding TypeScript’s Type System
Theory Of Types
JavaScript vs TypeScript: Type Systems Compared
TypeScript’s Structural Type System
Type Erasure
Type Inference
TypeScript Advanced Types : Literal types and discriminated unions
TypeScript Utility Types Explained
Partial, Required, Readonly, Pick, Omit, Record, NonNullable, Extract, Exclude Types
Utility Types in TypeScript: Flexible Types for Every Occasion
Partial Types
Pick
Omit
5 Utility Types For Transforming Types in Typescript
Omit
Pick
Partial
Required
Readonly
Typescript: Five most useful utility types for React
keyof
Partial
Pick
Omit
Exclude
Introduction to TypeScript Utility Types: Part One : How to use Partial, Required, Pick, Omit, and Readonly
Introduction to TypeScript Utility Types: Part Two : How to use Record, Exclude, Extract, and NonNullable
TypeScript Utility Types — More Types === Less Code, Part II
TypeScript Utility Types — Less Code === More Types, Part III
TypeScript Utility Types — Less code === More types, Part IV