Learning TypeScript 2.x develop and maintain captivating web applications with ease
Exploit the features of TypeScript to easily create your very own web applications About This Book Develop modular, scalable, maintainable, and adaptable web applications by taking advantage of TypeScript Walk through the fundamentals of TypeScript with the help of practical examples Enhance your we...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham ; Mumbai :
Packt
[2018]
|
Edición: | Second edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631721906719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Introducing TypeScript
- The TypeScript architecture
- Design goals
- TypeScript components
- TypeScript language features
- Types
- Type inference and optional static type annotations
- Variables, basic types, and operators
- Variable scope (var, let, and const)
- Arithmetic operators
- Comparison operators
- Logical operators
- Bitwise operators
- Assignment operators
- Spread operator
- Flow control statements
- The single-selection structure (if)
- The double-selection structure (if...else)
- The inline ternary operator (?)
- The multiple-selection structure (switch)
- The expression is tested at the top of the loop (while)
- The expression is tested at the bottom of the loop (do...while)
- Iterate on each object's properties (for...in)
- Iterate values in an iterable (for...of)
- Counter-controlled repetition (for)
- Functions
- Classes
- Interfaces
- Namespaces
- Putting everything together
- Summary
- Chapter 2: Working with Types
- The TypeScript type system's characteristics
- The line between TypeScript and JavaScript
- Type inference
- Optional static type annotations
- Structural type system
- Core features of the TypeScript type system
- Union types
- Type aliases
- Intersection types
- Non-nullable types
- The
- strict mode
- The typeof operator
- Type guards
- Custom type guards
- Control flow analysis
- Literal types
- Discriminated unions
- The never type
- Enumerations
- Object literals
- Weak types
- The keyof operator
- Index signature
- Local types
- Type casting
- Advanced features of the TypeScript type system
- Generic types
- Generic constraints
- Mapped types
- Lookup types
- Mapped type modifiers
- Conditional types.
- The infer keyword
- Built-in conditional types
- The polymorphic this type
- Ambient declarations
- Type declarations - .d.ts
- Summary
- Chapter 3: Working with Functions
- Working with functions in TypeScript
- Function declarations and function expressions
- Function types
- Trailing commas in function arguments
- Functions with optional parameters
- Functions with default parameters
- Functions with REST parameters
- Function overloading
- Specialized overloading signature
- Function scope
- Immediately invoked functions
- Tag functions and tagged templates
- Asynchronous programming in TypeScript
- Callbacks and higher-order functions
- Arrow functions
- Callback hell
- Promises
- Covariant checking in callback parameters
- Generators
- Asynchronous functions - async and await
- Asynchronous generators
- Asynchronous iteration (for await...of)
- Delegating to another generator (yield*)
- Summary
- Chapter 4: Object-Oriented Programming with TypeScript
- Classes
- Strict property initialization
- Inheritance
- Depth of the inheritance tree (DIT)
- Access modifiers
- The public access modifier
- The private access modifier
- The protected access modifier
- Parameter properties
- Class expressions
- Static members
- Optional members
- Read-only properties
- Method overriding
- Generic classes
- Generic constraints
- Multiple types in generic type constraints
- The new operator in generic types
- Association, aggregation, and composition
- Association
- Aggregation
- Composition
- Mixins (multiple inheritance)
- The diamond problem
- Implementing mixins
- Iterables
- Abstract classes
- Interfaces
- SOLID principles, encapsulation, and polymorphism
- SOLID - the single responsibility principle
- Encapsulation
- SOLID - the open/closed principle
- Polymorphism.
- SOLID - the Liskov substitution principle
- SOLID - the interface segregation principle
- SOLID - the dependency inversion principle
- Summary
- Chapter 5: Working with Dependencies
- Third-party dependencies
- Package management tools
- The rise and fall of package management tools
- npm
- Type definitions
- Modules with native support for TypeScript
- Modules with external support for TypeScript
- Modules with no support for TypeScript
- The ECMAScript specification type definitions (lib.d.ts)
- External TypeScript helpers (tslib)
- Internal modules (module and namespace)
- Nested internal modules
- Cross-file internal modules
- Internal module aliases
- Compiling internal modules
- External modules
- Module loaders and module definition syntaxes
- External modules at design time and runtime
- ES6 modules (runtime and design time)
- Legacy external modules (design time only)
- AMD modules (runtime only)
- CommonJS modules (runtime only)
- UMD modules (runtime only)
- SystemJS modules (runtime only)
- Modules summary
- Managing dependencies in OOP
- Dependency injection versus dependency inversion
- Inversion of control containers
- InversifyJS basics
- Circular dependencies
- Summary
- Chapter 6: Understanding the Runtime
- The execution environment
- Understanding the event loop
- Frames
- Stack
- Queue
- Heap
- The event loop
- The this operator
- The this operator in the global context
- The this operator in a function context
- The call, apply, and bind methods
- Prototypes
- Instance properties versus class properties
- Prototypal inheritance
- The prototype chain and property shadowing
- Accessing the prototype of an object
- The new operator
- Closures
- Static variables powered by closures
- Private members powered by closures
- Summary.
- Chapter 7: Functional Programming with TypeScript
- FP concepts
- Pure functions
- Side effects
- Referential transparency
- Immutability
- Functions as first-class citizens
- Lambda expressions
- Function arity
- Higher-order functions
- The benefits of FP
- Is TypeScript a FP language?
- FP techniques
- Composition
- Partial application
- Currying
- Pipes
- Pointfree style
- Recursion
- Category theory
- Functor
- Applicative
- Maybe
- Either
- Monad
- Real-world FP
- Immutable.js
- Ramda
- React and MobX
- Summary
- Chapter 8: Working with Decorators
- Prerequisites
- Annotations versus decorators
- The class decorators
- The method decorators
- The property decorators
- The parameter decorators
- Decorators with arguments
- The reflect metadata API
- The decorator factory
- Summary
- Chapter 9: Automating Your Development Workflow
- A modern development workflow
- Prerequisites
- Node.js
- Visual Studio Code
- Git and GitHub
- Companion source code
- Source control tools
- Package management tools
- The TypeScript compiler
- Linting tools
- Working with npm scripts
- Gulp
- Controlling the gulp task execution order
- Passing in a callback to the task definition function
- Returning a promise
- Returning a stream
- Webpack
- Webpack development server
- Unit testing and test coverage
- Visual Studio Code
- Quick fixes
- Debugging utilities
- Source control utilities
- ts-node
- Continuous integration (CI) tools
- Scaffolding tools
- Why does the command line win?
- Summary
- Chapter 10: Node.js Development with TypeScript
- Understanding Node.js
- Understanding non-blocking I/O
- The main components of Node.js
- V8
- Libuv
- Bindings
- The Node.js core API (node-core)
- Node.js environment versus browser environment
- The Node.js ecosystem
- The Node.js core API.
- The style of the Node.js core API
- The npm ecosystem
- Setting up Node.js
- Node.js development
- Working with the filesystem
- Working with databases
- Working with REST APIs
- Hello world (http)
- Hello world (Express.js)
- Routing with Express
- Express middleware
- Architecting Node.js application - the MVC design pattern
- Model
- Repository
- Controller
- Database
- View
- Index
- Controllers and routing with inversify-express-utils
- Model, repository, database, and view
- Types
- Controller
- InversifyJS configuration
- Index
- Other applications of Node.js
- Summary
- Chapter 11: Frontend Development with React and TypeScript
- Working with React
- About the sample application
- Serving a React application with Node.js
- Working with react-dom and JSX
- Working with the react-router
- Working with React components
- Components as classes
- Properties and state
- Functional stateless components
- React component life cycle
- Smart components and dumb components
- Working with MobX
- Understanding the MobX architecture
- Working with actions and observables
- Dependency injection in MobX
- MobX alternatives
- Development tools
- Summary
- Chapter 12: Frontend Development with Angular and TypeScript
- Working with Angular
- About the sample application
- Serving an Angular application with Node.js
- Bootstrapping an Angular application
- Working with NgModules
- Working with Angular components
- Our first component
- Components and directives
- Data binding
- Working with @Attribute and @Input
- Using structural directives
- Using the <
- ng-content>
- directive
- Working with @Output and EventEmitter
- Working with the component's host
- Working with the Angular router
- Angular component life cycle hooks
- Working with services
- Smart components and dumb components.
- Dependency injection in Angular.