A programming language to address shortcomings of JavaScript. We can think brother and sister of JavaScript. JavaScript is kids like without any discipline who does whatever he or she wants. Typscript in otherhand like kids with discipline.
Technically, specking Typescript is programming language built on top of JavaScript. So, every JavaScript file is a valid Typescript file.
Benefits of Typescript or some of the features of Typescript that help us to build robust and maintainable application in less time.
- Static typing
- We have two type of programming languages Statically-Typed (C++, C#, Java) and Dynamically-Typed(JavaScript, Python, Ruby)
- Code completion
- Refactoring
- Shorthand notations
TypeScript is essentially JavaScript with Type Checking. With TypeScript we explicitly set the type of a variable upon decoration just like how we code statically type languages then we pass our code into compilier and the compiler will tell us if we are doing something wrong so we can catch our a lot of mistakes as compile time. We can use where in frontend or backend.
Drawbacks of TypeScript:
-
Compilation .ts ———> Compiler ———> .js Transpiration
-
Discipline in Coding TypeScript ——> Medium to large projects JavaScript ———> Simple projects
- Introduction to TypeScript
- Setting up the development environment
- Creating your first TypeScript program
- Configuring the TypeScript compiler
- Debugging TypeScript applications
- any Type
- Arrays
- Tuples
- Enums
- Functions
- Objects
- Type aliases
- Unions and intersections
- Type narrowing
- Nullable types
- Unknown type
- Never type
- OOP
- Classes
- Constructors
- Properties and Methods
- Access control Keywords
- Getters and setters
- Static members
- Index signatures
- Inheritance
- Ploymorphism
- Abstract classes
- Interfaces
- Generics classes
- Generics functions
- Generics interfaces
- Generics constraints
- Type Mapping
- What are decorators
- Class decorators
- Method decorators
- Property decorators
- Accessor decorators
- Parameter decorators
- Creating and using modules
- Module formats
- Default exports
- Wildcard imports
- Re-exporting
How to run JavaScript and TypeScript side by side.
- Including JS code in TS projects
- Type checking JS code
- JSDocs
- Declaration (Type Definition)
- Using declaration files from @types/
-
Building React applications with TypeScript.So we're going to build a relatively simple to do app that shows the essential concepts we need to know when building react appliactionswith TypeScript.
-
Creating a React App with TypeScript
-
Add Bootstrap
-
Creating a Component - Title
-
Using the State Hook
-
Calling the Backend
-
Using the Effect Hook
-
Handling Events
-
Building Form Submission
-
Additional Reading https://reactjs.org/docs/static-type-checking.html#adding-typescript-to-a-project
- npm start
- Build a relatively simple API using Node Express and TypeScript. With the basics of Node and Express and Integrated with TypeScript.