Book Image

Backbone.js Patterns and Best Practices

By : Swarnendu De
Book Image

Backbone.js Patterns and Best Practices

By: Swarnendu De

Overview of this book

Table of Contents (19 chapters)
Backbone.js Patterns and Best Practices
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Precompiling Templates on the Server Side
Index

Summary


In this chapter, we have gone through a number of important problems most Backbone developers come across, and learned multiple solutions to solve them. First, we discussed the partial view rendering and nested views. Any Backbone application needs to deal with nested views and if we can maintain their initialization, DOM reflow, and cleanup properly, it will greatly enhance the performance of the whole application.

We spoke about different template-handling methods, saw a number of solutions to load precompiled templates from external files, organized templates within applications, and understood how helper functions can eliminate evaluation of JavaScript codes inside templates and help us to create cleaner templates.

Finally, we learned about some of the very important extensions: Marionette's ItemView, CollectionView, CompositeView, and LayoutManager. All of these extensions provide great flexibility by taking out a lot of boilerplate code and managing your views by a great deal...