News for hackers. Stuff that matters.
Re:Announcing Backbone.js: Models, Collections and Views in ... by bobfunk on Wednesday October 13, 2010 @03:13PM (#1788456)
Looks great - imagine that it would be a perfect companion to something like sammy.js
Re:Announcing Backbone.js: Models, Collections and Views in ... by jashkenas on Wednesday October 13, 2010 @04:00PM (#1788631)
Yes, they could work together quite well.

However (and this is another conversation altogether), I don't think that you really want to structure your client-side application around faux-routes. Maintaining browser history with "hashchange" is important, but hardly the central aspect of a JS app. Usually you want to reserve history changes for special states that deserve to be bookmarked, not for every single action performed.

For the record, this is the little module that we use to record and listen for "hashchange" events:

http://gist.github.com/624773

Re:Announcing Backbone.js: Models, Collections and Views in ... by swah on Thursday October 14, 2010 @08:20AM (#1790633)
Can you please expand on this? I don't get it: do you think something like newtwitter is badly designed because it uses faux-routes? If you don't have faux-routes then how can you easily insert links which will "go to page X" ?
Re:Announcing Backbone.js: Models, Collections and Views in ... by jashkenas on Thursday October 14, 2010 @08:54AM (#1790698)
Not at all -- hash-based URLs for Ajax applications are critical. They're just not something that you want to structure your entire application around, and Sammy is a framework that uses faux-URLs as the central abstraction.

All I'm saying is that you don't need to ape the server-side paradigm (one URL, one page) quite so closely. Use a module that gives you URL setting and tracking with "onhashchange", by all means, but you don't have to shoehorn your application into it.

Re:Announcing Backbone.js: Models, Collections and Views in ... by eloop on Monday October 18, 2010 @06:47PM (#1805467)
Thanks for that example. I was just wondering if you use any library for parsing the hash based URLs (another nice thing that sammy provides) ?
Re:Announcing Backbone.js: Models, Collections and Views in ... by jashkenas on Tuesday October 19, 2010 @10:50PM (#1809754)
We use something along these lines...

http://gist.github.com/624773

Re:Announcing Backbone.js: Models, Collections and Views in ... by niels on Wednesday October 13, 2010 @03:46PM (#1788579)
Yep, I'm wondering the same... Sammy has routes, but no real models structure. So I assume the two don't overlap too much?