knockout/knockout — pull request #1255 by mbest (2014-01-09 22:25:47+00:00)
Title: Track observables accessed in getBindingAccessors

My original goal was that `getBindingAccessors` would never access any observables, and to help promote that, I set up the code to [ignore any observables it accessed](https://github.com/knockout/knockout/commit/32fe21095be#diff-49b895d65fb975dc8b84e3311720a326R151). Then, when we enabled support for observable view models, the code was set up so that [observables *would* be tracked](https://github.com/knockout/knockout/commit/2273c72e83#diff-49b895d65fb975dc8b84e3311720a326L173). Later on, I changed the code to reduce the number of computed observables by checking specifically if an [observable view model was in use](https://github.com/knockout/knockout/commit/93c66c065a#diff-49b895d65fb975dc8b84e3311720a326R293).

After Knockout 3.0 was released, when I was helping @rniemeyer set up his [*class* binding provider](https://github.com/rniemeyer/knockout-classBindingProvider) to work better with Knockout 3.0, I realized that it was useful to be able to track observables accessed in `getBindingAccessors` for backwards compatibility. For his provider, I worked around the observable view model check by adding a hack that [pretends that an observable view model is in use](https://github.com/rniemeyer/knockout-classBindingProvider/commit/d4a621b54243#diff-32fe7209b7759ca6726cf31060ee7c97R30).

So I'd like to see proper support for this in the next Knockout version. One option is to undo the change in 93c66c065a so that it works for any provider. Another option is to add some kind of flag on the provider that tells Knockout to track observables; then only binding providers that need that support will enable it.