I see that backbone was added to the libraries. What is it being used for?

Have you considered Angular JS? It is newer/modern, much better, and easier to work with. Templating is HTML.

I am using Angular and would need to duplicate what is being done with backbone.

http://angularjs.org/

Angular vs Backbone -- it is a few months old, but: http://www.nebithi.com/2012/12/27/backbone-and-angular-demystifying-the-...

"I know that people in general, still choose Backbone over Angular because it seems to be the safer choice, because you cant find as many X-framework developers as Backbone etc etc.. I am attempting to make an argument that Angular is a better choice in all scenario’s where you would use Backbone. Finding developers and how much you pay them is an organizational choice. But, my attempt here is to prove that, if you have 2 smart developers who have no knowledge of Angular and pick 4-5 Dev’s who know Backbone for a largish project, the investment of learning Angular will pay off in the long run. Less code to write means less code to test means less code to debug means less code to maintain. It also means a lesser page-weight at the end of the day. These are some of the advantages you should not ignore if you are making an objective decision."

Comments

jpontani’s picture

Component: User interface » Documentation
Category: feature » support
Status: Active » Fixed

Mobile Friendly Navigation Toolbar that was recently introduced into Commons requires the Backbone library.

RobKoberg’s picture

Ah, OK, no worries then.

Are there plans to use backbone.js in other parts of commons?

Using a framework like Angular takes a bunch of heavy lifting off the server, and you still have deeply nested links (i.e. not a one page app)

jpontani’s picture

I don't know for sure, but there currently are no planned features that would require any use of the Backbone library.

With that said, there is always the potential for future items that come up that would benefit from having the Backbone library available, or changing existing features that just use basic JS/jQuery to potentially switch to using features from Backbone.

ezra-g’s picture

jpontani is correct.

Are there plans to use backbone.js in other parts of commons?

Using a framework like Angular takes a bunch of heavy lifting off the server, and you still have deeply nested links (i.e. not a one page app)

That's generally true in many applications but isn't necessarily the case with Drupal, since even an asychronous JavaScript call will by default do a full bootstrap of Drupal, adding to the number of bootstraps necessary to render a single page versus rending the page in a single bootstrap.

RobKoberg’s picture

OK, makes sense.

When I have done this in the past, it seemed much faster. In other words, by removing the theming part of the equation you skip the most time consuming part of the response (just guessing).

For example, hook_node_view_alter and pick the items you want out of the build array and return that as json. It seems much faster.

Or views_json to return a view, the response time is seems much quicker.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.