npm / immer
immer
What changed in immer 10 to 11, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
2 breaking1 security3 new APIs and options2 performance18 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initimmer 1124 changes
Breaking changes 2
Reads of a revoked Map or Set draft now throw.
Loose iteration is enabled by default.
Security 1
Prevents prototype pollution via constructor.prototype access.
New APIs and options 2
Adds an optional plugin that overrides specified draft array methods to operate directly on the underlying array, significantly speeding up array operations.
With the plugin enabled, array items passed to callbacks are not automatically wrapped in Proxies, so mutating them can change the underlying objects.
Performance 1
Finalization now uses targeted callbacks instead of recursive tree traversal, improving performance.
Fixes and other changes 18
A deletion is no longer recorded when a base value is written back.
The array-methods plugin now forwards thisArg, so callbacks receive the intended this value.
Removed the global var declaration for Iterator that conflicted with the ESNext lib.
Preserves structural sharing for no-op array-method calls.
Inserted array indices are keyed by name in the array-methods plugin.
Corrected the return type of curried produceWithPatches.
Throws the proper Immer error when an applyPatches path traverses null.
Fixes relocated base references for drafts after reverse or sort in the array-methods plugin.
Reverts the prevention of prototype pollution via constructor.prototype access.
Improves DraftMap.entries() compatibility.
Improves DraftMap.values() compatibility.
Assigning undefined to a prototype-inherited key no longer gets dropped.
The typings now assert that the draft value is unwrapped.
The typings now assert that the draft value is unwrapped.
Higher-order type inference for WritableDraft is improved.
Removes an invalid curried producer type.
Handles nested proxies after spreading and inserting into an array.
Fixes recursive T for WritableDraft.
immer 102 changes
New APIs and options 1
Introduces setUseStrictIteration.
Performance 1
Immer performance is optimized where possible.