devtools

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package devtools provides development tools for BubblyUI applications.

The devtools package enables real-time inspection, debugging, and monitoring of BubblyUI applications during development. It provides state inspection, event tracking, component trees, performance monitoring, and more.

This package is an alias for github.com/newbpydev/bubblyui/pkg/bubbly/devtools, providing a cleaner import path for users.

Features

  • Component tree inspection with state viewing
  • Event tracking and replay
  • Command timeline with navigation
  • Performance monitoring
  • State history with time-travel debugging
  • Data export (JSON, YAML, MessagePack)
  • Data sanitization for sensitive values
  • Keyboard shortcuts for navigation

Example

import "github.com/newbpydev/bubblyui/devtools"

func main() {
    // Enable devtools
    collector := devtools.NewDataCollector()
    devtools.SetCollector(collector)

    // Or toggle with keyboard
    devtools.Toggle()
}

Index

Constants

This section is empty.

Variables

View Source
var CaptureComponent = devtools.CaptureComponent

CaptureComponent captures a component snapshot.

View Source
var DefaultConfig = devtools.DefaultConfig

DefaultConfig returns the default configuration.

View Source
var DefaultPatterns = devtools.DefaultPatterns

DefaultPatterns returns the default sanitization patterns.

View Source
var DetectFormat = devtools.DetectFormat

DetectFormat detects the format from a filename.

View Source
var Disable = devtools.Disable

Disable disables devtools.

View Source
var Enable = devtools.Enable

Enable creates and enables the devtools singleton. This is the REQUIRED way to enable devtools - it sets up the F12/Ctrl+T toggle handler automatically. Just calling NewDataCollector/SetCollector does NOT set up the keyboard toggle!

Example:

devtools.Enable() // Now F12 toggles devtools visibility
View Source
var GetCollector = devtools.GetCollector

GetCollector returns the global data collector.

View Source
var GetSupportedFormats = devtools.GetSupportedFormats

GetSupportedFormats returns the list of supported formats.

View Source
var GetTemplateNames = devtools.GetTemplateNames

GetTemplateNames returns available template names.

View Source
var IsEnabled = devtools.IsEnabled

IsEnabled returns whether devtools is enabled.

View Source
var LoadConfig = devtools.LoadConfig

LoadConfig loads configuration from a file.

View Source
var NewCommandTimeline = devtools.NewCommandTimeline

NewCommandTimeline creates a new command timeline.

View Source
var NewComponentFilter = devtools.NewComponentFilter

NewComponentFilter creates a new component filter.

View Source
var NewComponentInspector = devtools.NewComponentInspector

NewComponentInspector creates a new component inspector.

View Source
var NewDataCollector = devtools.NewDataCollector

NewDataCollector creates a new data collector.

View Source
var NewDetailPanel = devtools.NewDetailPanel

NewDetailPanel creates a new detail panel.

View Source
var NewDevToolsStore = devtools.NewDevToolsStore

NewDevToolsStore creates a new devtools store.

View Source
var NewDevToolsUI = devtools.NewDevToolsUI

NewDevToolsUI creates a new devtools UI.

View Source
var NewEventFilter = devtools.NewEventFilter

NewEventFilter creates a new event filter.

View Source
var NewEventLog = devtools.NewEventLog

NewEventLog creates a new event log.

View Source
var NewEventReplayer = devtools.NewEventReplayer

NewEventReplayer creates a new event replayer.

View Source
var NewEventTracker = devtools.NewEventTracker

NewEventTracker creates a new event tracker.

View Source
var NewFlameGraphRenderer = devtools.NewFlameGraphRenderer

NewFlameGraphRenderer creates a new flame graph renderer.

View Source
var NewFormatRegistry = devtools.NewFormatRegistry

NewFormatRegistry creates a new format registry.

View Source
var NewKeyboardHandler = devtools.NewKeyboardHandler

NewKeyboardHandler creates a new keyboard handler.

View Source
var NewLayoutManager = devtools.NewLayoutManager

NewLayoutManager creates a new layout manager.

View Source
var NewPerformanceData = devtools.NewPerformanceData

NewPerformanceData creates new performance data.

View Source
var NewPerformanceMonitor = devtools.NewPerformanceMonitor

NewPerformanceMonitor creates a new performance monitor.

View Source
var NewRouterDebugger = devtools.NewRouterDebugger

NewRouterDebugger creates a new router debugger.

View Source
var NewSanitizer = devtools.NewSanitizer

NewSanitizer creates a new sanitizer.

View Source
var NewSearchWidget = devtools.NewSearchWidget

NewSearchWidget creates a new search widget.

View Source
var NewStateHistory = devtools.NewStateHistory

NewStateHistory creates a new state history.

View Source
var NewStateViewer = devtools.NewStateViewer

NewStateViewer creates a new state viewer.

View Source
var NewStreamSanitizer = devtools.NewStreamSanitizer

NewStreamSanitizer creates a new stream sanitizer.

View Source
var NewTabController = devtools.NewTabController

NewTabController creates a new tab controller.

