Live data from Hacker News

Backbone.js v0.9.10 Released

backbonejs.org

31–40 of 44 posts

Re: Backbone.js v0.9.10 Released

#31

> Backbone's only hard dependency is either Underscore.js ( >= 1.4.3) or Lo-Dash First I'm hearing of Lo-Dash. How long has this been in the Backbone.org docs? Appears there was a fair bit of tension in it's dev history. Eg: https://github.com/documentcloud/underscore/commit/4e4bc194c...

Backbone begot Spine, Underscore begot Lo-Dash... What about CoffeeScript? TeaMacro? Jeremy must be having a blast.

CoffeeScript begat Coco. And Coco begat LiveScript.

Re: Backbone.js v0.9.10 Released

#32
post #26

From the changelog: > Model validation is now only enforced by default in Model#save and no longer enforced by default upon construction or in Model#set, unless the {validate:true} option is passed. From the documentation on Model#set: > If the model has a validate method, it will be validated before the attributes are set, no changes will occur if the validation fails, and set will return false. Otherwise, set retur…

Thanks for catching that. I've removed the outdated paragraph and republished the docs. If you notice anything else amiss, please let me know.

Re: Backbone.js v0.9.10 Released

#33
post #5

Another framework worth checking out if you're into JavaScript MVC is AngularJS ( http://angularjs.org ).

I'd be interested to hear from anyone who's used both Backbone and Angular. I've been writing my first single-page app (yeah, yeah, behind the times) using Backbone, and at first it was really exciting and intuitive, but I'm starting to realize Backbone is a pretty, er, bare-bones lib. Everyone seemed to suggest Handlebars as a template lib, so I added that to my project, and RequireJS to manage those two libs and th…

I found the JavaScript Jabber podcast [1] to be a great source of information on front-end JavaScript Frameworks, as well as some discussion with framewor authors that can help figure out how they differ.

Backbone: http://javascriptjabber.com/004-jsj-backbone-js-with-jeremy-... Ember: http://javascriptjabber.com/034-jsj-ember-js/ Angular: http://javascriptjabber.com/032-jsj-angular-js/ Knockout: http://javascriptjabber.com/013-jsj-knockout-js-with-steven-... enyo: http://javascriptjabber.com/033-jsj-enyo-js/

[1]http://javascriptjabber.com/

Re: Backbone.js v0.9.10 Released

#34

Earlier quoted context omitted.

I write and use alot of software. Normally number crunching on servers. However, I recently started seriously learning javascript. I had avoided HTML/javascript for years as they were horrible systems to develop in compared to every other type of software system in existence. However, with HTML 5 + cloud computing platforms I thought these systems are probably mature enough to start using. Anyway, so I learnt javascr…

Ugh, but this is just terrible: I guess I'm a purist.

What about it do you find terrible? The declarative nature of the binding? Or just the fact that it isn't valid according to the HTML spec?

Re: Backbone.js v0.9.10 Released

#35
post #14

"Most importantly, Backbone events have two new methods: listenTo and stopListening... When you destroy Views with view.remove(), this will now be done automatically" Well that seems incredibly useful.

Wait, so in previous versions, when you destroy a view, event listeners weren't destroyed? I haven't noticed any issues in my Backbone app but this seems like it could spiral into a memory issue.

Yes. The event listeners were not removed with currentView.remove(). Had to use currentView.unbind() to remove the event listeners.

Re: Backbone.js v0.9.10 Released

#36
post #26

From the changelog: > Model validation is now only enforced by default in Model#save and no longer enforced by default upon construction or in Model#set, unless the {validate:true} option is passed. From the documentation on Model#set: > If the model has a validate method, it will be validated before the attributes are set, no changes will occur if the validation fails, and set will return false. Otherwise, set retur…

Thanks for catching that. I've removed the outdated paragraph and republished the docs. If you notice anything else amiss, please let me know.

Thanks, I was honestly confused, not trying to nit pick.

---

Anyone know the best way to make it so set defaults to {validate:true}? Override Backbone.Model.set, extend options and call original?

Re: Backbone.js v0.9.10 Released

#37

Earlier quoted context omitted.

I write and use alot of software. Normally number crunching on servers. However, I recently started seriously learning javascript. I had avoided HTML/javascript for years as they were horrible systems to develop in compared to every other type of software system in existence. However, with HTML 5 + cloud computing platforms I thought these systems are probably mature enough to start using. Anyway, so I learnt javascr…

Ugh, but this is just terrible: I guess I'm a purist.

This was a deal-breaker me, when I was evaluating Angular and Ember ~6 months ago. I eventually chose Ember and things worked out pretty well.

Re: Backbone.js v0.9.10 Released

#38
post #36

Earlier quoted context omitted.

Thanks for catching that. I've removed the outdated paragraph and republished the docs. If you notice anything else amiss, please let me know.

Thanks, I was honestly confused, not trying to nit pick. --- Anyone know the best way to make it so set defaults to {validate:true}? Override Backbone.Model.set, extend options and call original?

Sure (though I recommend just updating your code instead...)

Only reason it's tricky is because there are two different forms of attributes that can be passed to set. Something like this should work:

  var oldSet = Backbone.Model.prototype.set;
  Backbone.Model.prototype.set = function(key, val, options) {
      if (key == null) return this;
      if (typeof key === 'object') {
        options = val;
      }
      options || (options = {});
      options.validate = true;
      oldSet.call(this, key, val, options);
  };

Re: Backbone.js v0.9.10 Released

#39
post #5

Another framework worth checking out if you're into JavaScript MVC is AngularJS ( http://angularjs.org ).

I'd be interested to hear from anyone who's used both Backbone and Angular. I've been writing my first single-page app (yeah, yeah, behind the times) using Backbone, and at first it was really exciting and intuitive, but I'm starting to realize Backbone is a pretty, er, bare-bones lib. Everyone seemed to suggest Handlebars as a template lib, so I added that to my project, and RequireJS to manage those two libs and th…

I have used backbone and angular, created a small Quiz application in both the frameworks.

I would say with Angular, what you write is not javascript , it is Angular JavaScript, which gets compiled into javascript on running over compiler. Having been worked with GWT for many years, I am disappointed with Angular doing the same mistakes of not allowing the developers to think in terms of Javascript. But in terms of the framework, which they had brought in.

However, Backbone gives me lot of freedom in customizing the app by adding Javascript and using its model view observable logic. If i find any shortcoming in backbone, i can see a plugin available in the Community. Which is really great.

To conclude , If your are experienced JS developer (JS ninja), you will love backbone. If you are intermediate/beginner JS developer you will love angular. However, this is just my perspective.

Re: Backbone.js v0.9.10 Released

#40

Earlier quoted context omitted.

Ugh, but this is just terrible: I guess I'm a purist.

What about it do you find terrible? The declarative nature of the binding? Or just the fact that it isn't valid according to the HTML spec?

It's invalid HTML and it's destroying the separation between logic and presentation/content.
Post reply on HN