immer
11.2.9 · 22 Oct 2026MIT89.4M / weekRepositoryHomepagenpmAtom feed
193 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 5.x
5.3.4
5 Feb 2020Attempt to fix locally not reproducible build issue
5.3.2
15 Jan 20205.3.1
15 Jan 2020Explained workaround better
types-external.d.ts is not bundled
5.3.0
14 Jan 2020Original should not rely on
DraftedGeneral typing improvements for TS 3.7 and up
5.1.0
20 Dec 2019Convert Immer to TypeScript
5.0.2
18 Dec 2019Object spread breaks IE
Merge branch 'oriSomething-fix-472'
5.0.0
30 Oct 2019Inside recipes, you can directly modify Maps and Sets with methods like
add,set,deleteandclearThose methods do mutate draft Maps and Sets, but won't actually change their originals!
Immer does not polyfill Map and Set automatically in environments where those aren't available out of the box
❤ immer? 👉 opencollective.com/immer
This release introduces first class support for Maps and Sets!
BREAKING CHANGE: Maps and Sets are treated differently now; they will no longer directly mutated when updated inside a draft
Some things to keep in mind:
Inside recipes, you can directly modify Maps and Sets with methods like
add,set,deleteandclearThose methods do mutate draft Maps and Sets, but won't actually change their originals!
Immer does not polyfill Map and Set automatically in environments where those aren't available out of the box
Maps and Sets are supported both in ES5 and Proxy mode
If
autoFreezeis enabled, the maps and sets returned from a producer will be artificially frozen by making their mutative APIs unusableNon primitive keys for Maps, and non primitive values for Sets are supported. However, we strongly recommend to not combine non-primitive keys to Maps with patches, for reasons expressed below.
Open questions
TypeScript support for storing immutable types inside Maps and Sets, and converting them to
Draft's, is limited, see #448 for detailsSince JSON-patch standard doesn't offer support for Sets or Maps, it is not entirely clear how mutations to those are best described by patches, so this might be refined in the future. See also #450
Credits to @runnez, @aigoncharov and @aleclarson for making this happen!
- 4.x
4.0.2
22 Oct 2019Add immerable Flow typedef
- 3.x
3.1.4
2 Aug 2019Don't unnecessary modify draft if replaying patches results in a new state anyway
If a property is added, then deleted, don't produce a patch
3.1.3
7 Jun 2019build: add unpkg and jsdelivr fields to package.json
3.1.0
18 Apr 2019Mapsupport
3.0.0
17 Apr 2019- breaking
ts: typescript@3.4.0 is now the minimum required version
- breaking
thisin recipe is no longer the draft, but unbound - breaking
Dropped node 6 support
Bug Fixes
ts: Immutable<T> / read-only arrays in TS 3.4+
Features
ts: improve curried producers
ts: Improve type inference based on the first arg of the recipe function
ts: Support typescript 3.4
Immer now has it's own Github org,
immerjs
Breaking changes
- breaking
ts: typescript@3.4.0 is now the minimum required version
- breaking
thisin recipe is no longer the draft, but unbound - breaking
Dropped node 6 support
- 2.x
2.2.0
17 Apr 2019Immer now has it's own Github org,
immerjsImprove type inference based on the first arg of the recipe function
2.1.3
13 Mar 2019build: use .module.js instead of .mjs for esm bundle
2.1.0
28 Feb 2019Improved array patches
- 1.x
1.12.0
22 Jan 2019Export isDraftable
1.11.1
22 Jan 2019Use getOwnPropertySymbols only when it exists
1.11.0
21 Jan 2019es5: account for drafts in prepareCopy
Draft as base state
Object.getPrototypeOf with a draft
Bug Fixes
es5: account for drafts in prepareCopy
Draft as base state
Object.getPrototypeOf with a draft
Property descriptor edge cases
Throw on circular references
es5: onDelete hook
ts: Immer class options and ImmerState types
Features
Limited class support
1.10.4
12 Jan 2019ts: reorder generic parameters of IProduce
1.10.3
12 Jan 2019ts: ensure produce returns an immutable type
ts: return type of produce()
1.10.2
12 Jan 2019ts: base type of curried producer
1.10.0
4 Jan 2019Passing drafts to produce
1.9.1
16 Dec 2018Revert .d.ts and .js.flow module names
proxy: avoid
haswhere possible
Bug Fixes
Revert .d.ts and .js.flow module names
Performance Improvements
proxy: avoid
haswhere possible
1.9.0
15 Dec 2018- removed
Drop typescript@2 support
- removed
Drop typescript@3.0 support
TypeScript users: Please pin your
immerversion to1.8if you usetypescript <3.1.1. Thanks!Bug Fixes
Features
Add hooks to the
ImmerclassAdd types for
Immerclass- removed
Drop typescript@2 support
- removed
Drop typescript@3.0 support
Performance Improvements
proxy: deletion of an undeclared property
1.8.2
12 Dec 2018Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
1.8.0
19 Nov 2018For v1.8.0 and under, please visit the old changelog.md.