immutable 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 a List would replace the values in the original List. This has always been confusing, and does not properly treat List as a monoid. Now, List.merge is simply an alias for List.concat, and map.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 via fromJS(). This was the only function in the library which calls fromJS() indirectly directly, and it was surprising and made it difficult to understand what the result of merge() would be. Now, the value provided to merge() is only shallowly converted to an Immutable collection, similar to related methods in the library. This may change the behavior of your calls to merge().

    KeyedCollection.toArray() returns array of tuples. (#1340)

    Previously, calling toArray() on a keyed collection (incl Map and OrderedMap) would discard keys and return an Array of values. This has always been confusing, and differs from Array.from(). Now, calling toArray() on a keyed collection will return an Array of [key, value] tuples, matching the behavior of Array.from().

    ๐Ÿ†• New:

    ๐Ÿ›  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)