
TypeScript: Modern JavaScript Development
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
All prices
More details
Content
- Cover
- Copyright
- Credits
- Preface
- Module 1: Table of Contents
- Module 2: Table of Contents
- Module 3: Table of Contents
- Module 1: Learning TypeScript
- Chapter 1: Introducing TypeScript
- The TypeScript architecture
- TypeScript language features
- Putting everything together
- Summary
- Chapter 2: Automating Your Development Workflow
- A modern development workflow
- Prerequisites
- Source control tools
- Package management tools
- Task runners
- Test runners
- Synchronized cross-device testing
- Continuous Integration tools
- Scaffolding tools
- Summary
- Chapter 3: Working with Functions
- Working with functions in TypeScript
- Asynchronous programming in TypeScript
- Summary
- Chapter 4: Object-Oriented Programming with TypeScript
- SOLID principles
- Classes
- Interfaces
- Association, aggregation, and composition
- Inheritance
- Generic classes
- Generic constraints
- Applying the SOLID principles
- Namespaces
- Modules
- Circular dependencies
- Summary
- Chapter 5: Runtime
- The environment
- The runtime
- The this operator
- Prototypes
- Closures
- Summary
- Chapter 6: Application Performance
- Prerequisites
- Performance and resources
- Performance metrics
- Performance analysis
- Performance automation
- Exception handling
- Summary
- Chapter 7: Application Testing
- Software testing glossary
- Prerequisites
- Testing planning and methodologies
- Setting up a test infrastructure
- Creating test assertions, specs, and suites with Mocha and Chai
- Test spies and stubs with Sinon.JS
- Creating end-to-end tests with Nightwatch.js
- Generating test coverage reports
- Summary
- Chapter 8: Decorators
- Prerequisites
- Annotations and decorators
- Summary
- Chapter 9: Application Architecture
- The single-page application architecture
- The MV* architecture
- Common components and features in the MV* frameworks
- Choosing an application framework
- Writing an MVC framework from scratch
- Summary
- Chapter 10: Putting Everything Together
- Prerequisites
- The application's requirements
- The application's data
- The application's architecture
- The application's file structure
- Configuring the automated build
- The application's layout
- Implementing the root component
- Implementing the market controller
- Implementing the NASDAQ model
- Implementing the NYSE model
- Implementing the market view
- Implementing the market template
- Implementing the symbol controller
- Implementing the symbol view
- Implementing the chart model
- Implementing the chart view
- Testing the application
- Preparing the application for a production release
- Summary
- Module 2: TypeScript Design Patterns
- Chapter 1: Tools and Frameworks
- Installing the prerequisites
- Installing Node.js
- Installing TypeScript compiler
- Choosing a handy editor
- Visual Studio Code
- Configuring Visual Studio Code
- Opening a folder as a workspace
- Configuring a minimum build task
- Sublime Text with TypeScript plugin
- Installing Package Control
- Installing the TypeScript plugin
- Other editor or IDE options
- Atom with the TypeScript plugin
- Visual Studio
- WebStorm
- Getting your hands on the workflow
- Configuring a TypeScript project
- Introduction to tsconfig.json
- Compiler options
- target
- module
- declaration
- sourceMap
- jsx
- noEmitOnError
- noEmitHelpers
- noImplicitAny
- experimentalDecorators*
- emitDecoratorMetadata*
- outDir
- outFile
- rootDir
- preserveConstEnums
- strictNullChecks
- stripInternal*
- isolatedModules
- Adding source map support
- Downloading declarations using typings
- Installing typings
- Downloading declaration files
- Option "save"
- Testing with Mocha and Istanbul
- Mocha and Chai
- Writing tests in JavaScript
- Writing tests in TypeScript
- Getting coverage information with Istanbul
- Testing in real browsers with Karma
- Creating a browser project
- Installing Karma
- Configuring and starting Karma
- Integrating commands with npm
- Why not other fancy build tools?
- Summary
- Chapter 2: The Challenge of Increasing Complexity
- Implementing the basics
- Creating the code base
- Defining the initial structure of the data to be synchronized
- Getting data by comparing timestamps
- Two-way synchronizing
- Things that went wrong while implementing the basics
- Passing a data store from the server to the client does not make sense
- Making the relationships clear
- Growing features
- Synchronizing multiple items
- Simply replacing data type with an array
- Server-centered synchronization
- Synchronizing from the server to the client
- Synchronizing from client to server
- Synchronizing multiple types of data
- Supporting multiple clients with incremental data
- Updating the client side
- Updating server side
- Supporting more conflict merging
- New data structures
- Updating client side
- Updating the server side
- Things that go wrong while implementing everything
- Piling up similar yet parallel processes
- Data stores that are tremendously simplified
- Getting things right
- Finding abstraction
- Implementing strategies
- Wrapping stores
- Summary
- Chapter 3: Creational Design Patterns
- Factory method
- Participants
- Pattern scope
- Implementation
- Consequences
- Abstract Factory
- Participants
- Pattern scope
- Implementation
- Consequences
- Builder
- Participants
- Pattern scope
- Implementation
- Consequences
- Prototype
- Singleton
- Basic implementations
- Conditional singletons
- Summary
- Chapter 4: Structural Design Patterns
- Composite Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Decorator Pattern
- Participants
- Pattern scope
- Implementation
- Classical decorators
- Decorators with ES-next syntax
- Consequences
- Adapter Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Bridge Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Façade Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Flyweight Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Proxy Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Summary
- Chapter 5: Behavioral Design Patterns
- Chain of Responsibility Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Command Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Memento Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Iterator Pattern
- Participants
- Pattern scope
- Implementation
- Simple array iterator
- ES6 iterator
- Consequences
- Mediator Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Summary
- Chapter 6: Behavioral Design Patterns: Continuous
- Strategy Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- State Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Template Method Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Observer Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Visitor Pattern
- Participants
- Pattern scope
- Implementation
- Consequences
- Summary
- Chapter 7: Patterns and Architectures in JavaScript and TypeScript
- Promise-based web architecture
- Promisifying existing modules or libraries
- Views and controllers in Express
- Abstraction of responses
- Abstraction of permissions
- Expected errors
- Defining and throwing expected errors
- Transforming errors
- Modularizing project
- Asynchronous patterns
- Writing predictable code
- Asynchronous creational patterns
- Asynchronous middleware and hooks
- Event-based stream parser
- Summary
- Chapter 8: SOLID Principles
- Single responsibility principle
- Example
- Choosing an axis
- Open-closed principle
- Example
- Abstraction in JavaScript and TypeScript
- Refactor earlier
- Liskov substitution principle
- Example
- The constraints of substitution
- Interface segregation principle
- Example
- Proper granularity
- Dependency inversion principle
- Example
- Separating layers
- Summary
- Chapter 9: The Road to Enterprise Application
- Creating an application
- Decision between SPA and "normal" web applications
- Taking team collaboration into consideration
- Building and testing projects
- Static assets packaging with webpack
- Introduction to webpack
- Bundling JavaScript
- Loading TypeScript
- Splitting code
- Loading other static assets
- Adding TSLint to projects
- Integrating webpack and tslint command with npm scripts
- Version control
- Git flow
- Main branches
- Supporting branches
- Feature branches
- Release branches
- Hotfix branches
- Summary of Git flow
- Pull request based code review
- Configuring branch permissions
- Comments and modifications before merge
- Testing before commits
- Git hooks
- Adding pre-commit hook automatically
- Continuous integration
- Connecting GitHub repository with Travis-CI
- Deployment automation
- Passive deployment based on Git server side hooks
- Proactive deployment based on timers or notifications
- Summary
- Module 3: TypeScript Blueprints
- Chapter 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
- Chapter 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
- Chapter 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
- Chapter 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
- Chapter 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
- Chapter 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
- Chapter 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
- 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
- Chapter 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
- Chapter 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
- Chapter 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
- Bibliography
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.