3 ms·
I presume you're referring to this: http://news.ycombinator.com/item?id=1882476 http://news.ycombinator.com/item?id=1882476 Pieces of the critique definitely a
by jashkenas 16y ago
I presume you're referring to this: http://news.ycombinator.com/item?id=1882476 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.
- siong1987 16y agois there any way to change the url from "/#" to "/#!" so that it can be crawlable by google bot?
- jashkenas 16y agoAt 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.