Fig is a TypeScript re-implementation of React: the core ideas remain — fibers, lanes, scheduling, diffing, rendering, hooks — while legacy cruft is dropped and Fig-specific APIs are adopted where they are clearer.
docs/concepts/— the spec. One file per subsystem; the single authoritative source for contracts, invariants, wire formats, and rationale. Start atdocs/concepts/README.md; open questions and future plans are summarized indocs/plans/open-questions.md. When a change alters a contract, update the owning concept file in the same commit.docs/— user-facing guides; depth lives indocs/concepts/.docs/plans/— time-bound work plans and investigations; historical once shipped (shipped contracts graduate todocs/concepts/).
- The repository is hosted at https://github.com/bgub/fig (
origin). - Use conventional commit messages (
feat:,fix:,refactor:,perf:,test:,docs:,chore:, with an optional scope likefix(fig-dom): ...). - Add a
.tegami/<short-description>.mdchangelog for changes that should ship in the public packages. Use Tegami's explicit frontmatter format and list the affected@bgub/fig*packages withmajor,minor, orpatchbumps.
- data resources — keyed async values, cache entries, server reads, and
the APIs that refresh or invalidate them (
docs/concepts/data.md). - asset resources — CSS, scripts, module preloads, fonts, preconnects,
and other render-discovered assets that are deduped, loaded, and sometimes
gated before reveal (
docs/concepts/assets.md). - Avoid the unqualified term "resources" where the distinction matters.
- payload — the server-component wire layer
(
@bgub/fig-server/payload). Never "RSC" or "Flight": those are React brands; the format is Fig's own (docs/concepts/payload.md).
- Every export has one home; renderer packages never mirror core; types
follow signatures →
docs/concepts/architecture.md. - Callbacks receive
AbortSignals, never return cleanups; the aborted signal is the indicator everywhere (effects, events, binds, stable events, transitions, actions, data loaders) →docs/concepts/hooks.md. - Native DOM names and native propagation semantics, no exceptions; host
behavior composes through
mixand events declare viamix={on(...)}; DOM access viabind→docs/concepts/mixins.md,docs/concepts/events.md,docs/concepts/jsx.md. - Explicit read verbs instead of
use(resource):readContext,readPromise,readData→docs/concepts/hooks.md,docs/concepts/data.md. - Always-strict dev rendering; diagnostics throw before commit; dev behavior
strips via compile-time
__FIG_DEV__gates →docs/concepts/rendering.md. - Server errors cross the wire only as
onError → { digest?, message? }; streaming vs prerender semantics →docs/concepts/server-rendering.md,docs/concepts/errors.md.