Packages

immer

11.2.9 · 22 Oct 2026MIT89.4M / weekRepositoryHomepagenpmAtom feed

Your version

7.0.0

major10 Jun 2020Where it was published

7.0.15 is the newest release of 7.x.

In short

5 breaking1 new4 fixed

  • breaking

    Getters and setters are now handled consistently: own getters and setters will always by copied into fields (like Object.assign does), inherited getters and setters will be left as-is. This should allow using Immer directly on objects that trap their fields, like done in Vue or MobX. Fixes #584, #439, #593, #558

  • breaking

    Produce no longer accepts non-draftable objects as first argument

  • breaking

    Original can only be called on drafts and will throw otherwise (fixes #605)

  • breaking

    non-enumerable and symbolic fields will never be frozen

  • breaking

    The patches for arrays are now computed differently to fix some scenarios in which they were incorrect. In some cases they will be more optimal now, in other cases less. Especially splicing / unshifting items into an existing array might result in a lot of patches. Fixes #468

Security

3 advisories affect 7.0.0; 9.0.6 fixes them

Release note

  • Introduced current, which takes a snapshot of the current state of a draft and finalizes it (but without freezing). Current is a great utility to print the current state during debugging (no Proxies in the way), and the output of current can also be safely leaked outside the producer. Implements #441, #591

  • breaking

    Getters and setters are now handled consistently: own getters and setters will always by copied into fields (like Object.assign does), inherited getters and setters will be left as-is. This should allow using Immer directly on objects that trap their fields, like done in Vue or MobX. Fixes #584, #439, #593, #558

  • breaking

    Produce no longer accepts non-draftable objects as first argument

  • breaking

    Original can only be called on drafts and will throw otherwise (fixes #605)

  • breaking

    non-enumerable and symbolic fields will never be frozen

  • breaking

    The patches for arrays are now computed differently to fix some scenarios in which they were incorrect. In some cases they will be more optimal now, in other cases less. Especially splicing / unshifting items into an existing array might result in a lot of patches. Fixes #468

  • Improved documentation in several areas, there is now a page for typical update patterns and a separate page on how to work with classes. And additional performance tips have been included. Fixes #457, #115, #462

  • Fixed #462: All branches of the produced state should be frozen

  • Fixed #588: Inconsistent behavior with nested produce

  • Fixed #577: Immer might not work with polyfilled symbols

  • Fixed #514, #609: Explicitly calling useProxies(false) shouldn’t check for the presence of Proxy.