Review: Typescript Deep Dive by Basarat
If you are a JavaScript developer who wants to explore TypeScript without investing too much time, this book is the perfect choice.
Rather than jump straight into TypeScript, the book started off with a good refresher on how inheritance works in prototypal language of JavaScript and how TypeScript makes it easier to use it.
The first part of the book discusses basic typing and a bunch of latest JavaScript(ES6) features which can be used readily with out having to worry about backward compatibility. Arrow functions, destructuring, template strings, are some of many cool features that are discussed.
The author then describes how to manage a TypeScript project also including notes about modules, ambient declarations, declaration spaces, and namespaces. Ambient Declarations are awesome, as they make writing code that depends on third party libraries a pleasant experience. They help with intellisense and also for enforcing proper usage of the libraries.
Next, the TypeScript type system is comprehensively covered and a migration guide is offered for existing JavaScript projects. A few useful tips follow, and the discussion here starts to get too deep - TypeScript internals. You can totally skip this part if you are not looking to get into developing TypeScript itself.
There are a few typos here and there in the book, and some speculations about functionality that did not exist at the time of writing, but would be released in future. These should get fixed in new revisions since the book is written openly on gitbook.
Finally, if you ever defined a class, or worked with closures, anonymous functions, or understand intricasies of variable scope, used coffee script, or even if you just like to write clean JavaScript code, you will enjoy reading this book.
Through out the book, having a live editor that compiled .ts to .js is very helpful in understanding the examples and to fiddle with them.
Tip: Visual Studio Code + tsc watch mode + lite-server = Awesome!
You can download the book here.