Atomica v0.2 Design Contract
1. Core Invariants (Non-Negotiable)
- Components execute exactly once; reactive reads are hoisted into bindings instead of triggering rerenders.
- No render loop: component functions must stay pure and are never re-invoked by signal churn.
- Reactivity lives in expressions, not components: only bound expressions track dependencies.
- Signals update DOM nodes directly; bindings mutate existing nodes instead of replacing subtrees.
- Computeds are lazy and only evaluate on demand; they cache until dirtied by dependencies.
- Context is lexical and synchronous; providers take a snapshot for the duration of the call.
- Async is explicit and pull-based; resources refresh on demand and never auto-run implicitly.
2. Included Primitives (v0.2)
signal — fine-grained writable value
computed — lazy derived value
effect — side-effect runner, tied to bindings
resource — explicit async loader with latest-wins semantics
context — lexical provider/consumer with synchronous scope
- diagnostics (dev-only) — counters for components, signals, computeds
3. Explicit Non-Goals
- No memoization helpers
- No suspense
- No router
- No SSR
- No global stores
- No form abstractions
- No styling system
4. Upgrade Policy
- Any feature that violates the invariants requires a major version.
- Ergonomic additions must prove they do not change semantics.