Overview
mates-devtools is a separate package. Install it with npm install mates-devtools (mates stays a peer). renderMatesDevTools() mounts a gear FAB and a resizable panel: Components, Logs, User Logs, and Performance. This site already calls it, so the gear on the landing page and in these docs inspects the components on the page you are reading.
Call renderMatesDevTools() before renderApp() so hooks are installed when the first components mount.
Core keeps tiny no-op stubs in lib/devtools. The panel package fills them via installDevToolsHooks — production bundles stay clean when you omit the package.
What the panel shows
|
Surface
|
What it tracks
|
Use it when
|
|---|---|---|
| Components | Mounted tree, props, atoms, scopes, hooks, useState | A view re-rendered and you want the values it read. The list flashes a render count. Highlight jumps to the DOM node. |
| Logs | Mount, render, unmount, atom writes, events, Fetch | You want the sequence: which component rendered, which atom changed, and which request left the app. |
| User Logs |
log(), logError(), logWarning()
|
Your own messages. They go through matesLogEvent and show here even when the console stays quiet off localhost.
|
| Performance | Render duration per component | Total, average, and slowest render, plus a bar of recent timings. Open a row to jump back to that component. |
| Timers |
Live setTimeout / setInterval
| A button in the panel header. Use it when a timer keeps firing after the screen that started it is gone. |
Counter + DevTools panel
A Counter plus log(). Open the gear FAB, then press + / − and log(). Components and Logs follow the atom. User Logs shows the log() call.
installDevToolsHooks (bridge)
Low-level demo: wire a partial hook set and flip isDevToolsInstalled. Prefer the panel demo above for day-to-day debugging.