immerjs/immer
53.6
Adequate · 13 November 2026
5.6k
lines of production code
TypeScript
with JavaScript
7
measurements over time
What this system is
Features
Added Chinese (zh-CN) documentation translations
The website now includes a complete Chinese translation of the Immer documentation. This change adds the \zh-CN\ locale files, including sidebar labels and translated markdown pages for all core topics such as API reference, installation, array methods, and React integration, making the documentation accessible to Chinese-speaking users.
website/i18n · high confidence
Initial static assets for the documentation website
The documentation site now includes its foundational static files, specifically adding a \.nojekyll\ file to ensure static site generators like GitHub Pages serve the content correctly, and introducing the \immer-logo.svg\ image asset for use in the site's branding.
website/static · high confidence
Introduce Immer performance benchmarking and profiling tools
Added a new \perf-testing\ directory containing a complete benchmarking suite for Immer. This includes scripts (\immutability-benchmarks.mjs\, \immutability-profiling.mjs\) to compare performance across historical Immer versions (5–10), the current development build, and alternative libraries like Mutative, Structura, and Limu. The suite supports generating CPU profiles and analyzing them with sourcemap resolution (\read-cpuprofile.js\) to identify bottlenecks, along with a Rolldown bundler configuration to ensure production-grade benchmark results.
perf-testing · high confidence
Introduce \`current()\` utility and strict mode configuration options
Users can now use the new \current()\ function to take a snapshot of the current state of a draft and finalize it without freezing, which is useful for debugging or safely leaking draft state outside a producer. Additionally, the Immer class now exposes configuration options \useStrictShallowCopy\ and \useStrictIteration\ to control how object descriptors are copied and how iteration handles non-enumerable properties, allowing for stricter behavior or performance optimizations.
src/core · high confidence
New array method optimization plugin
The \src/plugins/arrayMethods.ts\ file introduces a new plugin that overrides standard array methods (such as \push\, \pop\, \sort\, \filter\, etc.) to avoid creating per-element proxies during iteration and mutation. This optimization significantly improves performance for array-heavy operations by operating directly on the draft copy and returning base values or drafts as appropriate, while ensuring structural sharing is preserved for no-op changes.
src/plugins · high confidence
Behavioural changes
Major overhaul of TypeScript and Flow type definitions
The type definitions in \src/types\ have been completely rewritten to improve type inference and performance. The new TypeScript types (\types-external.ts\) introduce advanced utility types like \Draft\, \Immutable\, and \WritableDraft\ to better handle complex state structures, including Maps, Sets, and tuples. The Flow definitions (\index.js.flow\) have been updated to match these changes, ensuring consistent type checking across both systems. Additionally, internal types (\types-internal.ts\) have been restructured to support the new draft mechanism, and a new \globals.d.ts\ file declares the \\_\DEV\\_\ constant.
src/types · high confidence
Migrate build system to tsup and test runner to Vitest
The project has replaced its previous build tooling with tsup, which now generates modern ESM and CJS bundles (including legacy ESM and production variants) with sourcemaps and minification. Concurrently, the test suite has migrated from Jest to Vitest, utilizing a custom reporter to handle snapshot logic and configuration files to manage test environments and coverage reporting.
(repo-wide) · high confidence
Migrate documentation site to Docusaurus v2 with updated analytics and styling
The documentation website has been rebuilt using Docusaurus v2, introducing a new configuration structure and custom CSS theme (immer-infima.css) that updates the visual style, including link colors and navbar appearance. This migration includes switching analytics from Universal Analytics (UA-65632006-3) to Google Analytics 4 (G-X43066885W), adding automatic URL redirections from /docs paths, enabling Chinese (zh-CN) localization, and displaying a support Ukraine announcement banner.
website · high confidence
Refactored internal utility modules for Immer
The internal utility code has been reorganized into distinct modules (common, env, errors, plugins) to improve structure and maintainability. This change introduces stricter validation for draftable objects, ensuring that \produce\ only accepts plain objects, arrays, Maps, Sets, or classes marked with \\[immerable\]: true\, and provides clearer error messages when non-draftable values are passed. It also standardizes the handling of Map and Set types through a dedicated plugin system and optimizes performance by caching constructor string checks in \isPlainObject\ and using \Reflect.ownKeys\ for strict iteration.
src/utils · high confidence
Restructured source code and exposed new configuration APIs
The library's source code has been reorganized into a modular structure with dedicated files for core logic, types, and plugins, replacing the previous flat layout. This change exposes several new configuration functions on the main export: \setUseStrictShallowCopy\ to control whether object descriptors are copied, \setUseStrictIteration\ to toggle between strict and loose property iteration, and \setAutoFreeze\ to manage automatic freezing of produced states. Additionally, the \Immer\ class is now exported, allowing users to create custom instances, while plugin enablement functions like \enableMapSet\ and \enablePatches\ are explicitly re-exported from their respective plugin modules.
src · high confidence
Test coverage
Added Flow type tests for core API and Map/Set support; Added comprehensive test suite for Immer core functionality; Added performance benchmarks for bulk data, incremental updates, and large objects; Added production error snapshots for Immer tests; Migrated test suite to Vitest with snapshot coverage.
Dependencies
Immer 10.0.3-beta: Modernized build tooling and test infrastructure
The Immer library has been updated to version 10.0.3-beta, introducing a modernized build and testing stack. The build system has migrated from TSDX and Bili to tsup, resulting in updated package exports that support ESM, CommonJS, and React Native environments. The test suite has been migrated from Jest to Vitest, and the performance testing infrastructure now utilizes rolldown for bundling. Additionally, the website documentation has been updated to use Docusaurus v2.
(dependencies) · high confidence
Housekeeping
Initial site generation for Immer documentation
The static site content for the Immer project has been generated, including the main README page with installation instructions and API documentation, as well as GitHub issue templates for bug reports and feature proposals.
_\site · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 53 → 54 (+0.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.
Lenses
- Code Health 57 → 57 (+0.0)
- Architecture 86 → 85 (-0.6)
- Maturity 58 → 53 (-4.3)
- Readiness 43 → 45 (+2.0)
- Security 65 → 72 (+7.3)
- Performance 89 → 89 (+0.0)
Resolved (12)
- Critical CVE: [GHSA redacted] (perf-testing/yarn.lock)
- Critical CVE: [GHSA redacted] (perf-testing/yarn.lock)
- Documentation: no installation or build instructions (readme.md)
- Documentation: no project overview (readme.md)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- Medium CVE: [GHSA redacted] (yarn.lock)
- No ADRs found
- Off-boarding risk: anonymized user #1
New (19)
- Critical CVE: [CVE redacted] (perf-testing/yarn.lock)
- Critical CVE: [CVE redacted] (perf-testing/yarn.lock)
- Critical CVE: [GHSA redacted] (perf-testing/yarn.lock)
- Critical CVE: [GHSA redacted] (perf-testing/yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- Medium CVE: [GHSA redacted] (yarn.lock)
- Medium CVE: [GHSA redacted] (yarn.lock)
- Medium CVE: [GHSA redacted] (yarn.lock)
- No ADRs found (package.json)
- Off-boarding risk: anonymized user #1
- Scattered collaborators
- doc comments repeat the names (src/immer.ts)
- redundant comment (perf-testing/read-cpuprofile.js)
- redundant comment (src/core/finalize.ts)
- redundant comment (src/plugins/arrayMethods.ts)
Changes since last survey
- 3 commits — 2 feature/other, 1 fixes
By area
- website/yarn.lock — 2 commits
- tests/not-strict-copy.ts — 1 commit
Notable commits
- fix: fix: honor class-only shallow copy in Immer constructor (#1357)
- change: chore(deps): bump fast-uri from 3.1.8 to 3.1.9 in /website (#1351)
- change: chore(deps): bump node-forge from 1.4.0 to 1.4.3 in /website (#1362)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
immerjs/immer was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 784c86bb234e805566481c9425fcb2a3897e8bcc — the exact code this score is about.
- Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.63+preprod-4a8cc97a9484.