mrkeyoor.com_
Sat 03 Oct 06:00 UTC
Dev Toolsevaluationupdated 03 Oct 2026

immer review

Immer creates a new, immutable JavaScript state while letting you write familiar assignments, deletes, and array operations against a temporary draft. It removes the stack of object spreads that nested updates usually require, while preserving references to branches that did not change.

Verdict

Our Immer run passed 3,836 of 3,844 tests with 0 failures, and its 7-second build followed a much heavier 1,032-package install, so the library is dependable while contributor setup is substantial. Use it when nested immutable updates are obscuring the intent of reducers or state transitions. Skip it for cyclic object graphs, unsupported native objects, or code where profiling shows draft creation in the hot path.

We ran it

Lab card: what happened when we ran immerScreenshot of immer (immerjs.github.io/immer)
Install✓ · 97s1032 packages · 445 MB
Build✓ · 7s
Tests✓ · 18s3836 passed · 0 failed · 8 skipped of 3844 (vitest)
Repo167 files~17,179 lines of source · 2.8 MB · 3 CI workflows · tests dir

Answers from our run

Does immer build from source?

Dependencies installed in 97 seconds (1032 packages), and the build succeeded in 7 seconds. We cloned commit 8848a5b into a clean Debian container with 3 CPUs and no project-specific setup.

Do immer's tests pass?

Yes: 3836 of 3844 passed when we ran the project's own test command (vitest). Some failures need services or credentials a bare container does not have.

Who should not use immer?

State models with cycles or the same object reachable by several paths: the official pitfalls guide requires a unidirectional tree with one path to each node.

What are the alternatives to immer?

Immutable.js, Mutative, Redux Toolkit. Our Immer run passed 3,836 of 3,844 tests with 0 failures, and its 7-second build followed a much heavier 1,032-package install, so the library is dependable while contributor setup is substantial.

Setup4/5Simple app API; contributor install took 97 seconds and 445 MB
Docs4/5Detailed guides cover recipes, types, patches, and sharp edges
Community5/528,984 stars, an October 2 push, and active issue work
Maturity5/5v11.1.21 and 3,836 passing tests show a settled core

Who it’s for

React and Redux developers handling nested state with plain objects and arrays.
TypeScript teams that want readonly application state and writable draft types inside update functions.
Applications that need structural sharing, automatic freezing, or opt-in undo and redo patches.
Library authors who want immutable update semantics without introducing a custom collection type.

Who it’s NOT for

State models with cycles or the same object reachable by several paths: the official pitfalls guide requires a unidirectional tree with one path to each node.
Code that mutates DOM nodes, Buffers, Dates, or subclassed arrays, Maps, and Sets: the class guide excludes those objects or requires replacement rather than mutation.
Runtimes without JavaScript Proxy support: Immer version 10 removed the older ES5 fallback.
Replication systems that require minimal, directly compliant RFC 6902 patches: Immer uses array paths and does not promise the smallest patch set.
Hot loops that mostly scan large drafts: the performance guide advises reading from the original state or enabling the array methods plugin after profiling.

Setup reality

Our fresh Debian sandbox installed commit 8848a5b with Yarn in 97 seconds. It pulled 1,032 packages and occupied 445 MB. The build passed in 7 seconds, then Vitest finished in 18 seconds with 3,836 passed, 0 failed, and 8 skipped out of 3,844 tests.

Using Immer in an application needs no account, credential, database, or service. The measured checkout had 167 files, about 17,179 source lines, and used 2.8 MB before installation. Contributor setup is much larger because it includes the documentation, build, type, formatting, and test toolchain.

The runtime needs JavaScript Proxy support. Map and Set handling, patches, and the array methods optimization are opt-in calls at application startup. Auto-freezing is on by default, and large read-heavy drafts or recursive freezing can need profiling.

One produce call replaces a ladder of shallow copies

Immer v11.1.21 takes a current state and a recipe function. The recipe receives a Proxy draft, so assignments, delete, and mutating collection methods can describe the change. When the recipe ends, Immer returns a new state and leaves the input alone. An untouched branch keeps its old reference, while a changed branch receives a new one.

The gain is clearest several levels down. Updating project.columns[2].cards[4].done by hand means copying each container on that path and preserving the other references. Immer records the write and handles those copies. Its checkout at commit 8848a5b contained about 17,179 lines of source, so the pleasant recipe syntax sits on a real proxy, finalization, freezing, and plugin implementation.

A 7-second build comes after a 445 MB contributor install

Our sandbox needed 97 seconds to install 1,032 Yarn packages, and the environment occupied 445 MB. The repository was 2.8 MB across 167 files before installation. That is contributor cost, not evidence that an application will consume the same space. Cloning Immer to change or audit it brings its documentation, build, formatting, Flow, TypeScript, and test stack.

