BlaC ships with a full DevTools suite: an in-app overlay, a Chrome DevTools panel, and a console API. Together they let you inspect live instances, view state diffs, browse event timelines, and time-travel to previous states.
DevTools is delivered as a plugin: once installed, it observes every state container from the outside, so there is nothing to wire up per bloc. Keep it scoped to environment: 'development' — it tracks state snapshots and event history, which you do not want in a production bundle.
Drop <BlacDevtoolsUi /> anywhere in your tree. It renders a draggable floating overlay that you toggle with Alt+D (or by dispatching a blac-devtools-toggle custom event).
Install the BlaC Chrome Extension from the Chrome Web Store (or build from apps/devtools-extension/). Once installed, a BlaC tab appears in Chrome DevTools alongside Elements, Console, etc.
The extension connects automatically when the browser plugin is active — no extra configuration needed. It stays in sync across page reloads.
When you select an instance, the detail panel shows a side-by-side diff of the previous and current state. Each state change is recorded with a timestamp and the call stack that triggered it.
Click any snapshot in the state history to restore the instance to that point. This calls emit on the instance with the stored state, so your components update in real time.
Cubit<S> is a StateContainer<S> with emit / patch exposed as
public mutation surface. Today it adds nothing structurally beyond
StateContainer — both are inherited from the underlying
StructuralContainer<S>. Kept as a real class (not a type alias) because
downstream code does instance instanceof Cubit checks (see A2 audit).
The class body is intentionally empty: a no-op emit override would
still go through applyState, and patch is inherited from
StructuralContainer (path-diffed, microtask-flushed). If a caller
needs the old "skip if no real change" patch semantics, they can wrap
patch themselves or call emit after a manual equality check.
Cubit<S> is a StateContainer<S> with emit / patch exposed as
public mutation surface. Today it adds nothing structurally beyond
StateContainer — both are inherited from the underlying
StructuralContainer<S>. Kept as a real class (not a type alias) because
downstream code does instance instanceof Cubit checks (see A2 audit).
The class body is intentionally empty: a no-op emit override would
still go through applyState, and patch is inherited from
StructuralContainer (path-diffed, microtask-flushed). If a caller
needs the old "skip if no real change" patch semantics, they can wrap
patch themselves or call emit after a manual equality check.
Cubit<{
frame: number
frame:number }> {
constructor() {
super({
frame: number
frame: 0 });
}
}
The DevTools plugin skips these instances entirely — no tracking overhead. excludeFromDevTools is one of the blac() configuration options; this page shows it in use, but Configuration documents the full option set.