View Source
var NewTimelineControls = devtools.NewTimelineControls

NewTimelineControls creates new timeline controls.

View Source
var NewTreeView = devtools.NewTreeView

NewTreeView creates a new tree view.

View Source
var NotifyComponentCreated = devtools.NotifyComponentCreated

NotifyComponentCreated notifies devtools of a component creation.

View Source
var NotifyComponentMounted = devtools.NotifyComponentMounted

NotifyComponentMounted notifies devtools of a component mount.

View Source
var NotifyComponentUnmounted = devtools.NotifyComponentUnmounted

NotifyComponentUnmounted notifies devtools of a component unmount.

View Source
var NotifyComponentUpdated = devtools.NotifyComponentUpdated

NotifyComponentUpdated notifies devtools of a component update.

View Source
var NotifyEvent = devtools.NotifyEvent

NotifyEvent notifies devtools of an event.

View Source
var NotifyRefChanged = devtools.NotifyRefChanged

NotifyRefChanged notifies devtools of a ref value change.

View Source
var RegisterFormat = devtools.RegisterFormat

RegisterFormat registers an export format.

View Source
var RegisterMigration = devtools.RegisterMigration

RegisterMigration registers a migration.

View Source
var RegisterTemplate = devtools.RegisterTemplate

RegisterTemplate registers a sanitization template.

View Source
var RenderView = devtools.RenderView

RenderView renders the devtools view on top of the app view.

View Source
var SetCollector = devtools.SetCollector

SetCollector sets the global data collector.

View Source
var Toggle = devtools.Toggle

Toggle enables or disables the devtools overlay.

View Source
var ValidateMigrationChain = devtools.ValidateMigrationChain

ValidateMigrationChain validates the migration chain.

Functions

func HandleUpdate

func HandleUpdate(msg tea.Msg) tea.Cmd

HandleUpdate handles Bubbletea messages for devtools.

func NotifyRenderComplete

func NotifyRenderComplete(componentID string, duration time.Duration)

NotifyRenderComplete notifies devtools of render completion.

Types

type CommandRecord

type CommandRecord = devtools.CommandRecord

CommandRecord records a command execution.

type CommandTimeline

type CommandTimeline = devtools.CommandTimeline

CommandTimeline tracks command execution history.

type ComponentFilter

type ComponentFilter = devtools.ComponentFilter

ComponentFilter filters components in the tree.

type ComponentHook

type ComponentHook = devtools.ComponentHook

ComponentHook is called for component lifecycle events.

type ComponentInspector

type ComponentInspector = devtools.ComponentInspector

ComponentInspector provides component inspection utilities.

type ComponentInterface

type ComponentInterface = devtools.ComponentInterface

ComponentInterface is the interface for inspectable components.

type ComponentPerformance

type ComponentPerformance = devtools.ComponentPerformance

ComponentPerformance contains component performance metrics.

type ComponentSnapshot

type ComponentSnapshot = devtools.ComponentSnapshot

ComponentSnapshot captures the state of a component.

type Config

type Config = devtools.Config

Config holds devtools configuration.

type DataCollector

type DataCollector = devtools.DataCollector

DataCollector collects runtime data for devtools.

type DetailPanel

type DetailPanel = devtools.DetailPanel

DetailPanel displays component details.

type DevTools

type DevTools = devtools.DevTools

DevTools is the main devtools instance.

type DryRunResult

type DryRunResult = devtools.DryRunResult

DryRunResult contains migration dry run results.

type EventFilter

type EventFilter = devtools.EventFilter

EventFilter filters events.

type EventHook

type EventHook = devtools.EventHook

EventHook is called for events.

type EventLog

type EventLog = devtools.EventLog

EventLog stores event records.

type EventRecord

type EventRecord = devtools.EventRecord

EventRecord records an event.

type EventReplayer

type EventReplayer = devtools.EventReplayer

EventReplayer replays recorded events.

type EventStatistics

type EventStatistics = devtools.EventStatistics

EventStatistics contains event statistics.

type EventTracker

type EventTracker = devtools.EventTracker

EventTracker tracks events.

type ExportCheckpoint

type ExportCheckpoint = devtools.ExportCheckpoint

ExportCheckpoint marks an export checkpoint.

type ExportData

type ExportData = devtools.ExportData

ExportData contains exportable devtools data.

type ExportFormat

type ExportFormat = devtools.ExportFormat

ExportFormat is the interface for export formats.

type ExportOptions

type ExportOptions = devtools.ExportOptions

ExportOptions configures export behavior.

type FilterFunc

type FilterFunc = devtools.FilterFunc

FilterFunc is a function for filtering components.

type FlameGraphRenderer

type FlameGraphRenderer = devtools.FlameGraphRenderer

FlameGraphRenderer renders flame graph visualizations.

type FlameNode

type FlameNode = devtools.FlameNode

FlameNode represents a node in the flame graph.

type FocusTarget

type FocusTarget = devtools.FocusTarget

FocusTarget specifies which panel has focus.

type FormatRegistry

type FormatRegistry = devtools.FormatRegistry