The build passed in 7 seconds. No credentials, hosted services, database, or daemon were involved, and the unprivileged container had 3 CPUs and 8 GB of RAM. We found 3 CI workflow files and a tests directory, but no Dockerfile. Maintainers reproducing the toolchain need to follow the Yarn setup instead of starting from a project-supplied image.

What happened when we ran it

We ran commit 8848a5b in a fresh Debian container on Node 22. Installation succeeded in 97 seconds, the build succeeded in 7 seconds, and Vitest completed in 18 seconds. The suite reported 3,836 passed, 0 failed, and 8 skipped out of 3,844 tests. Nothing in the supplied result showed an install error, compiler failure, or red test.

Those numbers cover contributor confidence, not application speed. Our run did not benchmark reducers, React rendering, memory retention, or patch throughput. The official performance guide recommends profiling, reading expensive searches from the original state, and opting out for critical reducers. Version 11 also has an optional array methods plugin intended to reduce proxy creation during large scans.

Cycles, shared references, and native objects are outside the model

Immer v11.1.21 expects a unidirectional tree: no cycle, no object appearing twice, and one path from the root to each node. That rules out normalized graphs that intentionally share object identities. Plain objects, arrays, Maps, and Sets are draftable, while custom classes need the immerable marker. DOM nodes, Buffers, and subclasses of built-in collections are excluded. Dates should be replaced rather than mutated inside a recipe.

A draft wraps the original in a Proxy, so comparing the two objects with === does not work. External values inserted from a closure are not automatically drafted, and mutating one can change the caller's object. These rules are documented, but the 3,844-test suite cannot make a mismatched state model safe. Review the data shape before converting every reducer.

Patches support undo, but they are not minimal JSON Patch

Since version 6, patches require one startup call to enablePatches(). produceWithPatches returns the next state, forward patches, and inverse patches for undo, redo, traces, or replay onto a changed base. Map and Set support is enabled with enableMapSet(). The opt-in design avoids loading behavior an application never calls.

Immer's operations resemble RFC 6902, but each path is an array instead of a JSON Pointer string. The docs explain conversion and the escaping required by RFC 6901. They also state that the generated list is correct rather than guaranteed minimal. A protocol that bills by operation count or expects strict RFC input should normalize and, if needed, compress patches.

The October 2 release and 41 open items show live maintenance

GitHub listed 28,984 stars and 41 open issues and pull requests on October 3, 2026. The API result contained 30 issues and 11 pull requests. The repository was pushed on October 2, the day v11.1.21 fixed reads from revoked Map or Set drafts. Two releases minutes earlier corrected deletion bookkeeping and array-method callback behavior.

The documentation is candid about recipe returns, Proxy identity, unsupported graphs, freezing, and patch limits. One seam remains: the FAQ suggests a fallback for engines without Proxy, while the installation guide says version 10 removed it. Open issues also track stale translations. Read the topic guides, not just the short README. Our 18-second green run supports the core, while the guides show whether your state belongs inside it.

Use it when nesting, not fashion, creates the problem

Our run's 3,836 passing tests and 0 failures make Immer easy to trust for tree-shaped application state. Adopt it when a reducer's copying machinery has become harder to read than the update. A draft recipe then makes the change visible and keeps untouched references stable. For a flat object with one or two fields, native spread syntax may remain clearer.

The 1,032-package install belongs to Immer's contributor toolchain. Production still pays for Proxy work, recursive freezing, and enabled plugins. Start at the reducer that hurts, keep a benchmark around the hot path, and stop if the data contains shared references or engine-native objects. Immer is a strong tool when the problem matches the tree model it supports.

Alternatives

ProjectWhat it isPick it when
Immutable.jsPersistent List, Map, Set, Record, and lazy Seq collections with value equality.pick this instead when dedicated persistent collections and value semantics matter more than keeping plain JavaScript objects.
MutativeA proxy-based immutable update library with drafts, patches, and configurable freezing.pick this instead when you want an Immer-like producer model with different performance and configuration choices, and can test migration behavior.
Redux ToolkitThe official Redux package, with Immer already built into its reducer APIs.pick this instead when the actual job is Redux state management and you do not need to call Immer directly.

What people are saying

  1. [velocity-scout] immerjs/immer

Sources

  1. Immer repository and README
  2. Immer introduction and produce model
  3. Immer pitfalls
  4. Immer installation and opt-in plugins
  5. Immer patches
  6. Immer classes and unsupported objects
  7. Immer v11.1.21 release
  8. Measured commit 8848a5b

More dev tools reviews

ToolReplay · CUDA-for-AMD-Windows · DuoFold-Android · wutw-public · viserys-agent · birdview · the whole board →