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 ¶
- Variables
- func HandleUpdate(msg tea.Msg) tea.Cmd
- func NotifyRenderComplete(componentID string, duration time.Duration)
- type CommandRecord
- type CommandTimeline
- type ComponentFilter
- type ComponentHook
- type ComponentInspector
- type ComponentInterface
- type ComponentPerformance
- type ComponentSnapshot
- type Config
- type DataCollector
- type DetailPanel
- type DevTools
- type DryRunResult
- type EventFilter
- type EventHook
- type EventLog
- type EventRecord
- type EventReplayer
- type EventStatistics
- type EventTracker
- type ExportCheckpoint
- type ExportData
- type ExportFormat
- type ExportOptions
- type FilterFunc
- type FlameGraphRenderer
- type FlameNode
- type FocusTarget
- type FormatRegistry
- type GuardExecution
- type GuardResult
- type IncrementalExportData
- type Instrumentor
- type JSONFormat
- type KeyHandler
- type KeyboardHandler
- type LayoutManager
- type LayoutMode
- type MatchLocation
- type MessagePackFormat
- type PerformanceData
- type PerformanceHook
- type PerformanceMonitor
- type RefInterface
- type RefSnapshot
- type ReplayCommandMsg
- type ReplayCompletedMsg
- type ReplayEventMsg
- type ReplayPausedMsg
- type RouteRecord
- type RouterDebugger
- type SanitizationStats
- type SanitizeOptions
- type SanitizePattern
- type Sanitizer
- type SearchWidget
- type SortBy
- type StateChange
- type StateHistory
- type StateHook
- type StateViewer
- type Store
- type StreamSanitizer
- type Tab
- type TabController
- type TabItem
- type TemplateRegistry
- type TimeRange
- type TimelineControls
- type TreeView
- type UI
- type VersionMigration
- type YAMLFormat
Constants ¶
This section is empty.
Variables ¶
var CaptureComponent = devtools.CaptureComponent
CaptureComponent captures a component snapshot.
var DefaultConfig = devtools.DefaultConfig
DefaultConfig returns the default configuration.
var DefaultPatterns = devtools.DefaultPatterns
DefaultPatterns returns the default sanitization patterns.
var DetectFormat = devtools.DetectFormat
DetectFormat detects the format from a filename.
var Disable = devtools.Disable
Disable disables devtools.
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
var GetCollector = devtools.GetCollector
GetCollector returns the global data collector.
var GetSupportedFormats = devtools.GetSupportedFormats
GetSupportedFormats returns the list of supported formats.
var GetTemplateNames = devtools.GetTemplateNames
GetTemplateNames returns available template names.
var IsEnabled = devtools.IsEnabled
IsEnabled returns whether devtools is enabled.
var LoadConfig = devtools.LoadConfig
LoadConfig loads configuration from a file.
var NewCommandTimeline = devtools.NewCommandTimeline
NewCommandTimeline creates a new command timeline.
var NewComponentFilter = devtools.NewComponentFilter
NewComponentFilter creates a new component filter.
var NewComponentInspector = devtools.NewComponentInspector
NewComponentInspector creates a new component inspector.
var NewDataCollector = devtools.NewDataCollector
NewDataCollector creates a new data collector.
var NewDetailPanel = devtools.NewDetailPanel
NewDetailPanel creates a new detail panel.
var NewDevToolsStore = devtools.NewDevToolsStore
NewDevToolsStore creates a new devtools store.
var NewDevToolsUI = devtools.NewDevToolsUI
NewDevToolsUI creates a new devtools UI.
var NewEventFilter = devtools.NewEventFilter
NewEventFilter creates a new event filter.
var NewEventLog = devtools.NewEventLog
NewEventLog creates a new event log.
var NewEventReplayer = devtools.NewEventReplayer
NewEventReplayer creates a new event replayer.
var NewEventTracker = devtools.NewEventTracker
NewEventTracker creates a new event tracker.
var NewFlameGraphRenderer = devtools.NewFlameGraphRenderer
NewFlameGraphRenderer creates a new flame graph renderer.
var NewFormatRegistry = devtools.NewFormatRegistry
NewFormatRegistry creates a new format registry.
var NewKeyboardHandler = devtools.NewKeyboardHandler
NewKeyboardHandler creates a new keyboard handler.
var NewLayoutManager = devtools.NewLayoutManager
NewLayoutManager creates a new layout manager.
var NewPerformanceData = devtools.NewPerformanceData
NewPerformanceData creates new performance data.
var NewPerformanceMonitor = devtools.NewPerformanceMonitor
NewPerformanceMonitor creates a new performance monitor.
var NewRouterDebugger = devtools.NewRouterDebugger
NewRouterDebugger creates a new router debugger.
var NewSanitizer = devtools.NewSanitizer
NewSanitizer creates a new sanitizer.
var NewSearchWidget = devtools.NewSearchWidget
NewSearchWidget creates a new search widget.
var NewStateHistory = devtools.NewStateHistory
NewStateHistory creates a new state history.
var NewStateViewer = devtools.NewStateViewer
NewStateViewer creates a new state viewer.
var NewStreamSanitizer = devtools.NewStreamSanitizer
NewStreamSanitizer creates a new stream sanitizer.
var NewTabController = devtools.NewTabController
NewTabController creates a new tab controller.
var NewTimelineControls = devtools.NewTimelineControls
NewTimelineControls creates new timeline controls.
var NewTreeView = devtools.NewTreeView
NewTreeView creates a new tree view.
var NotifyComponentCreated = devtools.NotifyComponentCreated
NotifyComponentCreated notifies devtools of a component creation.
var NotifyComponentMounted = devtools.NotifyComponentMounted
NotifyComponentMounted notifies devtools of a component mount.
var NotifyComponentUnmounted = devtools.NotifyComponentUnmounted
NotifyComponentUnmounted notifies devtools of a component unmount.
var NotifyComponentUpdated = devtools.NotifyComponentUpdated
NotifyComponentUpdated notifies devtools of a component update.
var NotifyEvent = devtools.NotifyEvent
NotifyEvent notifies devtools of an event.
var NotifyRefChanged = devtools.NotifyRefChanged
NotifyRefChanged notifies devtools of a ref value change.
var RegisterFormat = devtools.RegisterFormat
RegisterFormat registers an export format.
var RegisterMigration = devtools.RegisterMigration
RegisterMigration registers a migration.
var RegisterTemplate = devtools.RegisterTemplate
RegisterTemplate registers a sanitization template.
var RenderView = devtools.RenderView
RenderView renders the devtools view on top of the app view.
var SetCollector = devtools.SetCollector
SetCollector sets the global data collector.
var Toggle = devtools.Toggle
Toggle enables or disables the devtools overlay.
var ValidateMigrationChain = devtools.ValidateMigrationChain
ValidateMigrationChain validates the migration chain.
Functions ¶
func HandleUpdate ¶
HandleUpdate handles Bubbletea messages for devtools.
func NotifyRenderComplete ¶
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 DataCollector ¶
type DataCollector = devtools.DataCollector
DataCollector collects runtime data for devtools.
type DryRunResult ¶
type DryRunResult = devtools.DryRunResult
DryRunResult contains migration dry run results.
type EventReplayer ¶
type EventReplayer = devtools.EventReplayer
EventReplayer replays recorded events.
type EventStatistics ¶
type EventStatistics = devtools.EventStatistics
EventStatistics contains event statistics.
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 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 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 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 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 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 SearchWidget ¶
type SearchWidget = devtools.SearchWidget
SearchWidget provides search functionality.
type StateHistory ¶
type StateHistory = devtools.StateHistory
StateHistory tracks state changes over time.
type StreamSanitizer ¶
type StreamSanitizer = devtools.StreamSanitizer
StreamSanitizer provides streaming sanitization.
type TemplateRegistry ¶
type TemplateRegistry = devtools.TemplateRegistry
TemplateRegistry holds sanitization templates.
type TimelineControls ¶
type TimelineControls = devtools.TimelineControls
TimelineControls provides timeline navigation UI.
type VersionMigration ¶
type VersionMigration = devtools.VersionMigration
VersionMigration is the interface for version migrations.