CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

preactjs/preact

Scanned commit 45728eb431 dated 2026-10-02 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/preactjs/preact ↗ · 302 files · 1.5 MB

Fast 4kB alternative to React with the same modern API.

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

Overview

Preact is a component-based UI library for developers building browser interfaces with JSX, functions, classes, hooks, and context. At commit 45728eb4315bcb22c5d50b8fec0bbac419eaa799, its renderer reconciles virtual nodes against live DOM, supports hydration and portals, and exposes renderer callbacks that power separately bundled addons. React compatibility, development diagnostics, JSX compiler helpers, and testing utilities surround the core; server rendering delegates to the separate preact-render-to-string package.

System map

The repository packages a DOM renderer and several addons under one public npm package. Core rendering owns VNode trees, component instances, and DOM mutations; hooks and compatibility extend it through shared options callbacks. Server rendering crosses into an optional external package, while the demo is a separate Vite application inside the workspace. Rollup, Babel, and Terser produce the distributable modules, and GitHub Actions define validation and staged release workflows.

Feature catalog

The primary user-facing surface is a library API for constructing and updating interfaces. Core provides components, DOM rendering, hydration, context, fragments, refs, and portals; addons provide hooks, React adapters, diagnostics, and test controls. Compiler-facing exports support both automatic JSX and precompiled HTML templates. The demo exposes a route-based playground for rendering scenarios and ecosystem integrations; it is documented as a debugging application.

All 13 feature catalog claims →

Data flow

Applications supply component types, props, children, and a DOM container; factories turn these into renderer-owned VNodes. Reconciliation links new nodes to previous nodes, updates component state, and applies DOM changes before committing refs and callbacks. Hook state belongs to component instances, with separate queues for pending values and effects. External stores, promises, and demo network responses enter through explicit adapters; the inspected core state path does not itself implement durable application persistence.

Behavior traces

The inspected flows cover initial rendering, a concrete Todo interaction, hydration, promise suspension and retry, portal rendering, and demo network loading. Each trace follows named functions across their input, state owner, and output boundary. Preact has library initialization and mounting rather than a server startup lifecycle. State retention in these flows is primarily the VNode/component graph, while the demo reads localStorage only for diagnostic switches.

Testing signals

Tests and CI were inspected, not executed; no passing result, coverage percentage, or benchmark outcome is asserted. Vitest divides node/shared tests from browser suites driven by headless Chromium through Playwright. The configuration can test source or minified bundles, while separate TypeScript commands check declarations. Inspected tests cover DOM output and operation counts, hydration, component construction, suspense, effects, diagnostics, and serialization guards. The inventory and sampled test reading are bounded rather than exhaustive, and explicit skips identify gaps.

All 13 testing signals claims →

Risk map

The security-sensitive runtime boundaries inspected are raw HTML assignment, DOM attributes/events, VNode identity checks, compiler serialization overrides, and the devtools attachment hook. Renderer correctness also depends on cross-package property mappings and careful coordination of suspension, hydration, portals, refs, and effects. Tests contain explicit skips, and workflow source exposes concrete wiring and artifact-handling concerns. These are source observations or labeled hypotheses, not confirmed vulnerabilities or reproduced runtime failures; no whole-repository absence of auth, IPC, secrets, or other integrations is claimed.

All 14 risk map claims →

Extension points

Preact's main extension mechanism is the shared options object, rather than an application plugin registry. Renderer callbacks let addons intercept VNode creation, rendering, commits, errors, events, and teardown. Components, context providers, memo comparators, lazy loaders, and external-store subscribers supply narrower behavior contracts. Packaging and demo routes have explicit lists that must be updated when adding a new surface.

Contributor handoff

This brief is tied to the pinned commit and should be revalidated against any later checkout. Tests and CI were inspected, not executed; suggested commands below are future validation guidance, not completed checks. The investigation sampled source and tests extensively but does not establish exhaustive coverage or confirmed vulnerabilities. Keep edits localized to the relevant core/addon contract, then consider declarations, VNode factories, property mappings, and bundle behavior where those contracts cross boundaries.

All 14 contributor handoff claims →

Languages

LanguageFilesShare of source
JavaScript20281%
TypeScript4116%
JSON22docs/config
YAML9docs/config
Sass73%
Markdown6docs/config
CSS1docs/config
HTML1docs/config

Start reading here

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

Source roots

src/ (17 files)

Source layout — src/

PathFiles
src/diff/4
src/component.js1
src/constants.js1
src/create-context.js1
src/create-element.js1
src/create-portal.js1
src/dom.d.ts1
src/index.d.ts1
src/index.js1
src/internal.d.ts1
src/jsx.d.ts1
src/options.js1
src/render.js1
src/util.js1

Repository structure

Top-level pathFiles
compat/79
test/57
demo/52
hooks/23
debug/22
src/17
.github/12
jsx-runtime/7

Docs found: CONTRIBUTING.mdREADME.md

Package

package.json — preact v11.0.0, 24 declared dependencies.

@babel/core@babel/preset-env@rollup/plugin-babel@types/chai@types/node@vitest/browser@vitest/browser-playwright@vitest/coverage-v8babel-plugin-transform-rename-propertieschaicross-envhusky

CI & config entrypoints

Structural health signals

Average score 7.4/10 across 96 analyzed source files; 14 hotspots surfaced.

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

Recent history