TypeScript in Action: A Practical Guide
Tags
Summary
Editor's review
Who it's for
A good fit for
- 有 JavaScript 基础、想把项目迁移到 TypeScript 的前端开发者
- 刚入门前端、希望系统掌握类型系统与工程配置的学生或转行者
- 需要在 React、Vue、小程序等多种技术栈中统一使用 TypeScript 的全栈工程师
- 负责团队技术培训、想找一本有作业与案例的教材的技术负责人
Not a good fit for
- 完全没有 JavaScript 与命令行基础的零起点读者
- 希望直接学习最新 TypeScript 版本新特性与最新框架用法的读者,本书案例基于 2019 年前后的工具链
- 只想查阅语法速查表、不打算跟着敲代码的读者
Reading tips
- 先通读基础篇并动手敲完每章示例,尤其是第2章的类型推导与类型保护,这是后续实战的地基。
- 实战篇不必按顺序全做,可挑选与自己技术栈相关的 2—3 章精读,其余章节浏览架构思路即可。
- 动手时注意依赖版本差异:Node、React、Vue CLI 等已多次大版本更新,遇到报错优先查阅官方文档而非照抄命令。
- 读完后拿一个自己现有的 JavaScript 小项目做迁移练习,配合第11章的迁移路径与 DefinitelyTyped 贡献流程。
About the publisher
In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.
Contents
- Preface
- Fundamentals
- Chapter 1 Hello TypeScript: Introduction (JavaScript and ECMAScript, TypeScript), Setting Up the Environment, Visual Studio Code, Hello World, Chapter Summary and Assignments
- Chapter 2 Types and Functions: Basic Types (variable declarations, generics, enums, symbol, iterator and generator), Advanced Types (interface, intersection and union types, type guards and discriminated unions, typeof and instanceof, type aliases, literal types, index types and mapped types, type inference), Functions (definition, parameters, callbacks and Promises, async and await, overloading)
- Chapter 3 Interfaces and Classes: Interface definition, function types, indexable types, extending interfaces; Class definition, implementing interfaces, inheritance, accessors, readonly properties, class methods and static properties, abstract classes
- Chapter 4 Namespaces and Modules: Single-file and multi-file namespaces, aliases, external namespaces; Exports and imports, generating modules, external modules
- Practice
- Chapter 5 Command-Line Application in Practice: Weather Query—Creating a Project (TSConfig, TSLint, Git), Commander.js, Handling Network Requests
- Chapter 6 Express in Practice: Backend Service—Initializing the Project and Husky, Connecting to the Database and Data Models, Express CRUD Interfaces
- Chapter 7 React in Practice: Desktop Website—create-react-app and TypeScript Configuration, React-Router and Redux Architecture, Editing Reminders, Implementing the List, Jest Testing
- Chapter 8 React Native in Practice: Client Development—Setting Up the Development Environment, Creating a Project, React Navigation and Redux Architecture, The List Page
- Chapter 9 Vue in Practice: HTML 5 Web Development—Creating a Vue Project, Writing TypeScript Code, vue-class-component, Network Requests and the List Page
- Chapter 10 Mini Program in Practice—Creating a Mini Program and WePY Project, Configuring TypeScript, Entry File, WePY Pages and Components, Optimizing for Native APIs
- Chapter 11 Project Migration and Community Contribution—Migrating from JavaScript to TypeScript, Migrating from Flow to TypeScript, Contributing Type Files, Following Updates
FAQ
这本书适合完全没有编程经验的人吗?
书中的示例代码现在还能跑起来吗?
这本书和《TypeScript入门与实战》有什么区别?
读完能到什么水平?
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.