immutable-js v4.0.0-rc.8 Release Notes

Release Date: 2017-10-17 // over 2 years ago
  • BREAKING:

    🔀 list.concat() now has a slightly more efficient implementation and map.concat() is an alias for map.merge(). (#1373)

    🔀 In rare cases, this may affect use of map.concat() which expected slightly different behavior from map.merge().

    isImmutable() now returns true for collections currently within a withMutations() 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 a withMutations() 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() and setIn(), 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:

    • getIn() no longer throws when encountering a missing path (#1361)
    • Flow string enums can now be used as Map keys or Record fields (#1376)
    • Flow now allows record.get() to provide a not-set-value (#1378)
    • 🛠 Fixed Flow return type for Seq.Set() (3e671a2)