Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Peter O'Hanlon

Rating 3.5 AI initial rating

Advanced TypeScript 3.0 Projects is a complete resource filled with a wide range of web-based projects to help you in advancing with the latest TypeScript features and ECMAScript standards.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A project-driven tour of advanced TypeScript for developers who already know the basics and want to see the language's type system and tooling applied to real web apps—from decorators and generics to React, Angular, and a MEAN-stack backend. 【Book Arc】 - **Opening (~0%–10%)**: Sets the audience (readers comfortable with TypeScript basics) and lays the language groundwork—union and intersection types, type aliases, REST properties/parameters, decorators, mixins, generics, maps, and async/await—with Bootstrap for UI. - **Early (~10%–35%)**: Moves from features to small projects, including a plain HTML + TypeScript setup with a strict `tsconfig.json`, and a markdown editor built around the visitor pattern and DOM event handling. The emphasis shifts to requirements gathering and compiling to different ECMAScript targets. - **Middle (~35%–55%)**: Builds a React application using `.tsx` components, explaining why the extension exists, how `ReactDOM.render` and `as HTMLElement` work, binding for input updates, and intersection types for record state. Then introduces the MEAN stack (MongoDB, Express, Angular, Node.js) and its MERN variant. - **Late (~55%+ of sampled excerpts)**: Begins the Angular portion; the excerpts do not cover the remaining chapters or projects in detail. 【Key Takeaways】 - **Union types beat `any` for constrained inputs** (Opening): the range-validation example shows `any` compiles but fails at runtime, while a union type enforces string-or-number at compile time—the book's recurring argument for letting the type system do the checking. - **Inspect the emitted JavaScript** (Early): compiling the same REST-parameter function to ES5 versus ES2015 reveals the loop TypeScript generates versus native syntax. The author treats this as a core learning habit, not an optional curiosity. - **Maps fit key-value lookups that classes would over-engineer** (Early): a generic `Map<Genre, string[]>` replaces a class-per-genre design; the `AddArtist`/`Add` example also shows how a naive `set` silently overwrites prior values. - **Requirements gathering is treated as engineering, not paperwork** (Early): the markdown-editor project repeatedly returns to written requirements, warns against assumptions, and notes that requirements change and must be re-checked against existing work. - **`.tsx` exists because JSX is inlined markup** (Middle): the `<App />` syntax cannot live in a plain `.ts` file; the book explains the transpilation chain from TSX to JavaScript and the `as HTMLElement` cast that satisfies strict null checks. - **Intersection types compose state cleanly** (Middle): `PersonRecord = RecordState & IPersonState` adds an active flag to a person record without inheritance—useful for soft-delete patterns. - **The MEAN/MERN stack is a set of cooperating JavaScript technologies** (Middle): MongoDB (document store), Express (Node.js web framework), Angular or React (client), and Node.js (runtime), each explained by the problem it solves rather than by feature list. - **Separate validators from validation code** (Middle): the React project's regex-based phone/zip validation is organized so rules are reusable and testable independently of the form logic. 【Reading Tips】 - **Skim the language-feature chapter if you already know unions, generics, and decorators**; deep-read the compiled-output comparisons, which are where the author's real teaching happens. - **Type along with the projects**—the book is structured as builds, and the `tsconfig.json` strictness settings are worth copying into your own work. - **Watch for the requirements sections**: they are short but carry the book's software-engineering message; skipping them loses the "why" behind each project. - **Expect framework churn**: React and Angular APIs move fast; treat the framework chapters as pattern demonstrations (binding, component structure, state composition) rather than current-API references. 【Coverage Limits】 The sampled excerpts cover roughly the first half of the book—language features, the markdown editor, the React project, and the start of the MEAN/Angular material. Later projects and chapters are not represented, so this guide cannot assess them.
Excerpt 1
who are comfortable with at least the basics of TypeScript. If you know how to use the TypeScript Compiler, tsc, to build a config file and compile code, and...
View in text
Excerpt 2
g(log); instruments.forEach(function (instrument) { console.log(instrument); }); } When we look at the JavaScript produced from an ES2015 compilation (you wi...
View in text
Excerpt 3
problem using particular and well-established code examples. F or instance, i f we say to another developer that we are solving a problem using a mediator pa...
View in text
Excerpt 4
remove the need to manually update inputs or trigger events. The idea behind using a binding is that the framework establishes a connection between a UI elem...
View in text
Excerpt 5
ton that triggers the opening of the side-navigation drawer. In the mat-sidenav-content section, add the following: <mat-toolbar color="primary"> <button typ...
View in text
Excerpt 6
e have added a bit of styling to our picture-card-layout : .picture-card-layout { width: 25%; margin-top: 2%; margin-bottom: 2%; } It would be good to see wh...
View in text
Excerpt 7
nst value = this.GetDateDifference(...[new Date(), TodoItem.CreationDate]); if (value === 0) { return 0; } return Math.round(value / this.milliSecondsPerDay)...
View in text
Excerpt 8
e Remove method, it only needs the Id as the input argument. As we only intend to update the Completed field, that is the only field that we are going to tou...
View in text
Tags
AI categories
TypeScriptWeb TechnologyJavaScript
Publisher: Packt Publishing
Publish Year: 2019
Language: English
File Format: EPUB
File Size: 9.9 MB