Changelog History
Page 1
-
v3.5.1 Changes
November 05, 2019๐ This release fixes a few regression bugs in 3.5.0:
- Empty template with
if
option throws an error #2446 - IE error from inserting a node before itself #2450
- Problem with initial
value
binding on<select>
when the options are generated via aforeach
binding #2452 - โก๏ธ Missing
arrayChange
notifications when using deferred updates #2454 - ๐ Template binding removes
<script>
template contents #2484
๐ 3.5.1 also fixes some issues with and expands 3.5.0's TypeScript definitions.
- Empty template with
-
v3.5.0 Changes
February 22, 2019๐ Knockout 3.5.0 includes a few new bindings and new ways to interact with observables and bindings. The full list is detailed under 3.5.0 Beta, 3.5.0 RC, and 3.5.0 RC2.
๐ The final 3.5.0 release includes fixes for a few regressions in the pre-production releases:
-
v3.5.0-rc2 Changes
September 08, 2018๐ This release includes a number of fixes for regressions in the previous 3.5.0 release candidate. Given the time since the RC, we also decided to include a few small improvements.
- ๐ Fix to maintain an element's focus when it's moved by the
foreach
binding. - ๐ Fix changes to
style
binding to correctly appendpx
. - ๐ Fix regression to
ko.contextFor
when used afterko.applyBindingsToNode
. - โช Revert changes in
ko.utils
to use native array methods. - โ Remove global
createChildContextWithAs
option and addnoChildContext
binding option. The default behavior foras
matches previous releases. - ๐ Fix the interaction of
descendantsComplete
andif
/ifnot
/with
bindings. - โ Add an option for
if
/ifnot
/with
bindings:completeOn: "render"
will have the binding wait to triggerdescendantsComplete
until it is rendered. - Throw an error for unbalanced virtual elements.
ko.applyBindings
throws an error if a non-Node is given as the second parameter.- ๐ Support an
options
objects as a parameter tocreateChildContext
. - ๐ Support a custom rate-limit function as the
method
parameter to therateLimit
extender. - ๐ Support setting custom CSS properties with the
style
binding. - โก๏ธ Optimize how many elements are moved by
foreach
. - โก๏ธ Update TypeScript declarations.
- ๐ Fix to maintain an element's focus when it's moved by the
-
v3.5.0-rc Changes
April 26, 2018๐ Changes since 3.5.0 Beta:
- Expand
descendantsComplete
to include bindings other thancomponent
, such asif
,with
, etc. ko.when
will return a Promise if called without a callback function.- Include TypeScript declarations.
- ๐ A few minor bug fixes.
- Expand
-
v3.5.0-beta Changes
December 29, 2017๐ Knockout 3.5.0 beta release notes
Full list of issues: https://github.com/knockout/knockout/milestone/9?closed=1
Important: This release includes some minor breaking changes to the
foreach
binding to improve performance and clarify features. These changes can be turned off using global options.๐ When using the
as
option with theforeach
binding, Knockout will set the named value for each item in the array but won't create a child context. In other words, when usingas
, you will have to use the named value in bindings:text: item.property
rather thantext: property
. This can be controlled by settingko.options.createChildContextWithAs = true
. (See #907)To improve performance when array changes are from a known, single operation, such as
push
, theforeach
binding no longer filters out destroyed items by default. To turn this off and filter out destroyed items, you can setincludeDestroyed: false
in theforeach
binding or setko.options.foreachHidesDestroyed = true
to use the previous behavior by default. (See #2324)Other enhancements
- You can react to the completion of bindings such as
if
andwith
using the newchildrenComplete
binding or subscribing to thechildrenComplete
binding event.
๐ (See #2310) - ๐ You can react to the completion of components, including nested components, by including a
koDescendantsComplete
method in the component viewmodel or subscribing to thedescendantsComplete
binding event. (See #2319) - ๐ Binding strings can include template literals (backticks) and C++ and C-style comments.
- Observable arrays include
sorted
andreversed
methods that return a modified copy of the array. This is in contrast tosort
andreverse
that modify the array itself. - ๐ The new
class
binding supports dynamic class strings. This allows you to use thecss
andclass
bindings together to support both methods of setting CSS classes. - โก๏ธ The new
using
binding, similarly towith
, binds its descendant elements in the context of the child viewmodel. Unlikewith
, which re-renders its contents when the viewmodel changes,using
will just trigger each descendant binding to update. - The new
hidden
binding works oppositely tovisible
. - The new
let
binding allows you to set values that can be used in all descendant element bindings, regardless of context. - ๐ Similarly to
let
, you can set such values at the root context by providing a function as the third parameter toko.applyBindings
. (See #2024) - ๐ Performance improvement: String templates are no longer parsed each time they are referenced. Instead the parsed nodes are cached and cloned.
- โก๏ธ Observables notify a new
spectate
event whenever their value changes. Unlike the standardchange
event, this new event isn't necessarily delayed by rate-limiting or deferred updates. You can subscribe to the event without waking a sleeping pure computed; the computed will notify the event if it is accessed with a new value. - Computed observables include a
getDependencies
method that returns an array of the observables that the computed is currently watching. - ๐ The
attr
binding supports namespaced attributes such asxlink:href
insvg
elements. - The
ko.when
function allows you to run code once when an observable or condition becomes true. - The
ko.isObservableArray
function can be used to check if something is ako.observableArray
. - ๐
The
style
binding will usejQuery
if present. Even without jQuery, the binding now supports standard style names, such asbackground-color
, and automatically appendspx
if needed to styles that expect it. - Knockout will throw an error if it finds an unmatched closing virtual element (
<!--/ko-->
).
๐ Fixes
๐ 30 or so separate fixes are included in this release,
- You can react to the completion of bindings such as
-
v3.4.2 Changes
March 06, 2017๐ 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)
-
v3.4.1 Changes
November 08, 2016๐ Fixed:
-
v3.4.0 Changes
November 17, 2015๐ 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)
.
-
v3.4.0-rc Changes
October 12, 2015๐ 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
- 0๏ธโฃ #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
andreverse
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
- 0๏ธโฃ #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
-
v3.3.0 Changes
February 18, 2015โจ Enhancements
๐ง #1504 - Component configuration can specify a
synchronous
option to render already loaded components synchronously.
#1463 - Component child elements are provided to thecreateViewModel
method, component child elements are exposed on the binding context as$componentTemplateNodes
, and thetemplate
binding can accept an array of DOM nodes directly through thenodes
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 anawake
event with the current value when awakening, pure computeds notify anasleep
event with anundefined
value when going to sleep, and thegetSubscriptionsCount
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 - Exportko.utils.setTextContent
#1427 - Exportko.dependencyDetection.ignore
asko.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 forforeach
/template
binding
#1513 - Fix error infixUpContinuousNodeArray
when usingjquery.tmpl
โก๏ธ #1515 - UpdatedependentObservable._latestValue
when a pureComputed wakes up (affects debug build only)
๐ #1526 - Component'srequire
option should not try to do an AMD-stylerequire
in a CommonJS scenario.
#1556 - Check that the value passed tooptionsAfterRender
is a function before calling
#1597 - CSS binding now works properly with SVG elements
#1606 - Don't bind contents of<textarea>
elements
โก๏ธ #1623 - When usingvalueAllowUnset: true
,null
selection should be maintained whenoption
items are updated.
๐ #1634 - Better clean-up ofarrayChange
subscriptions