CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

pmndrs/jotai

Scanned commit 6abd0ae336 dated 2026-09-29 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/pmndrs/jotai ↗ · 326 files · 1.0 MB

visit jotai.org or npm i jotai Jotai scales from a simple useState replacement to an enterprise TypeScript application.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (436s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Jotai is a TypeScript state-management library for React applications, with a separate vanilla store API usable outside React. Atoms describe primitive, computed, or writable state; each store owns their values and tracks dependencies to propagate changes to subscribers. This pinned v3.0.1 checkout also contains persistence and async utilities, Vite examples, a Gatsby documentation website, regression tests, and package-release workflows.

System map

The repository separates the vanilla dependency engine from its React adapter and utility modules. The published artifact is an ESM library, while the website and examples are separate applications with their own dependencies. Storage is in memory unless a utility connects an atom to an external adapter. Build and release behavior is defined by package scripts and GitHub Actions.

Feature catalog

The primary user surface is a composable state API rather than an application router or CLI. Primitive and derived atoms support synchronous values, async computations, and custom write actions. Utilities add persistence, state transformations, stream integration, and hydration. The examples and documentation website demonstrate these capabilities and provide search, theme selection, and support inquiries.

Data flow

Atom objects identify state, while stores own values, dependency epochs, and subscriptions. Reads establish dependencies and reuse cached results when their validity checks succeed. Writes propagate through custom atom actions, invalidate affected state, recompute dependencies, and notify subscribers. Promise, storage, documentation-indexing, and contact adapters introduce distinct external boundaries.

Behavior traces

The source walkthrough followed React startup and subscription, a concrete text-edit action, and storage initialization/write/reset end to end. Additional traces followed async Hacker News loading and website search/support behavior. The steps below describe execution order and relevant branches from source inspection. They are not runtime observations.

Testing signals

Tests and CI were inspected, not executed; no passing result or coverage percentage is asserted. Vitest runs the library suites in jsdom with React Testing Library and source aliases. Inspected regressions cover dependency notifications, cancellation, persistence, raw hooks, and garbage collection. Root automation checks several compatibility dimensions, but its configured scope does not establish end-to-end website or service coverage.

Risk map

These are source observations and explicitly identified hypotheses, not confirmed vulnerabilities. The core's main correctness risks involve dependency/lifecycle ordering, deep reads, and pending promise retention. External trust boundaries appear in storage, example network content, and website contact handling. Several documentation and dependency mismatches require care when using ancillary applications to validate the root library.

Extension points

Atoms and store adapters are the principal composition interfaces. Public utilities accept application-supplied selectors, equality functions, storage implementations, observables, and callbacks. Internal store hooks and replaceable building blocks offer deeper instrumentation but explicitly carry compatibility warnings. Website documentation extends through MDX content and a shared component map.

Contributor handoff

This brief is grounded in the pinned checkout, including more than twelve source files and multiple end-to-end source traces. Tests and CI were inspected, not executed, and the investigation did not install, build, benchmark, contact services, or modify files. Future edits should preserve the vanilla/React boundary and verify the specific affected regression suites. Ancillary v2 applications, unstable internals, and documentation drift need explicit consideration.

Languages

LanguageFilesShare of source
TypeScript11769%
Markdown84docs/config
JavaScript5231%
JSON21docs/config
CSS14docs/config
HTML13docs/config
YAML12docs/config

Start reading here

Probable source entrypoint: src/index.ts — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (33 files)

Source layout — src/

PathFiles
src/react/12
src/vanilla/17
src/index.ts1
src/react.ts1
src/utils.ts1
src/vanilla.ts1

Repository structure

Top-level pathFiles
docs/72
examples/71
website/68
tests/46
src/33
.github/13
benchmarks/10
img/1

Docs found: CONTRIBUTING.mdREADME.md

Package

package.json — jotai v3.0.1, 32 declared dependencies.

@eslint/js@testing-library/dom@testing-library/jest-dom@testing-library/react@types/node@types/react@types/react-dom@vitejs/plugin-react@vitest/coverage-v8@vitest/eslint-plugin@vitest/uibenny

CI & config entrypoints

Structural health signals

Average score 9.1/10 across 96 analyzed source files; 1 hotspot surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history