Skip to content

Update dependency immer to v11#19

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/immer-11.x
Open

Update dependency immer to v11#19
renovate[bot] wants to merge 1 commit intomainfrom
renovate/immer-11.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Dec 7, 2025

This PR contains the following updates:

Package Change Age Confidence
immer ^10.2.0^11.0.0 age confidence

Release Notes

immerjs/immer (immer)

v11.1.4

Compare Source

Bug Fixes
  • handle nested proxies after spreading and inserting into an array (90a7765)

v11.1.3

Compare Source

Bug Fixes

v11.1.2

Compare Source

Bug Fixes
  • bogus commit to retest release (c329ddb)

v11.1.0

Compare Source

This feature release adds a new optional "array method overrides" plugin that significantly speeds up array methods when accessing drafts.

Changelog

Performance Improvements

As part of the recent performance optimization work, our benchmarks showed that all Proxy-based immutable update libraries were drastically slower than vanilla JS when calling both mutating and non-mutating array methods. After investigation, it turns out that an array method like arr.filter() causes the Proxy's get trap to trigger for every single item in the array. This in turn forces creation of a new Proxy and internal Immer metadata for every item, even though this was just a read operation and no items were being updated.

This release adds a new enableArrayMethods plugin that will override draft array methods to bypass the draft and directly operate on the underlying wrapped array instance. This significantly speeds up array operations.

When enabled, the plugin overrides these array methods:

  • Mutating: push, pop, shift, unshift, splice, reverse, sort
  • Non-mutating: filter, slice, concat, flat, find, findIndex, findLast, findLastIndex, some, every, indexOf, lastIndexOf, includes, join, toString, toLocaleString

Our benchmarks show that the overridden methods (plus the other perf changes in Immer 10.2 and 11.0) are 50-80% faster than the baseline behavior of Immer 10.1.

The plugin adds about 1.5-2K minified to Immer's bundle size.

It's important to note that the plugin does change the "safe to mutate a draft" semantics of Immer. Any of these methods that receives an array item as a callback argument will not automatically wrap that item in a Proxy!. That means that if you try to mutate an argument in a method such as filter, it will actually mutate the real underlying object, which will cause bugs in your app. This is an intentional design tradeoff. Semantically, all of these methods imply read-only access to array values, so if your code tries to mutate an array item in a callback, that is a bug in your code.

Note that this does not override map, flatMap, forEach, or reduce / reduceRight. Those methods do imply either side effects and potential mutations, or returning arbitrary values. Given that, we determined it was both safest and simplest to keep their behavior as-is.

See the Array Methods Plugin docs page for further details on the behavior of the overridden methods.

What's Changed

v11.0.1

Compare Source

Bug Fixes

v11.0.0

Compare Source

Performance Improvements
  • Rewrite finalization system to use a callback approach instead of tree traversal (#​1183) (d6c1202)
BREAKING CHANGES
  • enable loose iteration by default

  • Simplify some iteration checks

  • Allow passing type to get/set utils to skip archetype lookup

  • Convert assigned_ to Map

  • Enable loose iteration

  • Replace recursive tree finalization with targeted callbacks

Ported Mutative's "finalization callback" approach as a more targeted and performant implementation for finalization compared to the existing recursive tree traversal approach:

  • Added cleanup callbacks for each draft that's created
  • Added callbacks to handle root drafts, assigned values, and recursing
    inside of plain values
  • Updated state creation to return [draft, state] to avoid a lookup
  • Rewrote patch generation system to work with callbacks instead of
    during tree traversal
  • Update self-reference test with new behavior
  • Apply code review suggestions
  • Byte-shave scopes and patch plugin usage
  • Inline finalizeAssigned
  • Move fixPotentialSetContents to plugin
  • Byte-shave typeof utils
  • Byte-shave Object references
  • Byte-shave field names and arrow functions

Configuration

📅 Schedule: (in timezone America/New_York)

  • Branch creation
    • Between 12:00 AM and 11:59 PM (* 0-23 * * *)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
adminv2 Ready Ready Preview, Comment Apr 8, 2026 5:28pm

Request Review

@renovate renovate bot force-pushed the renovate/immer-11.x branch from 4ddc638 to 0774b90 Compare December 20, 2025 13:35
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 0774b90 to f86436a Compare December 29, 2025 09:42
@renovate renovate bot force-pushed the renovate/immer-11.x branch from f86436a to 729db73 Compare December 31, 2025 15:00
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 729db73 to 940170c Compare January 8, 2026 19:16
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 940170c to 47d9972 Compare January 19, 2026 16:26
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 47d9972 to bfdc033 Compare January 23, 2026 16:20
@renovate renovate bot force-pushed the renovate/immer-11.x branch from bfdc033 to 605217c Compare February 2, 2026 19:44
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 605217c to c199407 Compare February 10, 2026 05:05
@renovate renovate bot force-pushed the renovate/immer-11.x branch from c199407 to 12acfd2 Compare February 12, 2026 17:54
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 12acfd2 to e3fed82 Compare February 17, 2026 15:58
@renovate renovate bot force-pushed the renovate/immer-11.x branch from e3fed82 to 0cc0d7d Compare March 5, 2026 17:35
@renovate renovate bot force-pushed the renovate/immer-11.x branch from 0cc0d7d to def8a25 Compare March 13, 2026 16:29
@renovate renovate bot force-pushed the renovate/immer-11.x branch from def8a25 to 49ace1e Compare April 1, 2026 20:11
@renovate
Copy link
Copy Markdown
Contributor Author

renovate bot commented Apr 1, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm warn Unknown env config "store". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: react-beautiful-dnd@13.1.1
npm error Found: react@19.2.4
npm error node_modules/react
npm error   react@"19.2.4" from the root project
npm error   peer react@">=16.8.0" from @emotion/react@11.14.0
npm error   node_modules/@emotion/react
npm error     @emotion/react@"^11.14.0" from the root project
npm error     peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.14.1
npm error     node_modules/@emotion/styled
npm error       @emotion/styled@"^11.14.1" from the root project
npm error       4 more (@mui/lab, @mui/material, @mui/styled-engine, @mui/system)
npm error     5 more (@mui/lab, @mui/material, @mui/styled-engine, ...)
npm error   29 more (@emotion/styled, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.8.5 || ^17.0.0 || ^18.0.0" from react-beautiful-dnd@13.1.1
npm error node_modules/react-beautiful-dnd
npm error   react-beautiful-dnd@"^13.1.1" from the root project
npm error
npm error Conflicting peer dependency: react@18.3.1
npm error node_modules/react
npm error   peer react@"^16.8.5 || ^17.0.0 || ^18.0.0" from react-beautiful-dnd@13.1.1
npm error   node_modules/react-beautiful-dnd
npm error     react-beautiful-dnd@"^13.1.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /runner/cache/others/npm/_logs/2026-04-08T17_22_07_471Z-eresolve-report.txt
npm error A complete log of this run can be found in: /runner/cache/others/npm/_logs/2026-04-08T17_22_07_471Z-debug-0.log

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants