Circuitry DevTools Extension

Circuitry DevTools Extension

Dedicated Flutter DevTools companion extension for inspecting, profiling, and debugging Circuitry dependency graphs at runtime.

Pub Package Build Status License: MIT


This package is distributed as an optional, opt-in developer tool. Installing it in dev_dependencies ensures that your production runtime bundles stay completely free of DevTools web assets.


Installation

Add circuitry_devtools_extension to your project's dev_dependencies:

dev_dependencies:
  circuitry_devtools_extension: ^0.5.1

Usage

In your application's entry point (e.g. main()), call registerCircuitryDevToolsExtension() to register the VM Service extension endpoints and enable live telemetry:

import 'package:circuitry/circuitry.dart';
import 'package:circuitry_devtools_extension/circuitry_devtools_extension.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

void main() {
  // Explicitly register Circuitry DevTools extension in debug mode
  if (kDebugMode) {
    registerCircuitryDevToolsExtension();
    // or: CircuitryDevTools.register();
  }

  runApp(const MyApp());
}

To disable the extension at runtime:

unregisterCircuitryDevToolsExtension();
// or: CircuitryDevTools.unregister();

When you launch Dart or Flutter DevTools, the Circuitry tab appears automatically.


Features

  • Interactive DAG Canvas: Renders dependency graphs organized into horizontal topological wave columns with cubic Bézier spline edge routing, wire node selection, and status badges.
  • Wave Waterfall Profiler: Visualizes asynchronous startup resolution across topological waves, computing and highlighting the critical path with cumulative latency metrics.
  • Multi-Scope Circuit Navigator: Switch between multiple active Circuit instances and tagged scopes.
  • Live Wire Inspector: Inspect wire configurations, dependencies, direct/transitive dependents, and trigger on-demand singleton initialization via VM Service protocol (ext.circuitry.forceResolveWire).
  • Multi-Format Exporters: Export the graph schema directly to Mermaid flowchart diagrams, structured JSON, or SVG markup.

Architecture & Seams

The DevTools UI is decoupled from the VM Service transport behind the abstract CircuitryServiceClient interface:

  • VmCircuitryServiceClient: Communicates with live Dart VM Service extensions (ext.circuitry.*) in debug builds.
  • MockCircuitryServiceClient: Provides deterministic mock graph data enabling 100% test coverage with flutter test without a running Dart VM Service daemon.

Development & Building

Running Tests

cd packages/circuitry_devtools_extension
flutter test

Compiling Web Bundle

To recompile the pre-built web extension assets into extension/devtools/build:

cd packages/circuitry_devtools_extension
dart run devtools_extensions build_and_copy --source=. --dest=extension/devtools

License

MIT © Raman Verma

Libraries

circuitry_devtools_extension
Public registration and deregistration APIs for the Circuitry DevTools Extension.
main