NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1081 most downloaded on npm
Immutable Data Collections
Last release 1 months ago
16 Aug 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
123 releases · first in 2013
See CHANGELOG.md for v6.0.0
fix(List): preserve undefined values when grown past 32 elements by @spokodev / @jdeniau in #2235 (originated from #2230 )
Full Changelog: v5.1.8...v5.1.9
One column per quarter.
List grown past 32 elements while all its values are undefined no longer reads those values back as null (affected get, iteration, toArray, equals and hashCode)fix(List): guard oversized bounds in setListBounds. Fixes CVE GHSA-v56q-mh7h-f735
Full Changelog: v5.1.7...v5.1.8
fix(Repeat): lastIndexOf returned size instead of size - 1 by @chatman-media in #2227
has(index) on a lazy Seq of unknown size now checks index existence instead of searching for a value equal to the index by @jdeniau in #2203Full Changelog: v5.1.6...v5.1.7
has(index) on a lazy Seq of unknown size now checks index existence instead of searching for a value equal to the index #2203reduce/reduceRight without an initial value now infer the result type from the collection's values when the reducer returns a value (e.g. list.reduce((a, b) => a + b) infers number), matching Array#reduce. Previously an explicit type argument was required. #2205fix(reverseFactory): read reversedSequence.size in __iterator instead of this by @jdeniau in #2196
Full Changelog: v5.1.5...v5.1.6
reversedSequence.size in __iterator instead of this #2196Fix Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in immutable
Full Changelog: v5.1.4...v5.1.5
Migrate some files to TS by @jdeniau in https://github.com/immutable-js/immutable-js/pull/2125
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.1.3...v5.1.4
fix: allow readonly map entry constructor by @septs in https://github.com/immutable-js/immutable-js/pull/2123
There has been a huge amount of changes in the documentation, mainly migrate from an autogenerated documentation from .d.ts file, to a proper documentation in markdown. The playground has been included on nearly all method examples. We added a page about browser extensions too: https://immutable-js.com/browser-extension/
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.1.2...v5.1.3
Revert previous assertion as it introduced a regression by by @giggo1604 in https://github.com/immutable-js/immutable-js/pull/2100 and @jdeniau in htt
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.1.1...v5.1.2
Fix issue in builded types files in 5.1.0 due to cpy-cli upgrade
Fix issue in builded types files in 5.1.0 due to cpy-cli upgrade
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.1.0...v5.1.1
Add shuffle to list #2066 by @mazerty
RetrievePath #2070 by @jdeniauFull Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.2...v5.1.0
Fix List.VNode.removeAfter() / removeBefore() issue on some particular case by @alexvictoor in https://github.com/immutable-js/immutable-js/pull/2030
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.2...v5.0.3
Fix wrong path for esm module after fix in 5.0.1
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.1...v5.0.2
Fix circular dependency issue with ESM build by @iambumblehead in https://github.com/immutable-js/immutable-js/pull/2035
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.0...v5.0.1
To sum up, the big change in 5.0 is a Typescript change related to Map that is typed closer to the JS object. This is a huge change for TS users, but
To sum up, the big change in 5.0 is a Typescript change related to Map that is typed closer to the JS object. This is a huge change for TS users, but do not impact the runtime behavior. (see Improve TypeScript definition for Map for more details)
Other breaking changes are:
Released in 5.0.0-rc.1
Map.of('k', 'v'): use Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' })Collection.isIterable: use isIterable directlyCollection.isKeyed: use isKeyed directlyCollection.isIndexed: use isIndexed directlyCollection.isAssociative: use isAssociative directlyCollection.isOrdered: use isOrdered directlyOrdererMap and OrderedSet hashCode implementation has been fixedReleased in 5.0.0-rc.1
Fix issue implementation of hashCode for OrdererMap and OrderedSet where equal objects might not return the same hashCode.
Changed in #2005
Released in 5.0.0-beta.5
Range with undefined would end in an infinite loop. Now, you need to define at least the start and end values.
If you need an infinite range, you can use Range(0, Infinity).
Released in 5.0.0-beta.1
Immutable does not export a default object containing all it's API anymore.
As a drawback, you can not immport Immutable directly:
- import Immutable from 'immutable';
+ import { List, Map } from 'immutable';
- const l = Immutable.List([Immutable.Map({ a: 'A' })]);
+ const l = List([Map({ a: 'A' })]);
If you want the non-recommanded, but shorter migration path, you can do this:
- import Immutable from 'immutable';
+ import * as Immutable from 'immutable';
const l = Immutable.List([Immutable.Map({ a: 'A' })]);
MapReleased in 5.0.0-beta.1
If you do use TypeScript, then this change does not impact you : no runtime change here. But if you use Map with TypeScript, this is a HUGE change ! Imagine the following code
const m = Map({ length: 3, 1: 'one' });
This was previously typed as Map<string, string | number>
and return type of m.get('length') or m.get('inexistant') was typed as string | number | undefined.
This made Map really unusable with TypeScript.
Now the Map is typed like this:
MapOf<{
length: number;
1: string;
}>
and the return type of m.get('length') is typed as number.
The return of m.get('inexistant') throw the TypeScript error:
Argument of type '"inexistant"' is not assignable to parameter of type '1 | "length"
This is a minor BC for TS users, so if you want to keep the old definition, you can declare you Map like this:
const m = Map<string, string | number>({ length: 3, 1: 'one' });
You might want to declare a wider definition, you can type your Map like this:
type MyMapType = {
length: number;
1: string | null;
optionalProperty?: string;
};
const m = Map<MyMapType>({ length: 3, 1: 'one' });
Keep in mind that the MapOf will try to be consistant with the simple TypeScript object, so you can not do this:
Map({ a: 'a' }).set('b', 'b');
Map({ a: 'a' }).delete('a');
Like a simple object, it will only work if the type is forced:
Map<{ a: string; b?: string }>({ a: 'a' }).set('b', 'b'); // b is forced in type and optional
Map<{ a?: string }>({ a: 'a' }).delete('a'); // you can only delete an optional key
Map methods implemented ?For now, only get, getIn, set, update, delete, remove, toJS, toJSON methods are implemented. All other methods will fallback to the basic Map definition. Other method definition will be added later, but as some might be really complex, we prefer the progressive enhancement on the most used functions.
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.3...v5.0.0
Map and Set sort and sortBy return type by @jdeniau in https://github.com/immutable-js/immutable-js/pull/2013
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.0-beta.5...v5.0.0-rc.2
Fix type inference for first() and last() by @butchler in https://github.com/immutable-js/immutable-js/pull/2001
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v5.0.0-beta.5...v5.0.0-rc.1
## What's Changed Merge fixes from v4.3.5
Merge fixes from v4.3.5
Revert tree-shaking possibility as it does break. Moreover, as nearly every collection type can be converted to another collection (Map().toList() for
Revert tree-shaking possibility as it does break. Moreover, as nearly every collection type can be converted to another collection (Map().toList() for example), so nearly no code was removed.
I think that if we want to implement this, we might need to rethink this functionality.
Nothing published for this version
Merge main branch into 5.x for 4.3.4 fixes.
Merge main branch into 5.x for 4.3.4 fixes.
Immutable does not export a default object containing all it's API anymore. It changes the output of your JS file if you use a bundler that supports t
Immutable does not export a default object containing all it's API anymore.
It changes the output of your JS file if you use a bundler that supports tree-shaking (all modern bundler do).
As a drawback, you can not immport Immutable directly:
- import Immutable from 'immutable';
+ import { List, Map } from 'immutable';
- const l = Immutable.List([Immutable.Map({ a: 'A' })]);
+ const l = List([Map({ a: 'A' })]);
If you want the non-recommanded, but shorter migration path, you can do this:
- import Immutable from 'immutable';
+ import * as Immutable from 'immutable';
const l = Immutable.List([Immutable.Map({ a: 'A' })]);
MapIf you do not use TypeScript, then this change does not impact you : no runtime change here. But if you use Map with TypeScript, this is a HUGE change !
Imagine the following code
const m = Map({ length: 3, 1: 'one' });
This was previously typed as Map<string, string | number>
and return type of m.get('length') or m.get('inexistant') was typed as string | number | undefined.
This made Map really unusable with TypeScript.
Now the Map is typed like this:
MapOf<{
length: number;
1: string;
}>
and the return type of m.get('length') is typed as number.
The return of m.get('inexistant') throw the TypeScript error:
Argument of type '"inexistant"' is not assignable to parameter of type '1 | "length"
This is a minor BC for TS users, so if you want to keep the old definition, you can declare you Map like this:
const m = Map<string, string | number>({ length: 3, 1: 'one' });
You might want to declare a wider definition, you can type your Map like this:
type MyMapType = {
length: number;
1: string | null;
optionalProperty?: string;
};
const m = Map<MyMapType>({ length: 3, 1: 'one' });
Keep in mind that the MapOf will try to be consistant with the simple TypeScript object, so you can not do this:
Map({ a: 'a' }).set('b', 'b');
Map({ a: 'a' }).delete('a');
Like a simple object, it will only work if the type is forced:
Map<{ a: string; b?: string }>({ a: 'a' }).set('b', 'b'); // b is forced in type and optional
Map<{ a?: string }>({ a: 'a' }).delete('a'); // you can only delete an optional key
Map methods implemented ?For now, only get, getIn, set, update, delete, remove, toJS, toJSON methods are implemented. All other methods will fallback to the basic Map definition. Other method definition will be added later, but as some might be really complex, we prefer the progressive enhancement on the most used functions.
fix(List): guard oversized bounds in setListBounds. Fixes CVE GHSA-v56q-mh7h-f735
Full Changelog: v4.3.8...v4.3.9
Fix Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in immutable
Fix Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in immutable
Fix issue with slice negative of filtered sequence by @jdeniau in https://github.com/immutable-js/immutable-js/pull/2006
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.6...v4.3.7
Fix Repeat( ).equals(undefined) incorrectly returning true by @butchler in https://github.com/immutable-js/immutable-js/pull/1994
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.5...v4.3.6
Fix Set.fromKeys types with Map constructor in TS 5.0 by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1971
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.4...v4.3.5
Rollback toJS type due to circular reference error by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1958
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.3...v4.3.4
[typescript] manage to handle toJS circular reference. #1932 by @jdeniau
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.1...v4.3.3
Fix isOrderedSet type by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1948
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.1...v4.3.2
remove unused exports by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1928
some by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1944Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.3.0...v4.3.1
TS: update method may return undefined by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1933
update method may return undefined by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1933Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.2.4...v4.3.0
release 4.2.3 by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1926
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.2.3...v4.2.4
upgrade dtslint to test version >= 4.6 by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1921
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.2.2...v4.2.3
groupBy return either a Map or an OrderedMap: make the type more precise than base Collection #1924Add partition to flow spec by @Dagur in https://github.com/immutable-js/immutable-js/pull/1920
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.2.1...v4.2.2
[Typescript] rollback some of the change on toJS to avoir circular reference by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1922
toJS to avoir circular reference by @jdeniau in https://github.com/immutable-js/immutable-js/pull/1922Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.2.0...v4.2.1
Added a partition method to all containers #1916 by johnw42
partition method to all containers #1916 by johnw42Docs: https://immutable-js.com/docs/v4.1.0/ Changelog Doc: https://github.com/immutable-js/immutable-js/blob/fb4701a71ca3b138cb31b6697f047e637780867e/
Docs: https://immutable-js.com/docs/v4.1.0/ Changelog Doc: https://github.com/immutable-js/immutable-js/blob/fb4701a71ca3b138cb31b6697f047e637780867e/CHANGELOG.md#410---2022-05-23 Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.0.0...v4.1.0
There were mostly bugfixes and improvements since RC 12. Upgrading should be painless for most users. However, there is one breaking change: The behav…
Docs: https://immutable-js.com/docs/v4.0.0/ Full Changelog: https://github.com/immutable-js/immutable-js/compare/v3.8.1...v4.0.0
merge and mergeDeep has changedIterable is renamed to Collection<details><summary> Diff of changed API (click to expand)</summary>
+ Collection.[Symbol.iterator]
+ Collection.toJSON
+ Collection.update
+ Collection.Indexed.[Symbol.iterator]
+ Collection.Indexed.toJSON
+ Collection.Indexed.update
+ Collection.Indexed.zipAll
+ Collection.Keyed.[Symbol.iterator]
+ Collection.Keyed.toJSON
+ Collection.Keyed.update
+ Collection.Set.[Symbol.iterator]
+ Collection.Set.toJSON
+ Collection.Set.update
- Collection.size
- Collection.Indexed.size
- Collection.Keyed.size
- Collection.Set.size
+ List.[Symbol.iterator]
+ List.toJSON
+ List.wasAltered
+ List.zipAll
- List.mergeDeep
- List.mergeDeepWith
- List.mergeWith
+ Map.[Symbol.iterator]
+ Map.deleteAll
+ Map.toJSON
+ Map.wasAltered
+ OrderedMap.[Symbol.iterator]
+ OrderedMap.deleteAll
+ OrderedMap.toJSON
+ OrderedMap.wasAltered
+ OrderedSet.[Symbol.iterator]
+ OrderedSet.toJSON
+ OrderedSet.update
+ OrderedSet.wasAltered
+ OrderedSet.zip
+ OrderedSet.zipAll
+ OrderedSet.zipWith
+ Record.[Symbol.iterator]
+ Record.asImmutable
+ Record.asMutable
+ Record.clear
+ Record.delete
+ Record.deleteIn
+ Record.merge
+ Record.mergeDeep
+ Record.mergeDeepIn
+ Record.mergeDeepWith
+ Record.mergeIn
+ Record.mergeWith
+ Record.set
+ Record.setIn
+ Record.toJSON
+ Record.update
+ Record.updateIn
+ Record.wasAltered
+ Record.withMutations
+ Record.Factory.displayName
- Record.butLast
- Record.concat
- Record.count
- Record.countBy
- Record.entries
- Record.entrySeq
- Record.every
- Record.filter
- Record.filterNot
- Record.find
- Record.findEntry
- Record.findKey
- Record.findLast
- Record.findLastEntry
- Record.findLastKey
- Record.first
- Record.flatMap
- Record.flatten
- Record.flip
- Record.forEach
- Record.groupBy
- Record.includes
- Record.isEmpty
- Record.isSubset
- Record.isSuperset
- Record.join
- Record.keyOf
- Record.keySeq
- Record.keys
- Record.last
- Record.lastKeyOf
- Record.map
- Record.mapEntries
- Record.mapKeys
- Record.max
- Record.maxBy
- Record.min
- Record.minBy
- Record.reduce
- Record.reduceRight
- Record.rest
- Record.reverse
- Record.skip
- Record.skipLast
- Record.skipUntil
- Record.skipWhile
- Record.slice
- Record.some
- Record.sort
- Record.sortBy
- Record.take
- Record.takeLast
- Record.takeUntil
- Record.takeWhile
- Record.toArray
- Record.toIndexedSeq
- Record.toKeyedSeq
- Record.toList
- Record.toMap
- Record.toOrderedMap
- Record.toOrderedSet
- Record.toSet
- Record.toSetSeq
- Record.toStack
- Record.valueSeq
- Record.values
+ Seq.[Symbol.iterator]
+ Seq.toJSON
+ Seq.update
+ Seq.Indexed.[Symbol.iterator]
+ Seq.Indexed.toJSON
+ Seq.Indexed.update
+ Seq.Indexed.zipAll
+ Seq.Keyed.[Symbol.iterator]
+ Seq.Keyed.toJSON
+ Seq.Keyed.update
+ Seq.Set.[Symbol.iterator]
+ Seq.Set.toJSON
+ Seq.Set.update
+ Set.[Symbol.iterator]
+ Set.toJSON
+ Set.update
+ Set.wasAltered
+ Stack.[Symbol.iterator]
+ Stack.toJSON
+ Stack.update
+ Stack.wasAltered
+ Stack.zipAll
+ ValueObject.equals
+ ValueObject.hashCode
- Iterable.*
- Iterable.Indexed.*
- Iterable.Keyed.*
- Iterable.Set.*
</details>
There were mostly bugfixes and improvements since RC 12. Upgrading should be painless for most users.
However, there is one breaking change: The behavior of merge and mergeDeep has changed. See below for details.
No longer use value-equality within merge() (#1391)
This rectifies an inconsistent behavior between
x.merge(y)andx.mergeDeep(y)where merge would use===on leaf values to determine return-self optimizations, while mergeDeep would useis(). This improves consistency across the library and avoids a possible performance pitfall.
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, 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().
Replace incompatible collections when merging nested data (#1840)
It will no longer merge lists of tuples into maps. For more information see #1840 and the updated
mergeDeep()documentation.
Concat Lists when merging deeply (#1344)
Previously, calling
map.mergeDeep()with a value containing aListwould replace the values in the original List. This has always been confusing, and does not properly treatListas a monoid. Now,List.mergeis simply an alias forList.concat, andmap.mergeDeep()will concatenate deeply-found lists instead of replacing them.
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
Remove Seq.of() (#1311, #1310)
This method has been removed since it cannot be correctly typed. It's recommended to convert
Seq.of(1, 2, 3)toSeq([1, 2, 3]).
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 awithMutations()call. This latter case caused confusion and was rarely used.
KeyedCollection.toArray() returns array of tuples. (#1340)
Previously, calling
toArray()on a keyed collection (inclMapandOrderedMap) 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().
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 frommap.merge().
IterableIterable class has been renamed to Collection, and isIterable() has been renamed to isCollection().
Aliases with the existing names exist to make transitioning code easier.isCollection(myRecord) returns false instead of true.map, filter, forEach) no longer exist on Records.delete() and clear() no longer exist on Records.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)
Node buffers no longer considered value-equal (#1437)
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.
The "predicate" functions, isCollection, isKeyed, isIndexed, isAssociative have been moved from Iterable. to the top level exports.
The toJSON() method performs a shallow conversion (previously it was an alias for toJS(), which remains a deep conversion).
Some minor implementation details have changed, which may require updates to libraries which deeply integrate with Immutable.js's private APIs.
The Cursor API is officially deprecated. Use immutable-cursor instead.
Potentially Breaking: [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)
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v3.8.1...v4.0.0
<!-- 4.0.0-rc.15 -->
Add "sideEffects: false" to package.json (#1661)
Use ES standard for iterator method reuse (#1867)
Generalize fromJS() and Seq() to support Sets (#1865)
Top level predicate functions (#1600)
New functions are exported from the
immutablemodule:isSeq(),isList(),isMap(),isOrderedMap(),isStack(),isSet(),isOrderedSet(), andisRecord().
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 in first() and last() (#1556)
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)
Functional API for get(), set(), and more which support both Immutable.js collections and plain Objects and Arrays (#1369)
Relicensed as MIT (#1320)
Support for Transducers! (ee9c68f1)
Add new method, zipAll() (#1195)
Bundle and distribute an "es module" so Webpack and Rollup can use tree-shaking for smaller builds (#1204)
Warn instead of throw when getIn() has a bad path (668f2236)
A new predicate function isValueObject() helps to detect objects which implement equals() and hashCode(),
and type definitions now define the interface ValueObject which you can implement in your own code to create objects which
behave as values and can be keys in Maps or entries in Sets.
Using fromJS() with a "reviver" function now provides access to the key path to each translated value. (#1118)
Fix issue with IE11 and missing Symbol.iterator (#1850)
Fix ordered set with map (#1663)
Do not modify iter during List.map and Map.map (#1649)
Fix ordered map delete all (#1777)
Hash symbols as objects (#1753)
Fix returning a Record in merge() when Record is empty (#1785)
Fix for RC~12: Records from different factories aren't equal (#1734)
"too much recursion" error when creating a Record type from an instance of another Record (#1690)
Fix glob for npm format script on Windows (#18)
Remove deprecated cursor API (#13)
Add missing es exports (#1740)
Support nulls in genTypeDefData.js (#185)
Support isPlainObj in IE11 and other esoteric parameters f3a6d5ce
Set.map produces valid underlying map (#1606)
Support isPlainObj with constructor key (#1627)
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 required merger function (#1543)
Update isPlainObj() to workaround Safari bug and allow cross-realm values (#1557)
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)
<!-- 4.0.0-rc.9 -->
<!-- 4.0.0-rc.8 -->
getIn() no longer throws when encountering a missing path (#1361)<!-- 4.0.0-rc.6 -->
<!-- 4.0.0-rc.4 -->
<!-- 4.0.0-rc.3 -->
Do not throw from hasIn (#1319)
Long hash codes no longer cause an infinite loop (#1175)
slice() which should return an empty set could return a full set or vice versa (#1245, #1287)
Ensure empty slices do not throw when iterated (#1220)
Error during equals check on Record with undefined or null (#1208)
Fix size of count() after filtering or flattening (#1171)
Full Changelog: https://github.com/immutable-js/immutable-js/compare/v4.0.0-rc.15...v4.0.0
This is the last planned RC release before releasing a stable 4.0!! 🎉 🎉 🎉
This is the last planned RC release before releasing a stable 4.0!! 🎉 🎉 🎉
BREAKING:
mergeDeep() (#1840)
mergeDeep() will no longer merge lists of tuples into maps. For more information see https://github.com/immutable-js/immutable-js/pull/1840 and the updated mergeDeep() documentation.New:
fromJS() and Seq() to support Sets (#1865)Fixes:
ArrayLike<T> as option to type factory functions and fromJS now returns Collection<unknown> instead of just unknown.Fixes some TypeScript issues (Map constructor, update function, mapEntries)
Update to support Flow v0.85 and makes Record strict typing optional to ease migration from v3 or earlier v4 release candidates
Fixes:
Improve hash speed and avoid collision for common values
Potentially Breaking:
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)
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:
displayName (#1625)Set.map produces valid underlying map (#1606)constructor key (#1627)Docs:
> but was highlighted as a breaking change by
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:
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
This was actually broken as of v4.0.0-rc.1 (2dcf3ef94db9664c99a0a48fd071b95c0008e18f) but was highlighted as a breaking change by (#1437)
New:
New functions are exported from the
immutablemodule:isSeq(),isList(),isMap(),isOrderedMap(),isStack(),isSet(),isOrderedSet(), andisRecord().
RecordOf<TProps> type alias for TypeScript, matching Flow (#1578)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.
notSetValue in first() and last() (#1556)isArrayLike check more precise to avoid false positives (#1520)map() for List, Map, and Set returns itself for no-ops (#1455) (5726bd1)Fix:
groupBy no longer returns a mutable Map instance (#1602).size (#1598)mergeWith() method if missing the required merger function (#1543)isPlainObj() to workaround Safari bug and allow cross-realm values (#1557)mergeDeepWith merger is untypable in TS/Flow. (#1532)size check in merge() (#1521)Improved typescript definitions for new functional API
Fixes:
setIn()/getIn() key-paths. (#1399)merge() definitions. (#1400)list.concat() now has a slightly more efficient implementation and map.concat() is an alias for map.merge().
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:
getIn(), setIn(), updateIn() which understand key paths (#1366, #1377)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)record.get() to provide a not-set-value (#1378)Seq.Set() (3e671a2b6dc76ab3dd141c65659bce55ffd64f44)Fixed syntax error in typescript definitions which limited some checking
Fixes:
Flow types now understand list.filter(Boolean) will remove null values
Fixes:
list.filter(Boolean) will remove null values (#1352)Record.hasIn and Record.getIn (#1350)Concat Lists when merging deeply
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:
RecordOf<T> and RecordFactory<T> dramatically improve the Flow types for Records (#1343, #1330)Fixed:
map.flip() (#1332)Fixed a regression from rc.3 where value hashing was not working (#1325, #1328)
Fixes:
This RC is now relicensed as MIT
This RC is now relicensed as MIT (#1320)
BREAKING:
Remove Seq.of() (#1311, #1310 )
This method has been removed since it cannot be correctly typed. It's recommended to convert Seq.of(1, 2, 3) to Seq([1, 2, 3]).
New:
zipAll() (#1195)getIn() has a bad path (668f2236642c97bd4e7d8dfbf62311f497a6ac18)zip(). (#1258)has(). (#1232)Fixed:
slice() which should return an empty set could return a full set or vice versa (#1245, #1287)Type definition improvements for filter(), reduce() and concat() (#1155, #1156, #1153)
Changes Since v4.0.0-rc.1:
filter(), reduce() and concat() (#1155, #1156, #1153)delete() and clear() to Record instances (#1157)The Cursor API is officially deprecated. Use immutable-cursor instead.
This is a pre-release version of Immutable.js. Please try it at your own risk and report any issues you encounter so an official release can be shipped with great confidence.
As a pre-release, this changelog doesn't contain everything that has changed. Take a look at the commit log for a complete view, and expect a more thorough changelog for the official release.
The Iterable class has been renamed to Collection, and isIterable() has been renamed to isCollection(). Aliases with the existing names exist to make transitioning code easier.
The "predicate" functions, isCollection, isKeyed, isIndexed, isAssociative have been moved from Iterable. to the top level exports.
Record is no longer an Immutable Collection type.
isCollection(myRecord) returns false instead of true.map, filter, forEach) no longer exist on Records.delete() and clear() no longer exist on Records.The toJSON() method is now a shallow conversion (previously it was an alias for toJS(), which remains a deep conversion).
Some minor implementation details have changed, which may require updates to libraries which deeply integrate with Immutable.js's private APIs.
The Cursor API is officially deprecated. Use immutable-cursor instead.
A new predicate function isValueObject() helps to detect objects which implement equals() and hashCode(), and type definitions now define the interface ValueObject which you can implement in your own code to create objects which behave as values and can be keys in Maps or entries in Sets.
The Flowtype and TypeScript type definitions have been completely rewritten with much higher quality and accuracy, taking advantage of the latest features from both amazing tools.
Using fromJS() with a "reviver" function now provides access to the key path to each translated value. (#1118)
Port DoS patches for CVE-2026-59879 and CVE-2026-59880 onto branch 3.x by @Zoe7 in #2250
Full Changelog: v3.8.3...v3.8.4
Fix Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in immutable
Fix Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in immutable
This patch release relicenses with the MIT license, but includes no other changes. Intended for those who have not yet been able to update to the 4.x
This patch release relicenses with the MIT license, but includes no other changes. Intended for those who have not yet been able to update to the 4.x builds, but have a legal need for the change in license.
Released in 2017, still the most commonly used release.
Minor touch ups discovered after the last release, plus a few more bug fixes! Plus, you can now contribute to immutable-js using the latest version of
Minor touch ups discovered after the last release, plus a few more bug fixes! Plus, you can now contribute to immutable-js using the latest version of node.
New:
keyOf, findKey, lastKeyOf, and findLastKey were moved from KeyedIterable to Iterable, so they may be also used on Lists and Sets. (#740)Fixes:
Symbol keys or values can now be stringified. (#620)Infinity as a key in a Collection without crashing. (#797)Whoa, a new version of Immutable! The big news is that we now export types for both Flow and TypeScript in the npm module! Also that pesky length warn
Whoa, a new version of Immutable! The big news is that we now export types for both Flow and TypeScript in the npm module! Also that pesky length warning has finally been fully removed. There are also a good amount of small bug fixes and performance improvements. Finally, the API docs have been improved greatly! Check it out http://facebook.github.io/immutable-js/docs/.
A huge huge thanks to everyone in the community for contributing these improvements. The large majority of work cited below is community contributions.
New:
typings for TypeScript use. (#808)length property of a collection. (88f880fc02a377eb36dc1b9f3d6c86c2d1c287dd)Map.of() takes key, value interleaved pairs (#727)findEntry and findLastEntry now respect notSetValue argument (#822)Fixes:
Iterable::take(Infinity) takes infinitely instead of 0 (#834)toOrderedMap and toOrderedSet method definitions (#761)Record#set calls for better performance (#795)Range#toString propertly reports step (#759)Set#contains (96b09465f95a4f9f5229b4183a06faca39235fec)Fixed issue where lastIndexOf did not always return the correct value #703
A few minor bug fixes:
lastIndexOf did not always return the correct value #703mergeDeep now has more opportunities to for the "return self" optimization, saving memory #690slice(0, NaN) is equivalent to that of JS Array #623And a new API method:
myList.insert() #402Many stability improvements thanks to excellent community submitted fixes.
Many stability improvements thanks to excellent community submitted fixes.
New:
set(value) #516 to replace the value at the cursor.Fixes:
Your coding agent can read these notes before it upgrades. Set up the MCP server →