tildeio/router.js — pull request #13 by pdf (2013-04-23 13:19:41+00:00)
Title: Avoid updating contexts on route change unless necessary

On route change, contexts for dynamic segments are always marked updated,
even when identical. Additionally, any segment after the first dynamic
segment is forced to deserialize, even if the dynamic segments have not
changed.

This change tracks whether any preceeding segments have changed before
updating contexts, and avoids unnecessary reloads/redraws.

I mistakenly submitted this against the vendored version in Ember first,
because I wasn't familiar with the project structure. I'm afraid I'm
having trouble coming up with tests for this, because the current behaviour
doesn't appear to be tested. It should be pretty obvious what this is
trying to achieve, and for routes with multiple nested dynamic segments,
triggering a reload of every segment after the first dynamic segment is
really harsh, so I'd love to get this merged, but I need a little help.