Skip to content

@mbest mbest released this Nov 17, 2015 · 309 commits to master since this release

New features and bug fixes

  • Improves performance of components, templates, computeds, and observables.
  • Includes a native version of deferred updates, along with a microtask queue (ko.tasks).
  • Calls a ko.onError handler, if defined, for errors from asynchronous code.
  • ko.options.useOnlyNativeEvents can be set to tell Knockout to use only native (not jQuery) events.
  • Includes ko.isPureComputed().

The 3.4.0 RC release notes has the full list of issues and pull requests included in this release. The final release fixes two regression bugs found in the RC:

  • #1903 - New beforeRemove behavior can break retained items.
  • #1905 - Endless recursion possible with ko.computed.

Possible compatibility issues

  1. Components now use microtasks to perform updates asynchronously instead of setTimeout. Since microtasks are run before the browser repaints the page, all loaded components will be initialized and displayed in a single repaint. Although this reduces the overall time needed to display components, it could result in a longer delay before anything is displayed.
  2. The new, native deferred updates feature has a slightly different API and is implemented differently than the Deferred Updates plugin. Migrating from the plugin will generally require some code changes (full details to come soon).
  3. ko.observable and ko.computed no longer use a closure when defining their methods, such as dispose and valueHasMutated. These functions expect this to be set correctly and so can't be used directly as a callback. Instead you'll need to use bind, such as obs.dispose.bind(obs).
Assets 4
You can’t perform that action at this time.