Preface

The TypeScript language and compiler has been a huge success story since its release in late 2012. It has quickly carved out a solid footprint in the JavaScript development community, and continues to go from strength to strength. Many large-scale JavaScript projects, including projects by Adobe, Mozilla, and Asana, have made the decision to switch their code base from JavaScript to TypeScript. Recently, the Microsoft and Google teams announced that Angular 2.0 will be developed with TypeScript, thereby merging the AtScript and TypeScript languages into one.

This large-scale industry adoption of TypeScript shows the value of the language, the flexibility of the compiler, and the productivity gains that can be realized with its rich development toolset. On top of this industry support, the ECMAScript 6 standard is getting closer and closer to publication, and TypeScript provides a way to use features of this standard in our applications today.

Writing JavaScript single page applications in TypeScript has been made even more appealing with the large collection of declaration files that have been built by the TypeScript community. These declaration files seamlessly integrate a large range of existing JavaScript frameworks into the TypeScript development environment, bringing with it increased productivity, early error detection, and advanced IntelliSense features.

This book is a guide for both experienced TypeScript developers, as well as those who are just beginning their TypeScript journey. With a focus on Test Driven Development, detailed information on integration with many popular JavaScript libraries, and an in-depth look at TypeScript's features, this book will help you with your exploration of the next step in JavaScript development.

What this book covers

Chapter 1, TypeScript – Tools and Framework Options, sets the scene for beginning TypeScript development, by firstly looking at the various benefits of using TypeScript, and then discussing how to set up a development environment.

Chapter 2, Types, Variables and Function Techniques, introduces the reader to the TypeScript language, starting with basic types and type inferences, and then moving on to discusses variables and functions.

Chapter 3, Interfaces, Classes and Generics, builds on the work from the previous chapter, and introduces the object-oriented concepts of interfaces, classes, and inheritance. It then introduces the reader to the syntax and usage of generics within TypeScript.

Chapter 4, Writing and Using Declaration Files, walks the reader through building a declaration file for an existing body of JavaScript code, and then lists some of the most common syntax used when writing declaration files. This syntax is designed to be a quick reference guide to declaration file syntax, or a cheat sheet.

Chapter 5, Third Party Libraries, shows the reader how to use declaration files from the DefinitelyTyped repository within the development environment. It then moves on to show the reader how to write TypeScript that is compatible with three popular JavaScript frameworks—Backbone, Angular, and ExtJs.

Chapter 6, Test Driven Development, starts with a discussion on what Test Driven Development is, and then guides the reader through the process of creating various types of unit tests using the Jasmine library, including data-driven and asynchronous tests. The chapter finishes with a discussion on integration testing, test reporting, and using continuous integration build servers.

Chapter 7, Modularization, looks at the two types of module generation that the TypeScript compiler uses: CommonJS and AMD. This chapter shows the reader how to build a CommonJS module for use with Node, and then discusses building AMD modules with Require, Backbone, AMD plugins, and jQuery plugins.

Chapter 8, Object-oriented Programming with TypeScript, discusses advanced object-oriented design patterns, including the Service Location Design Pattern, Dependency Injection, and the Domain Events Design Pattern. The reader is taken through the concepts and ideas of each pattern, and then shown how one might implement these patterns using TypeScript.

Chapter 9, Let's Get Our Hands Dirty, builds a single-page application using TypeScript and Marionette from the ground up. This chapter starts with a discussion on page layout and transition, using an HTML-only version of the application. It then moves on to discuss, build and test the underlying data models and Marionette views that will be used within the application. Finally, the State and Mediator Design Pattern is implemented to manage page transitions and graphical elements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.20.236