Version 3.4.2

@mbest mbest released this Mar 6, 2017 · 53 commits to master since this release

This release fixes a number of bugs related to deferred updates and computed observables.

  • stop infinite loop from dirty events in circular computeds (#1943)
  • only update a computed if dependency has actually changed; not if it was just dirty (#2174)
  • only notify subscriptions that exist when a change occurs; don't notify future subscribers (#2163)
  • notify dependent computed of change in reverted observable if the computed previously read a different intermediate value (#1835)
  • update a pure computed if a dependency has changed and notification is pending (#2197)

Downloads

Version 3.4.1

@mbest mbest released this Nov 8, 2016 · 53 commits to master since this release

Fixed:

  • pureComputed sometimes doesn't pick up a change in a dependency (#1975 and #1992)
  • Knockout observable arrays leak memory when resubscribing to arrayChange events (#1973 and #1974)
  • $rawData within with bindings and rendered templates (#1415)
  • Export computed._latestValue in debug mode (b3f24b1)

Downloads

Version 3.4.0

@mbest mbest released this Nov 17, 2015 · 54 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).

Downloads

3.4.0 Release Candidate

@mbest mbest released this Oct 12, 2015 · 62 commits to master since this release

Knockout 3.4.0rc release notes

Enhancements

  • #1715 - Add ko.onError handler that provides more consistent error/stack information for async operations and event handlers
  • #1728 - Include deferred updates functionality in Knockout core
    • #1738 - Deferred Updates 1 - ko tasks functionality; deferred extender for enabling deferred Updates
    • #1753 - Deferred Updates 2 - add ability to turn on deferred updates globally by setting ko.options.deferUpdates = true;
    • #1795 - Deferred Updates 3 - dependency tree scheduling
  • #1774 - Add ko.options.useOnlyNativeEvents (default false) that can control if KO uses jQuery (if available) for binding events
  • #1839 - Performance Improvement - for named templates that use a template or normal element use the element directly as the template to clone
  • #1840 - Performance Improvement - Make observables 2-3x faster to instantiate and reduce memory usage by 50%
  • #1841 - Performance Improvement - Make computeds 2x faster to instantiate and reduce memory usage by 50%
  • #1870 - Add ko.isPureComputed.

Fixes

  • #1256 - Better handling when an item is added while a beforeRemove animation is running
  • #1380 - observableArray sort and reverse methods now return the observableArray rather than the underlying array
  • #1510 - Do not define a custom element when a component name matches a standard element
  • #1591 - Make checked binding work properly with writable computed observables
  • #1613 - IE8 issue with calling .apply with an empty second argument
  • #1683 - Rearrange code to avoid prototype issue in Opera mobile
  • #1709 - dontLimitMoves option should be respected when comparing arrays
  • #1718 - ko.toJS no longer replaces RegExp objects with plain objects
  • #1756 - Use a hasOwnProperty check when registering components
  • #1781 - Trim string in default css binding
  • #1783 - Skip template elements when binding
  • #1788 - Fix textInput edge case in IE9
  • #1790 - Remove version from bower.json and don't update it in build
  • #1794 - Exception in an afterAdd callback should not cause duplicate elements
  • #1810 - Don't check for require for CommonJS
  • #1855 - Fix potential memory leak in component binding
  • #1893 - hasFocus fixes in IE

Downloads

Version 3.3.0

@mbest mbest released this Feb 18, 2015 · 182 commits to master since this release

Enhancements

#1504 - Component configuration can specify a synchronous option to render already loaded components synchronously.
#1463 - Component child elements are provided to the createViewModel method, component child elements are exposed on the binding context as $componentTemplateNodes, and the template binding can accept an array of DOM nodes directly through the nodes option.
#1449 - Binding context now contains a $component property that references the nearest component view model (allows for easily binding to the root of the current component).
#1596 - Create a writable computed within a custom element component when an expression evaluates to an observable (less need to use .$raw property).
#1576 - computed observables (pure or deferred) notify an awake event with the current value when awakening, pure computeds notify an asleep event with an undefined value when going to sleep, and the getSubscriptionsCount method on an observable can accept an event name argument to return only the count of subscriptions for that event.
#1543 - Sleeping pure computed observables now cache their value.
#1635 - Export ko.utils.setTextContent
#1427 - Export ko.dependencyDetection.ignore as ko.ignoreDependencies

Fixes

#1321 - Ensure that template nodes are created and moved within the correct document to fix cross-window issues in IE.
#1434 - Binding parser skips all colons between the name and value. Support returning malformed bindings (non key-value pairs).
#1468 - css binding was not clearing a previously added dynamic class when the value bound against changes to null.
#1507 - Memory leak fix for foreach/template binding
#1513 - Fix error in fixUpContinuousNodeArray when using jquery.tmpl
#1515 - Update dependentObservable._latestValue when a pureComputed wakes up (affects debug build only)
#1526 - Component's require option should not try to do an AMD-style require in a CommonJS scenario.
#1556 - Check that the value passed to optionsAfterRender is a function before calling
#1597 - CSS binding now works properly with SVG elements
#1606 - Don't bind contents of <textarea> elements
#1623 - When using valueAllowUnset: true, null selection should be maintained when option items are updated.
#1634 - Better clean-up of arrayChange subscriptions

Downloads

v3.3.0-alpha

@SteveSanderson SteveSanderson released this Nov 13, 2014 · 239 commits to master since this release

Add tag v3.3.0-alpha

Downloads

Version 3.2.0

@SteveSanderson SteveSanderson released this Aug 12, 2014 · 278 commits to master since this release

Knockout 3.2.0 release notes

Enhancements

  • 1290 - Components infrastructure and binding. Reusable, extensible components that can dynamically combine a view model and template. Component documentation
  • 1385 - Custom elements as a way to consume components (example: <my-component params="value: price, format: priceFormat"></my-component>). Custom element documentation
  • 1359 - ko.pureComputed - a computed that sleeps when it has no dependencies. Pure computed documentation
  • 1160 - Added textInput binding for robust handling of real-time updates (key presses, pasting, drag-and-drop, etc.) to a field as an alternative to value binding with valueUpdate options. textInput documentation
  • 1146 - Make the value binding act like checkedValue when used on same element as checked binding.
  • 1039 - Bower support now includes distributable (built) files (3.1.0 release was also updated to include these files).

Fixes

  • 1334 - Fixed an issue with the value binding when used with afterkeydown and rateLimit.
  • 972 - Fixed handling of 0 in style binding.
  • 1252 - Fixed ko.utils.postJson truncation issue.
  • 1433 - Make template/foreach work with an observable name option.

Downloads

Version 3.2.0 Alpha

@SteveSanderson SteveSanderson released this May 14, 2014 · 314 commits to master since this release

v3.2.0-alpha

Add tag v3.2.0-alpha

Downloads

Version 3.1.0

@SteveSanderson SteveSanderson released this May 14, 2014 · 354 commits to master since this release

This release focuses mainly on performance and stability/compatibility improvements, plus small enhancements to existing functionality (yes, we're saving the big new features for v3.2). So, in 3.1:

New features

  • #1190 - new rate limiting functionality to have better control and flexibility over throttle/debounce scenarios
  • #1003 - renderTemplate now supports the name argument being observable.
  • #647 - add valueAllowUnset option that allows the value binding to accept a selected value that is not currently in the list of options
  • #627 - provide access to dependency count and whether it is the first evaluation within a computed
  • #1151 - provide item index to array util method callbacks
  • #1272 - deferred computeds will now be evaluated on a manual subscription, if not previously evaluated
  • #865 - ko.utils.domNodeDisposal.cleanExternalData extensibility point can be overriden (perhaps to prevent jQuery.cleanData from being called in some scenarios)

Perf improvements

  • #775 - in browsers that support setting proto, set subscribable/observable/computed/observableArray prototype rather than copy methods from "fn" objects.
  • #1221 - use objects instead of arrays to track computed dependencies (can be major perf boost in older IE when there are lots of dependencies on a single computed/observable).
  • #1199 - various performance optimizations related to array operations

Bugs fixed

  • #844 - prevent older IE errors with options binding used in separate document
  • #1081 - prevent option placeholder from being re-added in update
  • #1191 - remove jQuery workaround related to checked binding when using newer jQuery versions.
  • #1193 - look for jQuery instance in ko.applyBindings, if it was not available when KO was loaded. This helps to prevent issues with KO not taking advantage of jQuery, if it was not loaded before KO.
  • #1206 - for observable view models, $rawData should be the observable
  • #1207 - "arrayChange" tracking no longer assumes all items added are new on a splice
  • #1208 - older IE issue with options binding related to optionsCaption being removed on each update
  • #1209 - prevent a deferred computed that is disposed before evaluation from taking dependencies when evaluated
  • #1214 - prevent errors when using the value binding with jQuery templates
  • #1255 - track observables accessed in getBindingAccessors - helps backwards compatibility with custom binding providers
  • #1289 - prevent adding a disposal callback when disposeWhenNodeIsRemoved value is not a node
  • #1306 - value binding - fix issue related to autocomplete tracking always firing update in browsers that don't fire change event on autocomplete

Downloads