Skip to content

AutoTracerAutomated Tracing for JavaScript and React

Debug code flow and component renders with tracing output

Quick Comparison ​

FlowTracer ​

For general JavaScript/TypeScript code flow tracing:

typescript
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)

ReactTracer ​

For React component render cycle tracing:

typescript
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 β†’ 1

Choose Your Path ​

πŸ” I want to trace function execution

Use FlowTracer for general code flow debugging

Get Started β†’

βš›οΈ I want to trace React renders

Use ReactTracer for component render debugging

Get Started β†’

🎯 I want both

Install both tracers for complete visibility into your application

Learn More β†’

Packages ​

PackageDescriptionnpm
@autotracer/react18React component render tracer runtimenpm
@autotracer/flowFunction and code flow tracer runtimenpm
@autotracer/plugin-vite-react18Vite plugin for ReactTracer injectionnpm
@autotracer/plugin-babel-react18Babel plugin for ReactTracer injectionnpm
@autotracer/plugin-vite-flowVite plugin for FlowTracer injectionnpm
@autotracer/plugin-babel-flowBabel plugin for FlowTracer injectionnpm
@autotracer/dashboardBrowser dashboard for targeted controlnpm
@autotracer/loggerInternal shared logger utilitynpm

Released under the MIT License.