Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Programming JavaScript Applications
Preface
Introduction
Who This Book Is For
Who This Book Is Not For
Unit Testing
Conventions Used in This Book
Safari® Books Online
How to Contact Us
Thanks
1. The JavaScript Revolution
Advantages of JavaScript
Performance
Objects
Syntax
First-Class Functions
Events
Reusability
The Net Result
Anatomy of a Typical Modern JavaScript App
Infrastructure
JSON: Data Storage and Communication
NoSQL Data Stores
RESTful JSON Web Services
2. Functions
Minimize Side Effects
Function Definition
Named Function Expressions
Lambdas
Immediately Invoked Function Expressions
Method Context
Function.prototype.bind()
Function Scope
Hoisting
Closures
Method Design
Named Parameters
Function Polymorphism
Method dispatch
Generics and Collection Polymorphism
Method Chaining and Fluent APIs
Functional Programming
Stateless Functions (aka Pure Functions)
Partial Application and Currying
Asynchronous Operations
Callbacks
Promises and Deferreds
Conclusion
3. Objects
Classical Inheritance Is Obsolete
Fluent-Style JavaScript
Prototypes
Delegate Prototypes
Prototype Cloning
The Flyweight Pattern
Object Creation
Factories
Prototypal Inheritance with Stamps
Conclusion
4. Modules
Principles of Modularity
Interfaces
The Module Pattern
Asynchronous Module Definition
Plug-Ins
Node-Style Modules
npm
ES6 Modules
Building Client-Side Code with CommonJS, npm, Grunt, and Browserify
Defining the App
Feature Implementation
Bundling and Deployment
Conclusion
5. Separation of Concerns
Client-Side Concerns
Module Management
Getting started
Registration, loading, and rendering
Events
Event emitters
Event aggregators
Queues and stacks
Choosing the right event model
Events by example
Model View Controller/MV*
Presentation and DOM Manipulation
View events
Event delegation
Templates
Web Components
Server-Side Concerns
Getting Started with Node and Express
Installing Node and Express
Organizing files in Node
Node libraries
Configuration
Express
Create your app
Routing
Middleware
Let it crash
Templates
Next steps
Conclusion
6. Access Control
Authentication
Passwords
Rainbow tables
Password salts
Brute force
Variable time equality
Stolen passwords
Credential
Multifactor Authentication
Knowledge factor
Possession factor
Inherence factor
Federated and Delegated Authentication
Mozilla Persona
WebID
Delegated authentication
Authorization
Authorizing Applications
OAuth 2.0
Conclusion
7. Logging
Debugging
Server Operations
Security
Auditing
Business Analytics
Viral Factor
Logging Checklist
Logging Requests
Logging Errors
Sample Log Output
Logging Service Alerts
Logging Goals
Profiling and Instrumentation
Logging Client-Side Events
Deciphering Data
Conclusion
8. Building RESTful APIs
Usable
Focus
Consistency
Use common conventions
Resourceful routing
Self-Describing: Hypermedia
Affordances
HATEOAS
HTML as an API Media Type
Jade
Jiron
Responsive APIs
Optimizing for Speed
Conclusion
9. Feature Toggle
Organizing Features
Scale of a Feature
Feature Groups
Lifespan of a Feature
Development
Staging
Production Testing
Feature Rollout
Default Activation
Full Integration
Implementation
Conclusion
10. Internationalization
Conclusion
A. JavaScript Style Guide
Example Tests
QUnit Primer
Code Quality
Best Practices Quick Reference
Indentation: Be Consistent
Use Semicolons
Bracket Placement: Right Side
Avoid Name Collisions
Always Use var
Use One var Statement per Function
Avoid Constant Abuse
Use Functional Iterators When Possible
Be Careful with if Statements
Avoid Side Effects
Don’t Use switch
Don’t Use eval()
Index
About the Author
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →