Pieces of the critique definitely apply to this release: I'm still of the opinion that routing is a relatively small portion of a client-side app. And you'll probably wind up with 10x more Views, Models, and Collections than you do Controllers.
The big difference between this approach and Sammy's is that here Controllers are just a library you can use -- with Sammy you structure your whole app around inappropriate faux-server-side-URLs-with-HTTP-methods. (Also, this works in Internet Explorer.) In the end, enough people requested we add routing to Backbone that it made sense to plug it in, one more battery included.
At the moment, you can do it by including "!" at the start of your routes. Perhaps it should be a configurable option...
We talked about it a bit, and the consensus was that "/#!/" URLs were a temporary hack that is obsolete now that "pushState" and "replaceState" are part of HTML5 -- you can now mint real URLs that are crawled by Google and are accessible from single-page apps as well.
Comments
Does the critic that you made to Sammy applies to Backbone? :)
Link: http://news.ycombinator.com/item?id=1788631
I presume you're referring to this: http://news.ycombinator.com/item?id=1882476
Pieces of the critique definitely apply to this release: I'm still of the opinion that routing is a relatively small portion of a client-side app. And you'll probably wind up with 10x more Views, Models, and Collections than you do Controllers.
The big difference between this approach and Sammy's is that here Controllers are just a library you can use -- with Sammy you structure your whole app around inappropriate faux-server-side-URLs-with-HTTP-methods. (Also, this works in Internet Explorer.) In the end, enough people requested we add routing to Backbone that it made sense to plug it in, one more battery included.
is there any way to change the url from "/#" to "/#!" so that it can be crawlable by google bot?
At the moment, you can do it by including "!" at the start of your routes. Perhaps it should be a configurable option...
We talked about it a bit, and the consensus was that "/#!/" URLs were a temporary hack that is obsolete now that "pushState" and "replaceState" are part of HTML5 -- you can now mint real URLs that are crawled by Google and are accessible from single-page apps as well.
Added link to the comment about Sammy. Basicly it said you shouldn't organize the whole app around faux-routes.
Didn't understand the downvotes.