unstale

npm / immutable

immutable

What changed in immutable 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

23 breaking4 security1 deprecations23 new APIs and options2 performance3 behavior and defaults1 tooling19 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

immutable 534 changes

Breaking changes 11

  • On a lazy Seq of unknown size, has(index) checks whether the index exists instead of searching for a value equal to the index.

    5.1.7release notes

  • Removed the deprecated Collection.isAssociative method; use isAssociative directly.

    5.0.0release notes

  • Removed the deprecated Collection.isIndexed method; use isIndexed directly.

    5.0.0release notes

  • Removed the deprecated Collection.isIterable method; use isIterable directly.

    5.0.0release notes

  • Removed the deprecated Collection.isKeyed method; use isKeyed directly.

    5.0.0release notes

  • Removed the deprecated Collection.isOrdered method; use isOrdered directly.

    5.0.0release notes

  • Immutable no longer exports a default object containing its API; import named exports or use a namespace import.

    5.0.0release notes

  • Removed deprecated Map.of; use Map with an entry collection or object instead.

    5.0.0release notes

  • TypeScript Map definitions now more closely match simple objects, with get returning the value type for a known key and rejecting unknown keys.

    5.0.0release notes

  • Range now requires at least defined start and end values; use Range(0, Infinity) for an infinite range.

    5.0.0release notes

  • Fixed the return type of Map and Set sort.

    5.0.0release notes

Security 4

Fixes and other changes 19

  • TypeScript accepts a value typed KeyPath wherever a path is taken.

    5.2.1release notes

  • Fixes keySeq on a lazy indexed Seq of unknown size.

    5.2.0release notes

  • TypeScript types Record#getIn from the Record's properties, like MapOf#getIn.

    5.2.0release notes

  • Deleting or removing a required key now returns a MapOf without that key instead of never; deleting an optional key still keeps the type.

    5.1.10release notes

  • Reverse iteration of an indexed lazy Sequence of unknown size no longer produces NaN keys.

    5.1.10release notes

  • Slicing a zipped Sequence of unknown size from the end no longer causes a stack overflow.

    5.1.10release notes

  • Reverse iteration now produces correct keys for interposed Sequences.

    5.1.10release notes

  • Reverse iteration now produces correct keys for filtered indexed Seqs.

    5.1.10release notes

  • skipWhile and skipUntil on indexed Seqs now renumber iterator keys from 0; entries() no longer throws when exhausted, also fixing chained map/filter iteration and equals.

    5.1.10release notes

  • takeLast(0) now works on a Sequence of unknown size.

    5.1.10release notes

  • List now preserves undefined values when grown past 32 elements.

    5.1.9release notes

  • Repeat.lastIndexOf now returns size - 1 instead of size for the last index.

    5.1.7release notes

  • The type for reduce is improved when no initial value is given.

    5.1.7release notes

  • The reverseFactory iterator now reads reversedSequence.size instead of this, fixing reversed-sequence iteration behavior.

    5.1.6release notes

  • Fixed an issue with an empty list that is a singleton.

    5.0.0release notes

  • Fixed type inference for first().

    5.0.0release notes

  • Fixed hashCode for OrderedMap and OrderedSet so equal objects return the same hashCode.

    5.0.0release notes

  • Fixed type inference for last().

    5.0.0release notes

  • Fixed the return type of Map and Set sortBy.

    5.0.0release notes

immutable 442 changes

Breaking changes 12

  • getIn() no longer throws when encountering a missing path and warns instead of throwing for a bad path.

    4.0.0release notes

  • Hash speed was improved and collisions for common values avoided; some hash values and iteration order in Maps may change.

    4.0.0release notes

  • The predicate functions isCollection, isKeyed, isIndexed, and isAssociative moved from Iterable to top-level exports.

    4.0.0release notes

  • isImmutable() now returns true for collections currently within a withMutations() call.

    4.0.0release notes

  • Iterable was renamed to Collection; aliases with the existing names remain to ease transition.

    4.0.0release notes

  • The TypeScript Iterable<T> tuple typing was removed from Map constructor types; the runtime behavior still works.

    4.0.0release notes

  • map.concat() is now an alias for map.merge(), which may affect code relying on their previously different behavior.

    4.0.0release notes

  • Node buffers are no longer considered value-equal.

    4.0.0release notes

  • Record is no longer an Immutable Collection; isCollection(record) returns false, and its sequence API, delete(), and clear() are unavailable.

    4.0.0release notes

  • Seq.of() was removed because it cannot be correctly typed; use Seq([1, 2, 3]) instead.

    4.0.0release notes

  • Seq() no longer detects iterators; iterables can still be provided.

    4.0.0release notes

  • toJSON() now performs a shallow conversion; toJS() remains the deep conversion.

    4.0.0release notes

Deprecations 1

  • The Cursor API is officially deprecated; the notes recommend immutable-cursor instead.

    4.0.0release notes

New APIs and options 23

  • Collection types now implement the ES6 iterable protocol.

    4.0.0release notes

  • zipAll() is added to indexed collections.

    4.0.0release notes

  • toJSON() is available on Collection and collection types for shallow conversion.

    4.0.0release notes

  • The update method is added to Collection and its subtypes.

    4.0.0release notes

  • first() accepts an optional notSetValue argument.

    4.0.0release notes

  • A functional API for get() supports Immutable.js collections and plain Objects and Arrays.

    4.0.0release notes

  • The renamed isCollection() predicate replaces isIterable(); the old name remains as an alias.

    4.0.0release notes

  • isList() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isMap() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isOrderedMap() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isOrderedSet() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isRecord() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isSeq() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isSet() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isStack() is exported from the immutable module as a top-level predicate.

    4.0.0release notes

  • isValueObject() detects objects implementing equals() and hashCode().

    4.0.0release notes

  • last() accepts an optional notSetValue argument.

    4.0.0release notes

  • deleteAll() is added to Map.

    4.0.0release notes

  • A functional API for set() supports Immutable.js collections and plain Objects and Arrays.

    4.0.0release notes

  • Immutable.js adds support for Transducers.

    4.0.0release notes

  • The ValueObject interface can be implemented by objects that should behave as values and serve as Map keys or Set entries.

    4.0.0release notes

  • wasAltered() is added to mutable-capable collection types.

    4.0.0release notes

  • A new zipAll() method is available.

    4.0.0release notes

Performance 2

  • An ES module is bundled and distributed so Webpack and Rollup can tree-shake for smaller builds.

    4.0.0release notes

  • toJS performance improved; the notes report a cursory test more than 10% faster than the compared releases.

    4.0.0release notes

Behavior and default changes 3

  • fromJS() supports Sets, and its reviver receives the key path to each translated value.

    4.0.0release notes

  • List.merge is now an alias for List.concat.

    4.0.0release notes

  • Seq() supports Sets.

    4.0.0release notes

Tooling 1

  • TypeScript and Flow definitions were rewritten for higher quality and accuracy, with support for TypeScript 3 and strictNullChecks and current Flow.

    4.0.0release notes