immutable-js v4.0.0-rc.5 Release Notes
Release Date: 2017-10-05 // over 6 years ago-
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)