immer
11.2.9 · 22 Oct 2026MIT89.4M / weekRepositoryHomepagenpmAtom feed
Upgrading immer From 4.0.2 to 5.0.0
1 release in betweenevery note read
- 1
- change to make
- 0
- advisories fixed
- 0
- new
- 0
- fixes
Before you upgrade
Tick each one off as you go- breaking5.0.0
8 other lines we could not sort, mostly version bumps
- 5.0.0
Inside recipes, you can directly modify Maps and Sets with methods like
add,set,deleteandclear - 5.0.0
Those methods do mutate draft Maps and Sets, but won't actually change their originals!
- 5.0.0
Immer does not polyfill Map and Set automatically in environments where those aren't available out of the box
- 5.0.0
Maps and Sets are supported both in ES5 and Proxy mode
- 5.0.0
If
autoFreezeis enabled, the maps and sets returned from a producer will be artificially frozen by making their mutative APIs unusable - 5.0.0
Non 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.
- 5.0.0
TypeScript support for storing immutable types inside Maps and Sets, and converting them to
Draft's, is limited, see #448 for details - 5.0.0
Since 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
1 internal line (docs, tests, tooling) left out.