This change log chronices the history of versions of the collections package before it became a single repository with multiple projects. Hereafter, individual packages are versioned and logged separately.
- Iterators have been reimplemented with an ES6 alike interface.
- Change observers have been reimplemented with an FRB alike interface.
- Removes support for
any
andall
. Usesome(Boolean)
orevery(Boolean)
.
- Adds an LfuSet, a set useful as a cache with a least-frequently-used eviction strategy.
- Fixes array
set
andswap
for indexes outside the bounds of the existing array, for both observed and unobserved arrays.
- Refinements on
Object.equals
andObject.compare
. These are not necessarily backward compatible, but should be a strict improvement: Object.compare
will now return +/- Infinity for inequal strings, rather than +/- 1 which imply that the distance between any two inequal strings is always 1.Object.compare
for numbers is suitable for finding the magnitude of the difference as well as the direction.Object.compare
andObject.equals
will now delegate to either non-null, non-undefined argument if the other argument is null or undefined. This allows objects to be constructed that will identify themselves as equivalent to null or undefined, for exampleAny
types, useful for testing.Object.equals
will only compare object literals derrived directly from theObject.prototype
. All other objects that do not implementcompare
are incomparable.- First attempt at fixing
set
,swap
, andsplice
, later fixed in v1.0.3.splice
must truncate thestart
index to the array length.swap
andset
should not.
- Bug fix for filter on map-like collections.
- Adds a Deque type based on a circular buffer of exponential capacity. (@petkaantonov)
- Implements
peek
,peekBack
,poke
, andpokeBack
on array shim for Deque “isomorphism”. - Fixes the cases where a change listener is added or removed during change dispatch. Neither listener will be informed until the next change. (@asolove)
- The property change listener system has been altered such that once a thunk has been installed on an object, it will not be removed, in order to avoid churn. Once a property has been observed, it is likely to be observed again.
- Fixes
Object.equals
for comparing NaN to itself, which should reporttrue
such that collections that useObject.equals
to identify values are able to findNaN
. Previously,NaN
could get stuck in a collection permanently. - In abstract, Collections previously identified duck types by
looking only at the prototype chain, ignoring owned properties.
Thus, an object could distinguish a property name that was being
used as a key of a record, from the same property name that was
being used as a method name. To improve performance and to face
the reality that oftentimes an owned property is in fact a method,
Collections no longer observe this distinction. That is, if an
object has a function by the appropriate name, either by ownership
or inheritance, it will be recognized as a method of a duck type.
This particularly affects
Object.equals
, which should be much faster now. - Fixes
Object.equals
such that property for property comparison between objects only happens if they both descend directly fromObject.prototype
. Previously, objects would be thus compared if they both descended from the same prototype. - Accommodate very large arrays with the
swap
shim. Previously, the size of an array swap was limited by the size of the JavaScript run-time stack. (@francoisfrisch) - Fixes
splice
on an array when given a negative start index. (@stuk) - Some methods accept an optional
equals
orindex
argument that may or may not be supported by certain collections, likefind
on aSortedSet
versus aList
. Collections that do not support this argument will now throw an error instead of silently ignoring the argument. - Fixes
Array#clone
cycle detection.
one
now returns a consistent value between changes of a sorted set.- All collections can now be required using the MontageJS style, as well as the Node.js style. I reserve the right to withdraw support for the current MontageJS style if in a future, backward-incompatible release of Montage migrated to the Node.js style.
- Identify Maps with
isMap
property instead ofkeys
, as ES6 proposeskeys
,values
, andentries
methods for arrays.
- Fixes the enumerability of dispatchesRangeChanges and dispatchesMapChanges on observable arrays (and others, incidentally).
- List and Set now dispatch valid range changes, at the penalty of making updates linear when they are made observable.
- Adds
join
method to generic collections. - Fixes a bug in
Object.has(object, value)
, where it would not delegate polymorphically toobject.has(value)
- Fixes
Object.addEach(object, undefined)
, such that it tolerates the case without throwing an error, likeaddEach
on other collections. - Fixes change dispatch on LruSet (Paul Koppen) such that a single change event gets dispatched for both augmentation and truncation.
- Fixes change dispatch on Dict, such that the value gets sent on addition.
- Factored out WeakMap into separately maintained package.
- Introduces
entries
and deprecatesitems
on all map collections. - Fixes Map clear change dispatch.
- Fixes Set clear change dispatch.
- Fixes a bug when the
plus
argument of swap is not an array.
- Fixes generic map change dispatch on clear.
- Adds map change dispatch to Dict.
- Require total order on SortedSet
- Remove Node v0.6 from supported versions
- Add Node v0.10 to supported versions
- Fixes
hrtime
handling (Alexy Kupershtokh)
...
- The
observable-array
andobservable-object
modules have been moved to the Functional Reactive Bindings (frb
) package asarray
andobject
. List
,Set
, andSortedSet
now support content change notifications compatibly withfrb
.- The
observable
module provides generics methods for observables. New collections need only call the appropriate dispatch functions ifisObservable
is true.