FormatRegistry manages export formats.

type GuardExecution

type GuardExecution = devtools.GuardExecution

GuardExecution records guard execution details.

type GuardResult

type GuardResult = devtools.GuardResult

GuardResult represents the result of a guard check.

type IncrementalExportData

type IncrementalExportData = devtools.IncrementalExportData

IncrementalExportData contains incremental export data.

type Instrumentor

type Instrumentor = devtools.Instrumentor

Instrumentor instruments components for devtools.

type JSONFormat

type JSONFormat = devtools.JSONFormat

JSONFormat exports data as JSON.

type KeyHandler

type KeyHandler = devtools.KeyHandler

KeyHandler is a function that handles a key press.

type KeyboardHandler

type KeyboardHandler = devtools.KeyboardHandler

KeyboardHandler handles keyboard input.

type LayoutManager

type LayoutManager = devtools.LayoutManager

LayoutManager manages the devtools layout.

type LayoutMode

type LayoutMode = devtools.LayoutMode

LayoutMode specifies the layout mode.

type MatchLocation

type MatchLocation = devtools.MatchLocation

MatchLocation describes where a match was found.

type MessagePackFormat

type MessagePackFormat = devtools.MessagePackFormat

MessagePackFormat exports data as MessagePack.

type PerformanceData

type PerformanceData = devtools.PerformanceData

PerformanceData contains performance metrics.

type PerformanceHook

type PerformanceHook = devtools.PerformanceHook

PerformanceHook is called for performance events.

type PerformanceMonitor

type PerformanceMonitor = devtools.PerformanceMonitor

PerformanceMonitor monitors performance metrics.

type RefInterface

type RefInterface = devtools.RefInterface

RefInterface is the interface for refs.

type RefSnapshot

type RefSnapshot = devtools.RefSnapshot

RefSnapshot captures the state of a ref.

type ReplayCommandMsg

type ReplayCommandMsg = devtools.ReplayCommandMsg

ReplayCommandMsg is sent for command replay.

type ReplayCompletedMsg

type ReplayCompletedMsg = devtools.ReplayCompletedMsg

ReplayCompletedMsg is sent when replay completes.

type ReplayEventMsg

type ReplayEventMsg = devtools.ReplayEventMsg

ReplayEventMsg is sent during event replay.

type ReplayPausedMsg

type ReplayPausedMsg = devtools.ReplayPausedMsg

ReplayPausedMsg is sent when replay is paused.

type RouteRecord

type RouteRecord = devtools.RouteRecord

RouteRecord records route navigation.

type RouterDebugger

type RouterDebugger = devtools.RouterDebugger

RouterDebugger debugs router state and navigation.

type SanitizationStats

type SanitizationStats = devtools.SanitizationStats

SanitizationStats contains sanitization statistics.

type SanitizeOptions

type SanitizeOptions = devtools.SanitizeOptions

SanitizeOptions configures sanitization.

type SanitizePattern

type SanitizePattern = devtools.SanitizePattern

SanitizePattern defines a sanitization pattern.

type Sanitizer

type Sanitizer = devtools.Sanitizer

Sanitizer sanitizes sensitive data.

type SearchWidget

type SearchWidget = devtools.SearchWidget

SearchWidget provides search functionality.

type SortBy

type SortBy = devtools.SortBy

SortBy specifies how to sort items.

type StateChange

type StateChange = devtools.StateChange

StateChange represents a state change.

type StateHistory

type StateHistory = devtools.StateHistory

StateHistory tracks state changes over time.

type StateHook

type StateHook = devtools.StateHook

StateHook is called for state changes.

type StateViewer

type StateViewer = devtools.StateViewer

StateViewer displays state data.

type Store

type Store = devtools.Store

Store is the central devtools data store.

type StreamSanitizer

type StreamSanitizer = devtools.StreamSanitizer

StreamSanitizer provides streaming sanitization.

type Tab

type Tab = devtools.Tab

Tab represents a UI tab.

type TabController

type TabController = devtools.TabController

TabController manages tabs.

type TabItem

type TabItem = devtools.TabItem

TabItem represents a tab configuration.

type TemplateRegistry

type TemplateRegistry = devtools.TemplateRegistry

TemplateRegistry holds sanitization templates.

type TimeRange

type TimeRange = devtools.TimeRange

TimeRange represents a time range for filtering.

type TimelineControls

type TimelineControls = devtools.TimelineControls

TimelineControls provides timeline navigation UI.

type TreeView

type TreeView = devtools.TreeView

TreeView displays the component tree.

type UI

type UI = devtools.UI

UI is the main devtools UI component.

type VersionMigration

type VersionMigration = devtools.VersionMigration

VersionMigration is the interface for version migrations.

type YAMLFormat

type YAMLFormat = devtools.YAMLFormat

YAMLFormat exports data as YAML.

Directories

Path Synopsis
Package mcp provides Model Context Protocol (MCP) server integration for BubblyUI DevTools.
Package mcp provides Model Context Protocol (MCP) server integration for BubblyUI DevTools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL