Skip to content

Latest commit

 

History

History
94 lines (72 loc) · 4.95 KB

_README_INTRO.md

File metadata and controls

94 lines (72 loc) · 4.95 KB

Backbone.Giraffe

Introduction

Backbone.Giraffe is a light and flexible library that extends Backbone.js to new heights. Giraffe's goal is to follow the Backbone philosophy of unopinionated simplicity to provide commonly needed features with few assumptions. It differs from other Backbone libraries like Marionette and Chaplin in its reduced scope and size, and it takes a different approach to the problems of route handling, object lifecycles, event aggregation, and view management.

Overview

  • Giraffe.View is a nestable and flexible class that provides lifecycle management and many other useful features. It defaults to Underscore templates and easily supports any form of templating.

  • Giraffe.App is a special view that helps your views, models, collections, and routers communicate by acting as an event hub. Multiple apps can coexist and teardown is as simple as it gets.

  • Giraffe.Router leverages an app's events to trigger routing events that any object can listen for. It also has reverse routes to allow the construction of URLs using app events and arguments.

  • Giraffe.Model and Giraffe.Collection are thin wrappers that add Giraffe's lifecycle management and app events. Any object can mix in this functionality via Giraffe.configure.

Documentation

Read the API docs and check out our live examples.

How Giraffe is Different

Giraffe was created by the needs of our team as we built Barc. We tried many existing libraries but some did way too much, others added too many layers, and others performed poorly.

Giraffe does not have all the bells and whistles of the larger frameworks. We found the effort to customize them for our needs was more effort than simply building upon Backbone with a minimalist approach. For example, there is no concept of specialized containers like regions or layouts, as any view in Giraffe can act as a parent of one or more child views. Giraffe also has no CollectionView or ItemView (see Giraffe.Contrib.CollectionView and Giraffe.Contrib.FastCollectionView), but we are open to suggestions to make Giraffe as useful as possible to Backbone developers who want an extension library with few opinions.

Is this framework for you? It depends. We feel Giraffe adds essential features to make you more productive with Backbone.

Highlights