jashkenas/backbone — pull request #2887 by kumu (2013-11-22 00:29:07+00:00)
Title: Better query string approach

Ideological arguments aside, query strings wouldn't exist if they weren't useful. Sometimes routes aren't hierarchical and the current solution of ignoring the query string doesn't account for these.

This approach does the following:
- Query string can optionally be included for any route. No route changes required.
- Query string is ignored when matching routes
- Query string changes *do* trigger route changes
- Query string is passed to all route handlers as the last argument. Ignore it if you don't need it.
- Query string can automatically be parsed prior to handling if you supply `Backbone.qs` (a function that consumes the query string and returns it however you want)

I highly recommend TJ's [qs](https://npmjs.org/package/qs) module for the parsing.

Note that these changes mean named parameters and splats will no longer consume `?` and routes shouldn't explicitly account for the query string.