Releases: immutable-js/immutable-js
v4.0.0-rc.12
Fixes:
- Update to support Flow v0.85 and makes Record strict typing optional to ease migration from v3 or earlier v4 release candidates (#1636)
v4.0.0-rc.11
Potentially Breaking:
- Improve hash speed and avoid collision for common values (#1629)
Causes some hash values to change, which could impact the order of iteration of values in some Maps (which are already advertised as unordered, but highlighting just to be safe)
- [TypeScript] Remove
Iterable<T>
as tuple from Map constructor types (#1626)Typescript allowed constructing a Map with a list of List instances, assuming each was a key, value pair. While this runtime behavior still works, this type led to more issues than it solved so it has been removed. (Note, this may break previous v4 rcs, but is not a change against v3)
Fixes:
- Give Records a
displayName
(#1625) Set.map
produces valid underlying map (#1606)- Support isPlainObj with
constructor
key (#1627)
Docs:
v4.0.0-rc.10
It's been a long time since the last release candidate, but quite a bit of work has happened since the last once. One step closer to a final release!
Breaking:
- Remove IteratorSequence. Do not attempt to detect iterators in
Seq()
. (#1589)Iterables can still be provided to
Seq()
, and most Iterators are also
Iterables, so this change should not affect the vast majority of uses.
For more information, see PR #1589 - Node buffers no longer considered value-equal
This was actually broken as of v4.0.0-rc.1 (2dcf3ef)
but was highlighted as a breaking change by (#1437)
New:
- Top level predicate functions (#1600)
New functions are exported from the
immutable
module:
isSeq()
,isList()
,isMap()
,isOrderedMap()
,isStack()
,isSet()
,isOrderedSet()
, andisRecord()
. - Support Typescript 3 (#1593)
- Support latest Flow (#1531)
- Add
RecordOf<TProps>
type alias for TypeScript, matching Flow (#1578) - Improved Flow support for Record subclasses (still not advised) (#1414)
- Improve performance of toJS (#1581)
Cursory test is >10% faster than both v3.8.2 and v4.0.0-rc.7,
and corrects the regression since v4.0.0-rc.9. - Added optional
notSetValue
infirst()
andlast()
(#1556) - Enable flow strict (#1580)
- Make
isArrayLike
check more precise to avoid false positives (#1520) map()
for List, Map, and Set returns itself for no-ops (#1455) (5726bd1)- Hash functions as objects, allowing functions as values in collections (#1485)
Fix:
groupBy
no longer returns a mutable Map instance (#1602)- Fix issue where refs can recursively collide, corrupting
.size
(#1598) - Throw error in
mergeWith()
method if missing the requiredmerger
function (#1543) - Update
isPlainObj()
to workaround Safari bug and allow cross-realm values (#1557) - The
mergeDeepWith
merger is untypable in TS/Flow. (#1532) - Fix missing "& T" to some methods in RecordInstance (#1464)
- Make notSetValue optional for typed Records (#1461) (a1029bb)
- Export type of RecordInstance (#1434)
- Fix Record
size
check in merge() (#1521) - Fix Map#concat being not defined (#1402)
v4.0.0-rc.9
v4.0.0-rc.8
BREAKING:
-
list.concat()
now has a slightly more efficient implementation andmap.concat()
is an alias formap.merge()
. (#1373)In rare cases, this may affect use of
map.concat()
which expected slightly different behavior frommap.merge()
. -
isImmutable()
now returns true for collections currently within awithMutations()
call. (#1374)Previously,
isImmutable()
did double-duty of both determining if a value was a Collection or Record from this library as well as if it was outside awithMutations()
call. This latter case caused confusion and was rarely used. -
Plain Objects and Arrays are no longer considered opaque values (#1369)
This changes the behavior of a few common methods with respect to plain Objects and Arrays where these were previously considered opaque to
merge()
andsetIn()
, they now are treated as collections and can be merged into and updated (persistently). This offers an exciting alternative to small Lists and Records. -
No longer use value-equality within
merge()
(#1391)This rectifies an inconsistent behavior between x.merge(y) and x.mergeDeep(y) where merge would use === on leaf values to determine return-self optimizations, while mergeDeep would use
is()
. This improves consistency across the library and avoids a possible performance pitfall.
New:
- Dramatically better Flow types for
getIn()
,setIn()
,updateIn()
which understand key paths (#1366, #1377) - Functional API for
get()
,set()
, and more which support both Immutable.js collections and plain Objects and Arrays (#1369)
Fixed:
v4.0.0-rc.7
Fixes:
- Fixed syntax error in typescript definitions which limited some checking (#1354)
v4.0.0-rc.6
v4.0.0-rc.5
BREAKING:
-
Concat Lists when merging deeply (#1344)
Previously, calling
map.mergeDeep()
with a value containing aList
would replace the values in the original List. This has always been confusing, and does not properly treatList
as a monoid. Now,List.merge
is simply an alias forList.concat
, andmap.mergeDeep()
will concatenate lists instead of replacing them. -
No longer deeply coerce argument to merge() (#1339)
Previously, the argument provided to
merge()
was deeply converted to Immutable collections viafromJS()
. This was the only function in the library which callsfromJS()
indirectly directly, and it was surprising and made it difficult to understand what the result ofmerge()
would be. Now, the value provided tomerge()
is only shallowly converted to an Immutable collection, similar to related methods in the library. This may change the behavior of your calls tomerge()
. -
KeyedCollection.toArray() returns array of tuples. (#1340)
Previously, calling
toArray()
on a keyed collection (inclMap
andOrderedMap
) would discard keys and return an Array of values. This has always been confusing, and differs fromArray.from()
. Now, callingtoArray()
on a keyed collection will return an Array of[key, value]
tuples, matching the behavior ofArray.from()
.
New:
- Much better documentation for Records (http://facebook.github.io/immutable-js/docs/#/Record) (#1349)
- Include version in build (#1345)
- Flow types
RecordOf<T>
andRecordFactory<T>
dramatically improve the Flow types for Records (#1343, #1330)
Fixed:
- zipAll type should predict undefined values (#1322)
- Do not throw when printing value that cannot be coerced to primitive (#1334)
- Ensure set.subtract() accepts any iterable. (#1338)
- Fix TypeScript definitions for merge functions (#1336)
- Ensure when OrderedSet becomes empty, that it remains OrderedSet (#1335)
- Fix slow iterator for Set (#1333)
- Add proper typescript type for
map.flip()
(#1332) - Set wasAltered() to false after List.asImmutable() (#1331)