FlowTracer - Function & Code Flow
Trace function calls, track execution flow, and see labeled variables without adding manual log statements.
Debug code flow and component renders with tracing output
For general JavaScript/TypeScript code flow tracing:
async function initializeFlowTracing(): Promise<void> {
if (import.meta.env.DEV) {
await import("@autotracer/flow");
}
}
void initializeFlowTracing();
// Your instrumented code is traced
function calculateTotal(items) {
return items.reduce((sum, item) => sum + item.price, 0);
}Console Output:
β calculateTotal
param items: [{"price":10},{"price":20}]
returned: 30
β calculateTotal (elapsed: 0.5ms)For React component render cycle tracing:
async function initializeReactTracing(): Promise<void> {
if (import.meta.env.DEV) {
const { reactTracer } = await import("@autotracer/react18");
reactTracer({
enabled: true,
});
}
}
void initializeReactTracing();
// Your components automatically traced
function Counter() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;
}Console Output:
Component render cycle 1:
ββ [Counter] Mount β‘
β Initial state count: 0
Component render cycle 2:
ββ [Counter] Rendering β‘
β State change count: 0 β 1Use FlowTracer for general code flow debugging
Get Started β| Package | Description | npm |
|---|---|---|
| @autotracer/react18 | React component render tracer runtime | |
| @autotracer/flow | Function and code flow tracer runtime | |
| @autotracer/plugin-vite-react18 | Vite plugin for ReactTracer injection | |
| @autotracer/plugin-babel-react18 | Babel plugin for ReactTracer injection | |
| @autotracer/plugin-vite-flow | Vite plugin for FlowTracer injection | |
| @autotracer/plugin-babel-flow | Babel plugin for FlowTracer injection | |
| @autotracer/dashboard | Browser dashboard for targeted control | |
| @autotracer/logger | Internal shared logger utility |