万本电子书0元读

万本电子书0元读

顶部广告

Mastering Backbone.js电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Abiee Echamea

出  版  社:Packt Publishing

出版时间:2016-01-15

字       数:78.5万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Design and build scalable web applications using Backbone.jsAbout This BookLevel up your Backbone.js skills and create professional web applications with the best practicesUse the Backbone.js components in the right way and avoid maintenance nightmaresImprove your development workflow from application design to deploymentApply the best practices given in this tutorial to solve day-to-day problems in your applicationsWho This Book Is ForThis book is for those developers who know the basic concepts of Backbone.js and want to build scalable applications with it. If you are looking for the best practices of using Backbone.js applied to real work applications, this book is for you. You will be able to apply architectural principles to create amazing web applications easily.What You Will LearnBuild web applications that scale with Backbone.jsDesign a powerful architecture that eliminates maintenance nightmaresUse common patterns and best practices in Backbone.js web applications developmentsPack your applications to be deployed to production environmentsClean up your code organization to a simple and maintainable architectureTest your components and get confidence with your codeDeal with common scenarios like file uploading and login issuesIn DetailBackbone.js is a popular library to build single page applications used by many start-ups around the world because of its flexibility, robustness and simplicity. It allows you to bring your own tools and libraries to make amazing webapps with your own rules. However, due to its flexibility it is not always easy to create scalable applications with it. By learning the best practices and project organization you will be able to create maintainable and scalable web applications with Backbone.js.With this book you will start right from organizing your Backbone.js application to learn where to put each module and how to wire them. From organizing your code in a logical and physical way, you will go on to delimit view responsibilities and work with complex layouts.Synchronizing models in a two-way binding can be difficult and with sub resources attached it can be even worse. The next chapter will explain strategies for how to deal with these models. The following chapters will help you to manage module dependencies on your projects, explore strategies to upload files to a RESTful API and store information directly in the browser for using it with Backbone.js. After testing your application, you are ready to deploy it to your production environment. The final chapter will cover different flavors of authorization.The Backbone.js library can be difficult to master, but in this book you will get the necessary skill set to create applications with it, and you will be able to use any other library you want in your stack.Style and approachThis book takes a tutorial approach to help you scale your Backbone.js applications. It builds a web application using the best practices and applies architectural design principles to develop maintainable web-apps. Each chapter explains the design decisions and improves the project that is used as an example alongside the book.
目录展开

Mastering Backbone.js

Table of Contents

Mastering Backbone.js

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

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

Errata

Piracy

Questions

1. Architecture of a Backbone application

Subapplications based architecture

Subapplication anatomy

Responsibilities of Backbone objects

Views

Models

Collections

Routers

Objects not provided by Backbone

Subapplication façade

Subapplication controller

Contacts application

File organization

Summary

2. Managing Views

Identifying view types

ModelView

CollectionView

Adding new models

Deleting models

Destroying views

Resetting the collection

Region

Layout

Putting it all together

Showing a list

Showing the details

Editing information

Rendering third-party plugins

Conclusions

3. Model Bindings

Manual binding

Two-way binding

References

Data binding with plugins

Binding embedded data

Binding an embedded list

Validating model data

Manual validation

Validating with the Backbone.Validation plugin

Summary

4. Modular Code

CommonJS modules

NPM and package.json

Browserify

Application dependency

Using Browserify in the app

Solving cyclic dependency

Modularizing templates

Summary

5. Dealing with Files

Express server

Attaching a file into a resource

Uploading the avatar photo to contacts

Showing the avatar

Uploading images from Backbone

Uploading a file with AJAX

Uploading the avatar image at creation time

Encoding the upload file

Summary

6. Store data in the Browser

The localStorage

Starting with localStorage

Backbone and localStorage

Store models in localStorage

Store Backbone models in localStorage

Backbone.sync

Using localStorage as cache

IndexedDB

Getting started with IndexedDB

Database versions

Creating stores

Delete a database

Add elements to an object store

Performing queries

Delete objects in the store

IndexedDB in Backbone

Summary

7. Build Like a Pro

Development workflow

What's a task runner?

How Gulp works

Getting started with Gulp

Creating a development workflow

Bundling the JavaScript files with Browserify

Sourcemaps

Re-bundle automatically

BrowserSync

Run server with Express

Creating a production workflow

Gulp useref

Image Optimization

Fonts

Bundle JavaScript files for production

Putting it all together

Summary

8. Testing Backbone Applications

Testing tools

Getting started with Jasmine

Expectations

Testing asynchronous code

Karma test runner

What and how to test Backbone applications

Testing models and collections

Testing views

Testing controllers

Mocking dependencies

Fake objects

Testing ContactEditor

Testing the subapplication Façade

Summary

9. Deploying to Production

Heroku

Dynos

Getting started with Heroku

Production environment

The HTTP Server

Do not run as root

Process Management

Summary

10. Authentication

Stateless API authentication

HTTP Basic authentication

The OAuth2 authentication

Service applications

OAuth2 grant types

Authorization code grant

Implicit Grant

Resource Owner Password Credentials Grant

Client credentials grant

Resume

Implementing HTTP Basic Authentication

Implementing OAuth authentication

Summary

Index

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部