Ada Lovelace
Principal engineer · enjoys skeletons that never shift the layout.
Take the engine apart phase by phase. For every step you get the real code that runs, the DOM before and after, the engine’s state and the cost — as if you were debugging it live.
<Skeletonizer :enabled="true">
<UserProfile />
</Skeletonizer>Principal engineer · enjoys skeletons that never shift the layout.
Live scan
Acquisition · step 1
On mount, the host grabs its rendered subtree and asks the engine to render an overlay for it.
Each <Skeletonizer> renders a positioned wrapper element (it becomes position:relative while active so it can host an absolutely-positioned SVG overlay) and keeps a template ref to it. On mount it registers a host controller with the global store and, when active, calls store.engine.renderHost(root, meta). The real DOM produced by your component is the engine’s input — there is no virtual copy and nothing is ever mutated.
components/Skeletonizer.vue
const root = ref<HTMLElement | null>(null)
onMounted(() => {
if (!root.value || !store) return
controller = { id: store._nextId(), scan: doScan, restore, report }
store._register(controller)
if (active.value) nextTick(() => doScan()) // doScan() → store.engine.renderHost(root.value, meta)
})mount
bind engine, register host
enable
nextTick → render
render
scan → SVG → inject overlay
observe
debounced MutationObserver
mutate
coalesced re-render (cache-aware)
disable
remove overlay + restore
unmount
restore + unregister
┌─────────────────────────┐
│ enable / DOM mutation │
└────────────┬────────────┘
▼
fingerprint(route, viewport, uid)
▼
blueprint cached? ── yes ─► replay SvgBlueprint (cache hit)
│ no │
▼ │
┌──────────────────┐ │
│ pop element │◄──────────┐ │
│ from DFS stack │ │ │
└────────┬─────────┘ │ │
▼ │ │
getComputedStyle(el) │ │
▼ │ │
┌─────────────┐ │ │
│ classify() │ │ │
└──┬───┬───┬──┘ │ │
skip ◄────────┘ │ └──► shimmer node │ │
│ ▼ │ │
ignored++ ┌────────────────┐ │ │
│ container? │── yes ─► push children ─┘ │
└───────┬────────┘ │
│ no (leaf) │
▼ │
measure → push ScannedNode { kind, rect, radius } │
▼ │
SvgRenderer → one <svg> + shared gradient │
▼ │
CLS guard: clamp viewBox → inject overlay ◄──────┘
▼
report { bones, ignored, timings, blueprint } → store._recompute()Everything above feeds one render backend: SVG. The host routes through the SkeletonEngine — a modular pipeline (Scan → SVG Renderer → CLS Guard → DOM Injection) that adapts the shimmer animation and tier to the live device load, so the interface stays fluid even on enterprise-scale pages. It is fully additive: with the default config there is zero extra overhead.
1 · Scan Layer
measure subtree → ScannedNode[]
2 · SVG Renderer
one <svg> overlay + shared gradient
3 · CLS Guard
clamp viewBox to host bounding box
4 · DOM Injection
absolute overlay, content hidden in place
5 · Telemetry
metrics + cache + Explain feedback
Principal engineer · enjoys skeletons that never shift the layout.
Live adaptive signals
Read-only measurement
Walks the subtree and measures each leaf into a ScannedNode (kind, DOMRect, radius) — the source DOM is never mutated.
Any density
Maps ScannedNode[] to one <svg> overlay: a <rect> per box, a <circle> per avatar — one element regardless of node count.
Animated shimmer
One namespaced <linearGradient> reused by every shape, swept by a single <animateTransform>.
Zero layout shift
Clamps the viewBox to the host bounding box and hides the real content in place — the page never shifts.
FPS/CPU score, animation auto-degradation and shimmer auto-disable, driven by a runtime policy that watches the live signals.
config.adaptive · minFps
The single render backend: ScannedNode[] → one <svg> overlay (a <rect>/<circle> per node) with rounded coordinates.
config.renderMode · svgPrecision
One namespaced <linearGradient> reused by every shape, animated by a single <animateTransform> sweep — no per-node JS.
config.svgSharedGradient
A layout fingerprint hash(route + viewport + UID) caches the SvgBlueprint in memory or session; a hit replays it and skips the scan.
config.layoutCache
Microcontroller degrades wave → pulse → static under load; the CLS guard clamps the viewBox so the overlay is pixel-stable.
tiers · cls-guard
Per-stage timings, FPS, memory, cache ratio — with heavy compute (fingerprint, analysis) offloaded to a Web Worker / requestIdleCallback.
config.telemetry · offThread
Blueprint Inspector (the generated SVG), Explain Mode (natural-language decisions) and a bottleneck ranking of the slowest hosts.
useSkeletonPerformance()
A modular engine: Scan → SVG Renderer → CLS Guard → DOM Injection, where each layer is decoupled and individually testable.
SkeletonEngine