万本电子书0元读

万本电子书0元读

顶部广告

TypeScript Blueprints电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Ivo Gabe de Wolff

出  版  社:Packt Publishing

出版时间:2016-07-01

字       数:123.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Build exciting end-to-end applications with TypeScript About This Book This book will help you whether you’re a beginner or an expert Complete and complex projects provide codes that are ready and solutions for start-ups and enterprise developers The book will showcase the power and depth of TypeScript when it comes to high performance and scalability Who This Book Is For This book was written for web developers who wish to make the most of TypeScript and build fun projects. You should be familiar with the fundamentals of JavaScript What You Will Learn Build quirky and fun projects from scratch while exploring widely applicable practices and techniques Use TypeScript with a range of different technologies such as Angular 2 and React and write cross-platform applications Migrate JavaScript codebases to TypeScript to improve your workflow Write maintainable and reusable code that is helpful in the world of programming revolving around features and bugs Using System.JS and Webpack to load *s and their dependencies. Developing highly performance server-side applications to run within Node Js. Reviewing high performant Node.js patterns and manage garbage collection. In Detail TypeScript is the future of JavaScript. Having been designed for the development of large applications, it is being widely incorporated in popular projects such as Angular JS 2.0. Adopting TypeScript results in more robust software, while still being deployable in apps where regular JavaScript would run. Scale and performance lie at the heart of the projects built in our book. The lessons learned throughout this book will arm you with everything you need to build amazing projects. During the course of this book, you will learn how to build a complete Single Page Application with Angular 2 and create a popular mobile app using NativeScript. Further on, you will build a classic Pac Man game in TypeScript. We will also help you migrate your legacy codebase project from JavaScript to TypeScript. By the end of the book, you will have created a number of exciting projects and will be competent using TypeScript for your live projects. Style and approach The book focuses on building projects from scratch. These end-to-end projects will give you ready-to-implement solutions for your business scenario, showcasing the depth and robustness of TypeScript.
目录展开

TypeScript Blueprints

TypeScript Blueprints

Credits

About the Author

About the Reviewer

www.PacktPub.com

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. TypeScript 2.0 Fundamentals

What is TypeScript?

Quick example

Transpiling

Type checking

Learning modern JavaScript

let and const

Classes

Arrow functions

Function arguments

Array spread

Destructuring

Template strings

New classes

Type checking

Primitive types

Defining types

Undefined and null

Type annotations

Summary

2. A Weather Forecast Widget with Angular 2

Using modules

Setting up the project

Directory structure

Configuring TypeScript

Building the system

The HTML file

Creating the first component

The template

Testing

Interactions

One-way variable binding

Event listeners

Adding conditions to the template

Directives

The template tag

Modifying the about template

Using the component in other components

Showing a forecast

Using the API

Typing the API

Creating the forecast component

Templates

Downloading the forecast

Adding @Output

The main component

Using our other components

Two-way bindings

Listening to our event

Geolocation API

Component sources

Summary

3. Note-Taking App with a Server

Setting up the project structure

Directories

Configuring the build tool

Type definitions

Getting started with NodeJS

Asynchronous code

Callback approach for asynchronous code

Disadvantages of callbacks

The database

Wrapping functions in promises

Connecting to the database

Querying the database

Understanding the structural type system

Generics

Typing the API

Adding authentication

Implementing users in the database

Adding users to the database

Testing the API

Adding CRUD operations

Implementing the handlers

Request handling

Writing the client side

Creating the login form

Creating a menu

The note editor

The main component

Error handler

Running the application

Summary

4. Real-Time Chat

Setting up the project

Configuring gulp

Getting started with React

Creating a component with JSX

Adding props and state to a component

Creating the menu

Testing the application

Writing the server

Connections

Typing the API

Accepting connections

Storing recent messages

Handling a session

Implementing a chat message session

Connecting to the server

Automatic reconnecting

Sending a message to the server

Writing the event handler

Creating the chat room

Two-way bindings

Stateless functional components

Running the application

Comparing React and Angular

Templates and JSX

Libraries or frameworks

Summary

5. Native QR Scanner App

Getting started with NativeScript

Creating the project structure

Adding TypeScript

Creating a Hello World page

Creating the main view

Adding a details view

Scanning QR codes

Type definitions

Implementation

Testing on a device

Adding persistent storage

Styling the app

Comparing NativeScript to alternatives

Summary

6. Advanced Programming in TypeScript

Using type guards

Narrowing

Narrowing any

Combining type guards

More accurate type guards

Assignments

Checking null and undefined

Guard against null and undefined

The never type

Creating tagged union types

Comparing performance of algorithms

Big-Oh notation

Optimizing algorithms

Binary search

Built-in functions

Summary

7. Spreadsheet Applications with Functional Programming

Setting up the project

Functional programming

Calculating a factorial

Using data types for expressions

Creating data types

Traversing data types

Validating an expression

Calculating expressions

Writing unit tests

Parsing an expression

Creating core parsers

Running parsers in a sequence

Parsing a number

Order of operations

Defining the sheet

Calculating all fields

Using the Flux architecture

Defining the state

Creating the store and dispatcher

Creating actions

Adding a column or a row

Changing the title

Showing the input popup

Testing actions

Writing the view

Rendering the grid

Rendering a field

Showing the popup

Adding styles

Gluing everything together

Advantages of Flux

Going cross-platform

Summary

8. Pac Man in HTML5

Setting up the project

Using the HTML5 canvas

Saving and restoring the state

Designing the framework

Creating pictures

Wrapping other pictures

Creating events

Binding everything together

Drawing on the canvas

Adding utility functions

Creating the models

Using enums

Storing the level

Creating the default level

Creating the state

Drawing the view

Handling events

Working with key codes

Creating the time handler

Running the game

Adding a menu

Changing the model

Rendering the menu

Handling events

Modifying the time handler

Summary

9. Playing Tic-Tac-Toe against an AI

Creating the project structure

Configure TypeScript

Adding utility functions

Creating the models

Showing the grid

Creating operations on the grid

Creating the grid

Adding tests

Random testing

Implementing the AI using Minimax

Implementing Minimax in TypeScript

Optimizing the algorithm

Creating the interface

Handling interaction

Creating players

Testing the AI

Testing with a random player

Summary

10. Migrate JavaScript to TypeScript

Gradually migrating to TypeScript

Adding TypeScript

Configuring TypeScript

Configuring the build tool

Acquiring type definitions

Testing the project

Migrating each file

Converting to ES modules

Correcting types

Adding type guards and casts

Using modern syntax

Adding types

Refactoring the project

Enable strict checks

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部