Programming TypeScript: Making Your JavaScript Applications Scale

Front Cover
"O'Reilly Media, Inc.", Apr 25, 2019 - Computers - 322 pages

Any programmer working with a dynamically typed language will tell you how hard it is to scale to more lines of code and more engineers. That’s why Facebook, Google, and Microsoft invented gradual static type layers for their dynamically typed JavaScript and Python code. This practical book shows you how one such type layer, TypeScript, is unique among them: it makes programming fun with its powerful static type system.

If you’re a programmer with intermediate JavaScript experience, author Boris Cherny will teach you how to master the TypeScript language. You’ll understand how TypeScript can help you eliminate bugs in your code and enable you to scale your code across more engineers than you could before.

In this book, you’ll:

  • Start with the basics: Learn about TypeScript’s different types and type operators, including what they’re for and how they’re used
  • Explore advanced topics: Understand TypeScript’s sophisticated type system, including how to safely handle errors and build asynchronous programs
  • Dive in hands-on: Use TypeScript with your favorite frontend and backend frameworks, migrate your existing JavaScript project to TypeScript, and run your TypeScript application in production
 

What people are saying - Write a review

We haven't found any reviews in the usual places.

Contents

Chapter 1 Introduction
1
A 10_000 Foot View
5
Chapter 3 All About Types
17
Chapter 4 Functions
45
Chapter 5 Classes and Interfaces
83
Chapter 6 Advanced Types
113
Chapter 7 Handling Errors
159
Chapter 8 Asynchronous Programming Concurrency and Parallelism
173
Chapter 13 Conclusion
267
Appendix A Type Operators
269
Appendix B Type Utilities
271
Appendix C Scoped Declarations
273
Appendix D Recipes for Writing Declaration Files for ThirdParty JavaScript Modules
275
Appendix E TripleSlash Directives
283
Appendix F TSC Compiler Flags for Safety
285
Appendix G TSX
287

Chapter 9 Frontend and Backend Frameworks
199
Chapter 10 NamespacesModules
215
Chapter 11 Interoperating with JavaScript
229
Chapter 12 Building and Running TypeScript
249
Index
291
About the Author
303
Copyright

Other editions - View all

Common terms and phrases

About the author (2019)

Boris Cherny is a Software Engineer at Facebook and the organizer of the San Francisco TypeScript Meetup. A longtime JavaScript programmer and functional programming evangelist Boris has started several startups, and led engineering teams in adtech and venture capital. In his free time, you can find him working on open source on Github.