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).ko.observable
andko.computed
no longer use a closure when defining their methods, such asdispose
andvalueHasMutated
. These functions expectthis
to be set correctly and so can't be used directly as a callback. Instead you'll need to usebind
, such asobs.dispose.bind(obs)
.