TypeScript has conquered the world of JavaScript. Identified in developer surveys as one of the world's fastest growing and most popular languages, TypeScript is widely used in consumer and business companies across the world and is frequently credited for helping massive web applications scale. But what exactly is TypeScript? How and why does it work, and how can we use it?
This practical book takes beginner and advanced JavaScript programmers alike from knowing nothing about "types" or "type systems" to full mastery of TypeScript fundamentals.
You'll
Benefits of TypeScript and general characteristics of its type systemWhy and how TypeScript is useful on top of "vanilla" JavaScriptHow to inform your type system by using development-only type annotationsHow TypeScript analyzes and understands code to help you augment your existing development patternsHow TypeScript helps you work with arrays, classes, functions, objects, and other important built-in JavaScript constructsHow to effectively use the plethora of TypeScript configuration options to tailor the TypeScript compiler to your teams and projectsA variety of IDE integrations such as automated refactors and intelligent code searches provided by TypeScript to help you develop quickly with fewer bugs
This book is short and to the point. Although it's more geared towards TypeScript beginners, the chapters pick up the pace quickly. I found the chapters on generics, mapped, and conditional types quite insightful. The author lets the examples speak for themselves without introducing unnecessary fluff.
The chapter on mapped types contains some neat examples where the author mixed generics, conditional types, and mapped types together to demonstrate how powerful the type system can be. Another thing that's great about the book is how it warns the reader to be mindful of the outdated features. Here's one example that I loved:
Great book. Wonderful author. Hands down the best explanation of TypeScript I've ever seen. If I had to live on a desert island and could only bring three books, I'd bring two copies of this book and one blank book of equal size with a pen so I could transcribe it into a third.
Z tej książki nie nauczysz się programować w TS. Dowiesz się za to wszystkiego o typach w TS. Kiepska pozycja na początek bo dość przytłaczająca, ale za jakiś czas przewertuję ponownie - przyda się.
I started using TypeScript probably about a year ago when my team got assigned a project that used it. I picked up bits and pieces as I went along, and I got pretty good at using and expressing types concisely. But there were a couple of things that remained somewhat mysterious to me... declaration files, various configuration options, inference, conditional types, etc.. The very complex types people suggest on StackOverflow to solve some esoteric typing scenario read like sorcery to me. I figured I probably ought to get myself some kind of grounding in the language.
This book has been very good for my purposes. It did cover a lot of ground I had already more or less picked up on my own, but it also gave me a basic understanding of some of the more esoteric applications of TypeScript, and when they are useful, as well as illuminating the purpose and usage of the configuration options (the configuration section will remain a reference in my toolkit for some time, I imagine). I will likely re-read it in future (particularly Chapter 15, which covers Conditional Types) to shore up my understanding, because there's a lot to digest there, but for now I feel much more capable of engaging meaningfully with TypeScript-based projects.
Unfinished (I had the paperback version, not the ebook).
The title of this book is misleading. It should be called "Converting Javascript to Typescript". It explains only the types. That's it. You won't learn to program in Typescript.
I knew absolutely nothing about TypeScript beforehand. After reading this book and completing the projects, I feel confident in this language. The book itself is great, but the exercises are really the cherry on top. There are some typos in the code though. Overall, highly recommended.
Far from a page turner, but it conveys the information it sets out to. I felt like I knew a lot more about Typescript by the time I finished, but I also felt like I'd been reading an encyclopedia.