GithubHelp home page GithubHelp logo

grieneis / backbone-torso Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vecnatechnologies/backbone-torso

0.0 2.0 0.0 3.15 MB

A holistic approach to Backbone applications

Home Page: http://vecnatechnologies.github.io/backbone-torso

License: Apache License 2.0

JavaScript 98.92% Handlebars 0.84% Shell 0.24%

backbone-torso's Introduction

backbone-torso

A holistic approach to Backbone applications.

Backbone provides many convenient tools for building Single Page Applications (SPAs) out of the box, and we absolutely love using it! However, Backbone only gives us the bare bones (excuse the overused pun) of what you need to build a complex front end application. Torso gives you the blueprints and some extra tools to build something quickly that scales well. Torso was first created by Vecna employees that needed to build robotics and health care applications that have intense feature sets and large user bases.

Getting started

If you're new to torso, check out the torso handbook.

If you want to jump right in, Torso has a yeoman torso generator to get you off to a fast start.

Install yoeman

npm install -g yo

Install generator-torso-brec

npm install -g generator-torso-brec

Create a new project

cd path/to/project
yo torso-brec

What's in it?

The yeoman generator will have created a simple application. You can open the dist/index.html to see the "hello world". Before you start building more views, you'll need to familiarize yourself with torso's philosophy and recipies.

First, the handbook will equip you with a set of rules on how to create small components with clear interfaces that still work well when things get complicated. After that, Torso has many choose-what-you-want modules. These additions to Backbone's base building blocks include form handling, data validation tools, polling caches, sub-view management, and more. Torso simplifies the design process and eases the nightmare of building complicated web apps.

Philosophy

You might have heard "convention over configuration" as a way to hide framework implementation and reduce code. Typically, if you have desires to do something that lies just over the edge of convention approaching the unconventional, those frameworks are a headache to get working. Torso is a how-to for "configuration using convention". The goal of Torso is to define some abstractions, rules of thumb, and conventions that sit on top of an unopinionated framework like Backbone, that allows us to move quickly through the easy bits and flexibility to handle the edge cases. Think of Torso as more of a practiced martial art than a weapon to wield. To see this, let's examine a simple Backbone View:

var basicView = Backbone.View.extend({
  events: {
    'click .list-item': 'handler'
  },
  initialize: function() {...},
  render: function() {...},
  handler: function() {...}
});

Backbone offers an easy jumping off point, but there are many unanswered questions.

  • What happens when you add event listeners or timers that need to be removed after the view is done?
  • Should the render method take arguments?
  • Does calling render change the state of the application?
  • When can I call render on this view?
  • Is there anyway to keep the functionality of the view going but not have it part of the DOM?

So many questions, each one can break functionality if they are inconsistent within your app. With Torso, we lay down the laws that answer questions just like these and keep your application consistent. Torso view's render methods never take arguments, can be called whenever, and they never change the state of the application. We'll explain how to make this possible and other rules in the recipes section of the torso site.

Want to help out? Checkout the dev page

Credits

Originally developed by Vecna Technologies, Inc. and open sourced as part of its community service program. See the LICENSE file for more details. Vecna Technologies encourages employees to give 10% of their paid working time to community service projects. To learn more about Vecna Technologies, its products and community service programs, please visit http://www.vecna.com.

backbone-torso's People

Contributors

kentmw avatar arikwex avatar

Watchers

James Cloos avatar Daniel Grieneisen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.