Repository navigation
v0.4.0
cami v0.4.0
The TypeScript release. v0.4.0 rebuilds cami around stores as the one state abstraction, ships template directives on the public API, and adds full TypeScript support end to end. Supersedes the 0.3 series (last: 0.3.23).
Stores are the state story
ObservableStore is now the general-purpose state abstraction. Streams, observable elements, and per-node glue retire in favor of stores:
- Actions, memos, queries, and mutations for async and derived state, plus lifecycle hooks and built-in state machines
- URLStore — URL state and routing exposed as a store, with hardened route and deep-link contract behavior
- Versioned localStorage persistence through storage adapters (
createLocalStorage,persistToLocalStorageThunk) - Removed from the public API:
ObservableStream,ObservableElement,slice,computed, andhttp— stores cover their roles (memos replacecomputed) Observable,ObservableState, andeffect()remain for 0.3 compatibility but are deprecated. New code should use component fields, stores, andafterRender()
Template directives
Templates move from a vendored lit-html fork to upstream lit-html 3.3, and its directives are now public API:
repeat— render dynamic lists efficiently, optionally keyed so element identity survives reorderskeyed— force rebuild or reuse of a DOM fragment when its key changesunsafeHTML— render trusted HTML stringsuseImage— resource helper for images with load-state handling
Full TypeScript support
- The runtime is written in TypeScript, and the package ships declarations (
build/cami.d.tschain) with 40+ exported types for stores, actions, queries, mutations, routes, resources, and elements. v0.3 shipped no types. - One API across runtimes: browser-global CDN bundle (
cami.cdn.js) or the ES module build (cami.module.js)
Also in this release
- Hardened runtime contracts — lifecycle, dispatch, and store invariants tightened across the runtime
- Documentation recentered around the supported API: https://camijs.com/
- Dependency tree clean:
npm auditreports 0 vulnerabilities (dev tooling refreshed; unusedfetch-mockremoved)
Install / upgrade
npm install cami@0.4.0<script src="https://unpkg.com/cami@0.4.0/build/cami.cdn.js"></script>Verified on this build
- 20 test files / 196 tests passing (Vitest + jsdom)
tsc --noEmit: 0 errorsnpm audit: 0 vulnerabilities
Full Changelog: v0.3.21...v0.4.0