SteveSanderson/knockout — pull request #909 by mbest (2013-04-05 00:45:40+00:00)
Title: Independent binding support: preProcessBindings updates

Here is what's included and why:

1. *New expression parser* - I started developing this parser after speed tests showed that the processing of independent bindings was slower than before. This is similar to what I did for the `compareArrays` move detection. The net result is equal or better performance. I spent quite some time working on this and am quite happy with the three-time performance gain over the current parser. It has the added benefit of being smaller and producing more consistent results (keys that are space and quote trimmed). This parser has been tested by myself and a few others for many months since both my Knockout fork and Freedom plugin use it.
2. *Support for function-wrapped binding values* - This is, of course, the main change needed for independent bindings support.
3. *Support for dynamically created binding handlers* - This is an extension point for my Key.subkey plugin. Currently the plugin wraps the `bindingProvider.getBindings` and `ko.applyBindingsToNode` functions to check the bindings before they're processed, but this approach is quite hackish. I'd much rather have a true extension point. For the independent bindings feature, this plugin fills a hole in that it provides support for independent bindings for `attr`, `css` and any other binding that actually includes multiple bindings.
4. *Support for preprocessing bindings* - This is also for my Key.subkey plugin, allowing it to modify bindings values from the "sub-object" syntax to the "key.subkey" syntax. This means that users can continue to specify these bindings in the current syntax but get the same independent bindings benefits as the new syntax. The preprocessing feature will also allow for support for other features that users have requested, such as #289, #233, #378, and parts of #465, to be easily implemented as plugins.

The first commit includes the new parser (item 1) and the second commit includes all the updated functionality needed for independent bindings (items 2-4).