Here are some highlights:
- CommonJS and AMD support
- Great performance improvements to templating - use cloned DOM nodes when possible rather than parsing strings into elements.
- Support for custom container-less bindings
- Ability to extend the binding context in a custom binding
- Computed observables no longer can recursively evaluate themselves (I think that has happened to all of us a few times!)
$indexis available in
foreachscenarios from the binding context. There is no longer a need for workarounds like storing an index as a property of your data items. Note that
$indexis an observable, so it needs to be reference using
$parentContextis available from the binding context as well. While,
$parentcontains the actual data from one scope level up,
$parentContextcontains the actual binding context (
$root, etc.) of the parent.
ko.isComputedis a helper function that was added to determine if a value is a computed observable or not.
ko.toJSONnow passes its arguments on to
ko.toJS. This makes creating a handy “debug” section even easier
<pre data-bind="text: ko.toJSON($root, null, 2)"></pre>and this can be used to include only certain properties in the converted JSON like
ko.toJSON(person, ['firstName', 'lastName']). This seems even more flexible in many cases than the approach that I mentioned here.
- Better support for using a single instance of KO between documents - you can now pass an instance of KO between documents and have bindings work properly across the documents. Previously the computed observables associated with bindings would dispose themselves when outside of the original document as they believed they were no longer part of the DOM.
- Numerous other bug and performance fixes
For this release Michael Best joined the core team and drove the majority of the changes with Steve. Michael has numerous other exciting performance enhancements in his fork that will be evaluated for possible inclusion (in a non-breaking fashion) in the core. He has really helped tremendously in moving the project forward.
Please report any issues found here.