-
Notifications
You must be signed in to change notification settings - Fork 0
Devtools and Inspection
gUI ships with a dedicated devtools entrypoint and raw DOM update hooks.
import { createInspector } from "@bragamateus/gui/devtools";The inspector is opt-in. Importing the root runtime does not mount visual tooling automatically.
createInspector({
target: "#app",
title: "Live DOM Lens",
});- exact text updates
- exact attribute updates
- structural inserts
- keyed moves
- removals
- runtime flushes
- cleanup cycles
- computed refreshes
- owner disposal
It is the fastest way to confirm that gUI is updating bindings instead of rerendering component trees.
Useful options include:
titlesubtitlemaxEntriesoverlayDurationpositiontargetcontainerpausedcollapsedexpandedoverlayruntimedomEventFilterruntimeEventFilteronDestroy
Example:
const inspector = createInspector({
target: "#playground",
title: "Playground Runtime",
position: "bottom-left",
maxEntries: 30,
overlayDuration: 900,
});Controller methods:
clear()destroy()pause()resume()setExpanded(boolean)setTarget(target)toggleExpanded()entries()isExpanded()isPaused()
From the root package:
import { setDomUpdateHook, subscribeDomUpdates } from "@bragamateus/gui";Use this when you want a single global listener:
setDomUpdateHook((event) => {
console.log(event.type, event);
});Use this when multiple tools need the same stream:
const unsubscribe = subscribeDomUpdates((event) => {
console.log(event);
});
unsubscribe();DOM update events currently include:
-
type:"text" | "attribute" | "structure" timestamporiginnodeelementnamevalueactionanchorrect
This is enough to build overlays, logs, custom timelines, and test assertions.
Subscribe to DOM updates and log only events for one container.
Reverse a list built with list() and observe structure events with action: "move".
Build a dynamic branch with Show() or a getter and watch the inspector timeline when the branch leaves the DOM.
Mount the inspector against one target region so documentation pages, playgrounds, or embedded widgets can be debugged independently.