unstale

npm / immer

immer

What changed in immer 8 to 11, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-29.

12 breaking1 security5 new APIs and options3 performance1 behavior and defaults1 tooling27 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

immer 1135 changes

Breaking changes 2

Security 1

  • Prevents prototype pollution via constructor.prototype access.

    11.1.9release notes

New APIs and options 4

  • The WritableNonArrayDraft type is now exported for use by developers.

    11.2.2release notesrelease notes

  • Adds a helper to check whether a draft was modified.

    11.2.0release notes

  • Adds an optional plugin that overrides specified draft array methods to operate directly on the underlying array, significantly speeding up array operations.

    11.1.0release notes

  • With the plugin enabled, array items passed to callbacks are not automatically wrapped in Proxies, so mutating them can change the underlying objects.

    11.1.0release notes

Performance 1

  • Finalization now uses targeted callbacks instead of recursive tree traversal, improving performance.

    11.0.0release notes

Fixes and other changes 27

  • The Immer constructor now honors class-only shallow copy.

    11.2.10release notes

  • Patches are skipped for a draft discarded by writing its base value back.

    11.2.8release notes

  • Snapshots array length before optimized filter callbacks.

    11.2.7release notes

  • Avoids excessive Draft recursion for readonly arrays in recursive types.

    11.2.6release notes

  • Fixes drafting of relocated base objects at indices that were previously assigned in array methods.

    11.2.5release notes

  • The splice start index is resolved against the pre-splice length in the array-methods plugin.

    11.2.4release notes

  • Nested patches are skipped for children of shifted or reordered arrays.

    11.2.3release notes

  • Set snapshots are rebuilt without mutating the traversal.

    11.2.1release notes

  • Preserves live Map iteration during draft mutations.

    11.1.23release notes

  • Array searches now snapshot the iteration range.

    11.1.22release notes

  • A deletion is no longer recorded when a base value is written back.

    11.1.20release notes

  • The array-methods plugin now forwards thisArg, so callbacks receive the intended this value.

    11.1.19release notes

  • Removed the global var declaration for Iterator that conflicted with the ESNext lib.

    11.1.18release notes

  • Preserves structural sharing for no-op array-method calls.

    11.1.17release notes

  • Inserted array indices are keyed by name in the array-methods plugin.

    11.1.16release notes

  • Corrected the return type of curried produceWithPatches.

    11.1.15release notes

  • Throws the proper Immer error when an applyPatches path traverses null.

    11.1.14release notes

  • Fixes relocated base references for drafts after reverse or sort in the array-methods plugin.

    11.1.13release notes

  • Reverts the prevention of prototype pollution via constructor.prototype access.

    11.1.12release notes

  • Improves DraftMap.entries() compatibility.

    11.1.11release notes

  • Improves DraftMap.values() compatibility.

    11.1.11release notes

  • Assigning undefined to a prototype-inherited key no longer gets dropped.

    11.1.10release notes

  • The typings now assert that the draft value is unwrapped.

    11.1.8release notes

  • Higher-order type inference for WritableDraft is improved.

    11.1.7release notes

  • Removes an invalid curried producer type.

    11.1.6release notes

  • Handles nested proxies after spreading and inserting into an array.

    11.1.4release notesrelease notes

  • Fixes recursive T for WritableDraft.

    11.1.3release notes

immer 1012 changes

Breaking changes 8

  • enableAllPlugins has been removed; enable patches and Map/Set support separately.

    10.0.0release notes

  • enableES5 has been removed, and projects relying on ES5 mode should not upgrade.

    10.0.0release notes

  • Getters and setters on plain objects are ignored by default; call useStrictShallowCopy(true) at startup when using them.

    10.0.0release notes

  • Shortening a JSON array now produces delete patches instead of a mutation of the length property, in accordance with the JSON spec.

    10.0.0release notes

  • Immer 10 supports only modern browsers with Proxy, Reflect, Symbol, Map, and Set support.

    10.0.0release notes

  • produce is no longer available as the default export; import it as a named export.

    10.0.0release notes

  • Promise-based reducers are no longer supported; use createDraft and finishDraft to work with drafts across asynchronous operations.

    10.0.0release notes

  • The UMD build is no longer exposed; use the ESM package or CJS instead.

    10.0.0release notes

New APIs and options 1

Performance 2

  • Immer performance is optimized where possible.

    10.2.0release notes

  • The non-gzipped bundle size decreased from 16 to 11.5 KB, while the minimal gzipped import of just produce remained roughly 3.3 KB.

    10.0.0release notes

Behavior and default changes 1

  • Immer is now an ESM package that can be imported directly into the browser; CJS should still work.

    10.0.0release notes

immer 92 changes

Breaking changes 1

  • Recipes can no longer return nothing when the target state does not accept undefined, or return arbitrary values; returned values must be assignable to the original state type.

    9.0.0release notes

Tooling 1

immer 81 changes

Breaking changes 1

  • Auto-freezing is now enabled by default, including in production. Call setAutoFreeze(process.env.NODE_ENV !== 'production') to restore the old behavior.

    8.0.0release notes