# System map — immerjs/immer

> Canonical page: https://codevetter.com/unpack/immer/system-map

# System map — immerjs/immer

Scanned commit 061c2425e1c9dff89e4e4189d42af1b7839dfe0a (2026-08-19). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The principal runtime is an in-process state transformation library whose public entrypoint is src/immer.ts. Core modules manage proxies, execution scopes, snapshots, and finalization, while three optional plugins supply collection, patch, and array-method behavior. Distribution includes multiple JavaScript module formats and declarations; documentation and benchmarking have separate manifests and execution boundaries.
- src/immer.ts constructs one default Immer instance and exposes its produce method plus bound patch, configuration, and manual-draft methods; it also exports Immer for independent instances. — [src/immer.ts#L27-L55](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/src/immer.ts#L27-L55) [src/immer.ts#L62-L102](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/src/immer.ts#L62-L102) [src/immer.ts#L119-L123](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/src/immer.ts#L119-L123)
- src/internal.ts is the shared barrel connecting utility constants, errors, types, plugin interfaces, scopes, finalization, proxies, Immer, and current snapshots. — [src/internal.ts#L1-L11](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/src/internal.ts#L1-L11)
- Each producer scope owns draft references, optional forward/inverse patches, parent scope, finalization tracking sets, and its Immer instance; currentScope is module-level execution state. — [src/core/scope.ts#L19-L59](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/src/core/scope.ts#L19-L59)
- Package export conditions select legacy ESM for React Native, modern ESM for imports, and a CJS dispatcher for require, with dist/immer.d.ts supplied across these conditions. — [package.json#L5-L26](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/package.json#L5-L26) [tsup.config.ts#L73-L87](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/tsup.config.ts#L73-L87)
- tsup builds declarations, development ESM/CJS, legacy ESM targeting es2017, and minified production ESM/CJS; production builds replace NODE_ENV and mangle properties ending in an underscore. — [tsup.config.ts#L4-L52](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/tsup.config.ts#L4-L52) [tsup.config.ts#L54-L88](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/tsup.config.ts#L54-L88)
- The root package uses Yarn-oriented scripts for source tests, built-package tests, Flow checks, coverage, performance workloads, import-size reports, and semantic-release. — [package.json#L28-L42](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/package.json#L28-L42)
- The separate React/Docusaurus website serves documentation at routeBasePath '/', supports English and zh-CN, and deploys website/build to gh-pages through its public-docs workflow. — [website/package.json#L5-L21](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/website/package.json#L5-L21) [website/docusaurus.config.js#L13-L16](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/website/docusaurus.config.js#L13-L16) [website/docusaurus.config.js#L73-L80](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/website/docusaurus.config.js#L73-L80) [.github/workflows/docs-public.yml#L32-L41](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/.github/workflows/docs-public.yml#L32-L41)
- perf-testing is a private ESM package using Mitata and Rolldown; aliases connect its current-development comparison to ../dist/immer.mjs alongside historical Immer versions and alternative libraries. — [perf-testing/package.json#L1-L34](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/perf-testing/package.json#L1-L34) [perf-testing/rolldown.config.js#L1-L18](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/perf-testing/rolldown.config.js#L1-L18) [perf-testing/immutability-benchmarks.mjs#L4-L25](https://github.com/immerjs/immer/blob/061c2425e1c9dff89e4e4189d42af1b7839dfe0a/perf-testing/immutability-benchmarks.mjs#L4-L25)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
