knockout v3.4.0 Release Notes

Release Date: 2015-11-17 // over 8 years ago
  • ๐Ÿ†• 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).

    1. 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).