Skip to content

Bump mutative from 1.3.0 to 2.0.0 in the dev-tooling group across 1 directory - #48

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/dev-tooling-a86c7f240b
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/dev-tooling-a86c7f240b

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Bumps the dev-tooling group with 1 update in the / directory: mutative.

Updates mutative from 1.3.0 to 2.0.0

Release notes

Sourced from mutative's releases.

2.0.0

Mutative v2 keeps the v1 API and makes updates faster and more correct. Across 97 benchmarked workloads, it is 4.3x faster than Mutative 1.3.0 on geometric mean, and 3.6x faster than Immer 11.1.18 with matched settings, or 6.6x with each library's defaults. It also fixes many cases in which v1 produced wrong states or patches, and production bundles leave out the development checks. Some of these changes can affect existing code: read the breaking changes below and the migration guide before you upgrade.

Highlights

  • Faster updates. Against Mutative 1.3.0, v2 was faster in 535 of 614 measured cases, within 5% in 70 and slower in 9. Against Immer 11.1.18, it was faster in 595 of 614 cases. The performance summary has every workload, the method and its limits.
  • Native array methods. shift, unshift, splice and reverse move the elements of a plain array directly on the draft's copy, and indexOf, lastIndexOf and includes search it natively. Removing the first of 10,000 rows takes 7.04 µs, against 7,408 µs in Immer, and the patches of such moves replay in both directions.
  • Searches without drafts. current() of a changed array copies the current array instead of reading each element through the draft, so current(draft.list).findIndex(…) searches a large array without creating a draft for each element.
  • Correct patches and states. The patches of moved drafts, of Sets whose items changed, of arrays that shrink and grow again, of -0 and of Map keys that are arrays now reproduce the next state, and Map and Set drafts freeze and iterate like built-in Maps and Sets. See fixes that change results.
  • Safer apply(). Patches cannot change the prototypes of objects: apply() also rejects a path that ends in __proto__, and reads Set items only at their indices.
  • Production builds for bundlers. The ESM entry compares process.env.NODE_ENV at each development check, so production bundles leave out the development checks and warnings, and production errors are short codes that link to the errors page.
  • Better types. Async recipes with an explicit state type return a Promise, apply() types frozen and in-place results, and a curried recipe that annotates its draft gives a typed producer.
  • A new website. mutative.js.org has new guides, a comparison with Immer, migration guides from Immer and from v1, an errors page, and llms.txt.

Breaking changes

The migration guide describes each change and what to do about it.

Build output and package entries

  • Every build targets ES2018 instead of ES2015. Engines that support Proxy but not ES2018 syntax, such as Chrome 49–59, Firefox 18–54, Safari 10–11.0 and Edge 12–18, need Mutative transpiled by your build.
  • The ESM entry compares process.env.NODE_ENV at each development check instead of always running development code. Bundles that target Node.js without defining NODE_ENV, such as esbuild with platform: 'node', now include both CommonJS builds; define NODE_ENV or keep Mutative external.
  • In Node.js, import resolves a module that re-exports the CommonJS build, so import and require share one instance and both follow NODE_ENV. Previously, import always ran the development ESM build as a separate instance.
  • dist/mutative.esm.mjs and dist/mutative.esm.js read process.env.NODE_ENV when they load, so loading them without a bundler, from a <script type="module"> with a raw CDN URL or in another runtime without process, throws process is not defined. Load dist/mutative.esm.production.min.mjs instead, or the UMD build that the unpkg and jsdelivr fields point to.
  • Production builds throw Minified Mutative error #<code> with a link to the errors page instead of the full message. Code that matches error messages in production must match the codes instead.

Patches

  • The patches of a nested draft come before those of its parents, the order Immer uses. Applying them gives the same state as before.
  • A patch value that was a draft is the object that the next state holds instead of a deep copy, and it is frozen with the state under enableAutoFreeze. apply() still copies patch values; copy a patch value before you change it.
  • A changed draft that leaves its key, because sort() or an assignment moved it or another value replaced it there, emits no patches under its old path; the patches of its parent carry its value.
  • A changed item of a Set that also added or removed items is carried by the Set's remove and add patches instead of patches under its position.
  • Assigning the original object of a draft to the key that holds the draft is recorded like any other assignment.

Arrays

  • shift, unshift, splice and reverse run natively on the copy of a plain array, and indexOf, lastIndexOf and includes search it natively. For data arrays the results are those of v1, but an accessor property on an array index is read as a data value, so its getter may run a different number of times.
  • current() of a changed array copies the current array. Base elements that a native method moved and that hold drafts of an outer create() call are left as they are.

Returned values

  • With enableAutoFreeze, production builds no longer search frozen objects in a value that a recipe returns for drafts, and development builds throw when they find one there. Never put a draft in a frozen object or in a value it holds.

Development builds

  • Strict mode warns once when a recipe leaves 1,000 or more drafts unchanged, as a search through a large draft array does.
  • create() warns once when it receives a draft with a recipe, since it drafts a copy of the draft's current state; see create() on a draft.
  • With enablePatches: { pathAsArray: false }, a patch path that would hold a Map key that is not a string, or a symbol key, throws. Production builds still generate such patches, as v1 did.
  • Passing a draft to the set() method of a Map draft throws, since the next state would keep the revoked draft as a key.
  • With enableAutoFreeze, a circular reference is reported only for an object that holds itself.

... (truncated)

Commits
  • 7bd3fcf docs(readme): update
  • 1ed39c8 docs: link the rawReturn() tip to the comparison with Immer
  • 34c175f docs: explain the three default cases in which Immer was faster
  • f94a862 docs: compare returned states with Immer's default freezing on the rawReturn(...
  • 5409bfe docs: record the benchmark of returning fresh, unfrozen data with each librar...
  • 0faa4b8 perf: add benchmark scenarios that return fresh, unfrozen data
  • e504a64 chore(version): update version to 2.0.0
  • 9420a8c docs(readme): update
  • 21acbd5 ci: publish to npm with trusted publishing from Node.js 24
  • 49d6bc8 docs: state the bundle size in the installation section of the README and fol...
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by GitHub Actions, a new releaser for mutative since your current version.


@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Oct 22, 2026
Bumps the dev-tooling group with 1 update in the / directory: [mutative](https://github.com/unadlib/mutative).


Updates `mutative` from 1.3.0 to 2.0.0
- [Release notes](https://github.com/unadlib/mutative/releases)
- [Commits](unadlib/mutative@v1.3.0...v2.0.0)

---
updated-dependencies:
- dependency-name: mutative
  dependency-version: 2.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dev-tooling
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot changed the title Bump mutative from 1.3.0 to 2.0.0 in the dev-tooling group Bump mutative from 1.3.0 to 2.0.0 in the dev-tooling group across 1 directory Oct 22, 2026
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/dev-tooling-a86c7f240b branch from c1dd3b3 to de7b271 Compare October 22, 2026 12:37
@sjungling

Copy link
Copy Markdown
Member

Dependabot watcher: HIGH risk, not approved or merged. Major bump of mutative 1 -> 2. A person should review the breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant