Skip to content

Releases: immerjs/immer

v5.0.1

09 Dec 20:34
Compare
Choose a tag to compare

5.0.1 (2019-12-09)

Bug Fixes

  • Fixed #477, Immer crashes without an Object.assign polyfill (4895824)

v5.0.0

30 Oct 20:37
b6f1d40
Compare
Choose a tag to compare

5.0.0 (2019-10-30)

❤ immer? 👉 https://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:

  • Example: https://immerjs.github.io/immer/docs/complex-objects
  • Inside recipes, you can directly modify Maps and Sets with methods like add, set, delete and clear
  • Those 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 autoFreeze is enabled, the maps and sets returned from a producer will be artificially frozen by making their mutative APIs unusable
  • 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.

Open questions

  • TypeScript support for storing immutable types inside Maps and Sets, and converting them to Draft's, is limited, see #448 for details
  • 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

Credits to @runnez, @aigoncharov and @aleclarson for making this happen!

v4.0.2

22 Oct 15:32
09d37ce
Compare
Choose a tag to compare

4.0.2 (2019-10-22)

Bug Fixes

  • add immerable Flow typedef (c8c9fcd)

v4.0.1

04 Oct 20:18
Compare
Choose a tag to compare

4.0.1 (2019-10-04)

Bug Fixes

  • Don't use proxies if Proxy.revocable is not defined. Fixes #435 (c84aa53)

v4.0.0

11 Sep 21:16
Compare
Choose a tag to compare

4.0.0 (2019-09-11)

Features

  • In development mode, any new value stored in a tree will be deeply frozen. (cb1c6dd)

BREAKING CHANGES

  • any value returned from produce will be deeply frozen in DEV, even when it wasn't frozen before the producer started. Fixes #412 #363 #260 #230 #313 #229 through #417

v3.3.0

11 Sep 20:10
ac61b8d
Compare
Choose a tag to compare

3.3.0 (2019-09-11)

Features

  • Always use remove command in generateArrayPatches() (d483334), closes #208

v3.2.1

10 Sep 23:15
Compare
Choose a tag to compare

3.2.1 (2019-09-10)

Bug Fixes

  • ensure patches are reusable (49b2e7b)
  • ensure patches are reusable (c2e69d9)
  • ensure that patches are reusable. Fixes #411 (af3a59d)

v3.2.0

02 Aug 16:08
a16deda
Compare
Choose a tag to compare

3.2.0 (2019-08-02)

Features

  • introduced produceWithPatches. Implements #400 (86be737)

v3.1.4

02 Aug 15:27
Compare
Choose a tag to compare

3.1.4 (2019-08-02)

Bug Fixes

  • don't unnecessary modify draft if replaying patches results in a new state anyway (96f2b2e)
  • If a property is added, then deleted, don't produce a patch (7cd2dc1)

v3.1.3

07 Jun 20:43
Compare
Choose a tag to compare

3.1.3 (2019-06-07)

Bug Fixes

  • build: add unpkg and jsdelivr fields to package.json (#384) (fa1f5e6)