Knock Me Out

Thoughts, ideas, and discussion about Knockout.js

Knockout.js 2.3.0 and 3.0.0 Beta Are Out

| Comments

Just a brief note that Knockout 2.3.0 is now available. Additionally, there is a beta release of Knockout 3.0.0 available here. Steve Sanderson has a great post highlighting the features/fixes in 2.3.0 and the changes in 3.0.0 beta. I look forward to writing more about 3.0 changes in the coming months.

2.3.0 contains a ton of fixes and improvements. Here is a copy of the 2.3.0 release notes:


  • hasfocus renamed to hasFocus (hasfocus will still continue to work as well)
  • name parameter of template can accept an observable
  • ko.unwrap added as substitute for ko.utils.unwrapObservable
  • options binding uses same technique as foreach to avoid unnecessary re-rendering
  • optionsAfterRender callback added to allow for custom processing of the added options
  • optionsCaption will display a blank caption if the value is an empty string

Bugs fixed:

  • hasfocus: requires two Tab presses to blur (and related issues) in Chrome; throws error in IE9 on initial binding
  • Error when you try to inline knockout because of </script> string
  • If first node in string template has a binding, the bindings in the template won’t get updated
  • selectedOptions doesn’t update non-observable properties
  • css won’t accept class names with special characters
  • Applying binding twice to the same nodes fails in strange ways (now it fails with an obvious error message)
  • Two-way bindings overwrite a read-only computed property with a plain value
  • Empty template throws an error with jQuery 1.8+
  • observableArray can be initialized with non-array values
  • Event binding init fails if Object.prototype is extended (fixed all loops)
  • Calling ko.isSubscribable with null or undefined causes an error
  • Binding to null or undefined causes an error
  • Memory leak in IE 7, 8 and 9 from event handlers
  • options binding causes error in IE8+ in compatibility mode
  • value binding on select doesn’t match null with caption option
  • Invalid element in string template can cause a binding error
  • Conditionally included select gets close to zero width in IE7-8
  • ko.toJS treats Number, String and Boolean instances as objects
  • value binding misses some updates (1 -> "+1")
  • Exception in ko.computed read function kills the computed
  • Error if spaces around = in data-bind attribute in string template


  • Port tests to Jasmine
  • Support Node.js
  • Remove build output files and Windows build scripts
  • Build script runs tests using build output (using PhantomJS and Node.js)
  • Use faster string trim function
  • Add automated multi-browser testing using Testling-CI