Documentation
¶
Index ¶
- Constants
- Variables
- func ActionableFrameworkPanic(parseOptions ActionablePanicOptions) string
- func AgentRefForFiber(parseFiber *Fiber) string
- func BeginStartupProfiling(parseMode string)
- func BuildDOMWrappedFunctionIfReadyGlobal(parseHandlerFn any) (any, bool)
- func BuildDiagnosticsService() pluginruntime.DiagnosticsService
- func BuildRuntimeInspectionService() pluginruntime.RuntimeInspectionService
- func ClassIdProps(parseClass, parseId string) map[string]any
- func ClassProps(parseClass string) map[string]any
- func ClearDiagnostics()
- func ClearLogs()
- func ClearProfiling()
- func ConfigurePanicReportRedaction(parsePolicy PanicReportRedactionPolicy)
- func ConfigureStrictDiagnostics(parseOptions StrictDiagnosticsOptions)
- func ConfigureUnhandledPanicLogging(parseOptions PanicLoggingOptions)
- func ContainPanic(parseSource string, parsePhase PanicPhase, parseSubject string, ...)
- func CurrentFiberPath() string
- func DemoteDirectTextChild(parseElem *Element)
- func EmitAgentEvent(parseRt *Runtime, parseRef string, parseEventName string, ...) error
- func EmptyProps() map[string]any
- func EnqueueUI(parseFn func())
- func EnsureElementProps(parseElem *Element) map[string]any
- func FinalizeUnhandledPanicContext(parseSource string, parsePhase PanicPhase, parseSubject string, ...) (any, bool)
- func FlushGlobalDiscreteWork()
- func GetAgentState(parseRt *Runtime, parseRef string, parseHookSlot int) (any, error)
- func GetUIQueueSize() int
- func GoUseAtom[T any](parseRt *Runtime, parseId string, parseInitialValue T) (func() T, func(any))
- func GoUseAtomGlobal[T any](parseAtomID string, parseAtomInitialValue T) (func() T, func(T))
- func GoUseCallback(parseFn any, parseDeps ...any) any
- func GoUseContextValue(parseDescriptor *ContextDescriptor) any
- func GoUseEffect(parseEffect func() func(), parseDeps ...any)
- func GoUseEffectGlobal(parseEffectFn func() func(), parseEffectDeps ...any)
- func GoUseEffectOf[D comparable](parseEffect func() func(), parseDep D)
- func GoUseFetch(parseFetchURL string, parseFetchOptions ...any) (func() FetchState, func())
- func GoUseFunc(parseFn any) any
- func GoUseId() string
- func GoUseIdGlobal() string
- func GoUseLayoutEffect(parseEffect func() func(), parseDeps ...any)
- func GoUseLayoutEffectGlobal(parseEffectFn func() func(), parseEffectDeps ...any)
- func GoUseMemo(parseCompute func() any, parseDeps ...any) any
- func GoUseMemoFor[T any](parseCompute func() T, parseDeps ...any) T
- func GoUseMemoGlobal(parseMemoCompute func() any, parseMemoDeps ...any) any
- func GoUseMemoGlobalTyped(parseMemoCompute func() any, parseMemoTargetType reflect.Type, ...) any
- func GoUseMemoOf[T any, D comparable](parseCompute func(D) T, parseDep D) T
- func GoUseMemoTyped(parseCompute func() any, parseTargetType reflect.Type, parseDeps ...any) any
- func GoUseState[T any](parseRt *Runtime, parseInitialValue T) (func() T, func(any))
- func GoUseStateGlobal[T any](parseStateInitialValue T) (func() T, func(any))
- func GuardCallback(parseSource string, parseSubject string, parseFn func()) func()
- func HrefProps(parseHref string) map[string]any
- func IdProps(parseId string) map[string]any
- func InitGlobalRuntime(parseConfig Config)
- func InputTypeProps(parseTyp string) map[string]any
- func IsCurrentFiberTransitionUpdate() bool
- func IsDOMNodeNull(parseNode DOMNode) bool
- func IsSameDOMNode(parseLeft DOMNode, parseRight DOMNode) bool
- func NormalizeHotReloadValue(parseValue any) any
- func OnFirstCommit(parseFn func())
- func PlaceholderProps(parsePlaceholder string) map[string]any
- func PlainTextContent(parseElem *Element) (string, bool)
- func ProcessUIQueue()
- func RecordStartupBootstrapRead(parseDurationNs int64, parseSource string)
- func RecordStartupRouteContext(parseRoutePath string)
- func RecoverContainedPanic(parseSource string, parseSubject string)
- func RefreshElementHostProps(parseElem *Element)
- func RenderDetached(parseSelector string, parseElement *Element) error
- func RenderToStream(parseCtx context.Context, parseWriter io.Writer, parseElement *Element, ...) (parseErr error)
- func RenderToString(parseElement *Element) (parseMarkup string, parseErr error)
- func ReportDiagnostic(parseSource string, parseSeverity DiagnosticSeverity, parseMessage string)
- func ReportDiagnosticWithContext(parseSource string, parseSeverity DiagnosticSeverity, parseMessage string, ...)
- func ReportLog(parseDomain string, parseLevel LogLevel, parseMessage string)
- func ReportLogWithFields(parseDomain string, parseLevel LogLevel, ...)
- func ReportProfilingEvent(parseDomain string, parseName string, parsePhase string, parseTarget string, ...)
- func ReportUnhandledPanicContext(parseSource string, parsePhase PanicPhase, parseSubject string, ...) string
- func ResetFirstCommitHooksForTest()
- func ResetWASMArtifactMetadata()
- func ResetWASMStackFrameMapper()
- func SafeGo(parseSource string, parseSubject string, parseFn func())
- func SanitizeURLAttributeValue(parseName, parseValue string) string
- func SetAgentState(parseRt *Runtime, parseRef string, parseHookSlot int, parseValue any) error
- func SetCurrentFiber(parseFiber *Fiber)
- func SetWASMArtifactMetadata(parseArtifactMeta WASMArtifactMetadata)
- func SetWASMStackFrameMapper(parseFrameMapper WASMStackFrameMapper)
- func SrcProps(parseSrc string) map[string]any
- func StoreStartupCostAttribution(storeAttribution StartupCostAttribution)
- func StyleProps(parseStyle string) map[string]any
- func SuspendUntil(parseDone <-chan struct{}, parseReason string)
- func TypeProps(parseTyp string) map[string]any
- func ValueProps(parseValue any) map[string]any
- type ActionablePanicOptions
- type AgentDeleteAtomResult
- type AgentDetachedRoot
- type AgentHookPreview
- type AgentNodeSnapshot
- type AgentQueryMatch
- type AgentQuerySelector
- type AgentSnapshot
- type AsyncBoundaryElementType
- type AtomRegistry
- func (parseAr *AtomRegistry) GetAtom(parseId string) (any, bool)
- func (parseAr *AtomRegistry) GetAtomCount() int
- func (parseAr *AtomRegistry) GetSubscriberCount(parseAtomID string) int
- func (parseAr *AtomRegistry) GetSubscriberTotal() int
- func (parseAr *AtomRegistry) InitAtom(parseId string, parseInitialValue any)
- func (parseAr *AtomRegistry) MoveSubscription(parseAtomID string, parseFrom *Fiber, parseTo *Fiber)
- func (parseAr *AtomRegistry) MoveSubscriptions(parseAtomIDs []string, parseFrom *Fiber, parseTo *Fiber)
- func (parseAr *AtomRegistry) RegisterDerivedAtom(parseId string, parseDeps []string, parseCompute func() any) error
- func (parseAr *AtomRegistry) RestoreSnapshot(parseSnapshot map[string]any) []*Fiber
- func (parseAr *AtomRegistry) SetAtom(parseId string, parseValue any) []*Fiber
- func (parseAr *AtomRegistry) Snapshot() map[string]any
- func (parseAr *AtomRegistry) Subscribe(parseAtomID string, parseFiber *Fiber)
- func (parseAr *AtomRegistry) Unsubscribe(parseAtomID string, parseFiber *Fiber)
- func (parseAr *AtomRegistry) UnsubscribeFiberFromAll(parseFiber *Fiber)
- func (parseAr *AtomRegistry) UnsubscribeMany(parseAtomIDs []string, parseFiber *Fiber)
- type Attrs
- type Blurrer
- type BrowserState
- type Clicker
- type ComponentRenderTraceSnapshot
- type ComponentSignature
- type ComponentType
- func (parseComponentType *ComponentType) IdentityKey() string
- func (parseComponentType *ComponentType) ImplementationMatches(parseComponentImplementation any) bool
- func (parseComponentType *ComponentType) Render(parseComponentProps map[string]any) *Element
- func (parseComponentType *ComponentType) SetImplementation(parseComponentImplementation any)
- func (parseComponentType *ComponentType) SetImplementationRenderer(parseComponentImplementation any, ...)
- type Config
- type ContextDescriptor
- type ContextProviderType
- type DOMAdapter
- type DOMNode
- type DOMRefSink
- type Deadline
- type Diagnostic
- type DiagnosticClassification
- type DiagnosticSeverity
- type Effect
- type Element
- func A(parseProps map[string]any, parseChildren ...any) *Element
- func Abbr(parseProps map[string]any, parseChildren ...any) *Element
- func Address(parseProps map[string]any, parseChildren ...any) *Element
- func Article(parseProps map[string]any, parseChildren ...any) *Element
- func Aside(parseProps map[string]any, parseChildren ...any) *Element
- func Audio(parseProps map[string]any, parseChildren ...any) *Element
- func B(parseProps map[string]any, parseChildren ...any) *Element
- func Bdi(parseProps map[string]any, parseChildren ...any) *Element
- func Bdo(parseProps map[string]any, parseChildren ...any) *Element
- func Blockquote(parseProps map[string]any, parseChildren ...any) *Element
- func Body(parseProps map[string]any, parseChildren ...any) *Element
- func Br(parseProps map[string]any) *Element
- func Button(parseProps map[string]any, parseChildren ...any) *Element
- func Canvas(parseProps map[string]any, parseChildren ...any) *Element
- func Caption(parseProps map[string]any, parseChildren ...any) *Element
- func Circle(parseProps map[string]any) *Element
- func Cite(parseProps map[string]any, parseChildren ...any) *Element
- func Code(parseProps map[string]any, parseChildren ...any) *Element
- func Col(parseProps map[string]any) *Element
- func Colgroup(parseProps map[string]any, parseChildren ...any) *Element
- func CreateElement(parseTyp any, parseProps map[string]any, parseChildren ...any) *Element
- func CreateElementCompactHostOwned(parseTag string, parseKey string, parseAttrs []HostAttr, parseChildren ...any) *Element
- func CreateElementCompactHostOwnedText(parseTag string, parseKey string, parseAttrs []HostAttr, parseText string) *Element
- func CreateElementOwned(parseTyp any, parseProps map[string]any, parseChildren ...any) *Element
- func Data(parseProps map[string]any, parseChildren ...any) *Element
- func Datalist(parseProps map[string]any, parseChildren ...any) *Element
- func Dd(parseProps map[string]any, parseChildren ...any) *Element
- func Del(parseProps map[string]any, parseChildren ...any) *Element
- func Details(parseProps map[string]any, parseChildren ...any) *Element
- func Dfn(parseProps map[string]any, parseChildren ...any) *Element
- func Dialog(parseProps map[string]any, parseChildren ...any) *Element
- func Div(parseProps map[string]any, parseChildren ...any) *Element
- func DivWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
- func Dl(parseProps map[string]any, parseChildren ...any) *Element
- func Dt(parseProps map[string]any, parseChildren ...any) *Element
- func Em(parseProps map[string]any, parseChildren ...any) *Element
- func Embed(parseProps map[string]any) *Element
- func Fieldset(parseProps map[string]any, parseChildren ...any) *Element
- func Figcaption(parseProps map[string]any, parseChildren ...any) *Element
- func Figure(parseProps map[string]any, parseChildren ...any) *Element
- func Footer(parseProps map[string]any, parseChildren ...any) *Element
- func Form(parseProps map[string]any, parseChildren ...any) *Element
- func G(parseProps map[string]any, parseChildren ...any) *Element
- func H1(parseProps map[string]any, parseChildren ...any) *Element
- func H2(parseProps map[string]any, parseChildren ...any) *Element
- func H3(parseProps map[string]any, parseChildren ...any) *Element
- func H4(parseProps map[string]any, parseChildren ...any) *Element
- func H5(parseProps map[string]any, parseChildren ...any) *Element
- func H6(parseProps map[string]any, parseChildren ...any) *Element
- func Head(parseProps map[string]any, parseChildren ...any) *Element
- func Header(parseProps map[string]any, parseChildren ...any) *Element
- func Hgroup(parseProps map[string]any, parseChildren ...any) *Element
- func Hr(parseProps map[string]any) *Element
- func Html(parseProps map[string]any, parseChildren ...any) *Element
- func I(parseProps map[string]any, parseChildren ...any) *Element
- func Iframe(parseProps map[string]any, parseChildren ...any) *Element
- func Img(parseProps map[string]any) *Element
- func Input(parseProps map[string]any) *Element
- func Ins(parseProps map[string]any, parseChildren ...any) *Element
- func Kbd(parseProps map[string]any, parseChildren ...any) *Element
- func Label(parseProps map[string]any, parseChildren ...any) *Element
- func Legend(parseProps map[string]any, parseChildren ...any) *Element
- func Li(parseProps map[string]any, parseChildren ...any) *Element
- func Line(parseProps map[string]any) *Element
- func Link(parseProps map[string]any) *Element
- func Main(parseProps map[string]any, parseChildren ...any) *Element
- func MainWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
- func Mark(parseProps map[string]any, parseChildren ...any) *Element
- func Menu(parseProps map[string]any, parseChildren ...any) *Element
- func Meta(parseProps map[string]any) *Element
- func Meter(parseProps map[string]any, parseChildren ...any) *Element
- func Nav(parseProps map[string]any, parseChildren ...any) *Element
- func Object(parseProps map[string]any, parseChildren ...any) *Element
- func Ol(parseProps map[string]any, parseChildren ...any) *Element
- func Optgroup(parseProps map[string]any, parseChildren ...any) *Element
- func Option(parseProps map[string]any, parseChildren ...any) *Element
- func Output(parseProps map[string]any, parseChildren ...any) *Element
- func P(parseProps map[string]any, parseChildren ...any) *Element
- func Param(parseProps map[string]any) *Element
- func Path(parseProps map[string]any) *Element
- func Picture(parseProps map[string]any, parseChildren ...any) *Element
- func Polygon(parseProps map[string]any) *Element
- func Portal(parseProps map[string]any, parseChildren ...any) *Element
- func Pre(parseProps map[string]any, parseChildren ...any) *Element
- func Progress(parseProps map[string]any, parseChildren ...any) *Element
- func Q(parseProps map[string]any, parseChildren ...any) *Element
- func Rect(parseProps map[string]any) *Element
- func Rp(parseProps map[string]any, parseChildren ...any) *Element
- func Rt(parseProps map[string]any, parseChildren ...any) *Element
- func Ruby(parseProps map[string]any, parseChildren ...any) *Element
- func S(parseProps map[string]any, parseChildren ...any) *Element
- func Samp(parseProps map[string]any, parseChildren ...any) *Element
- func Script(parseProps map[string]any, parseChildren ...any) *Element
- func Section(parseProps map[string]any, parseChildren ...any) *Element
- func SectionWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
- func Select(parseProps map[string]any, parseChildren ...any) *Element
- func Slot(parseProps map[string]any, parseChildren ...any) *Element
- func Small(parseProps map[string]any, parseChildren ...any) *Element
- func Source(parseProps map[string]any) *Element
- func Span(parseProps map[string]any, parseChildren ...any) *Element
- func Strong(parseProps map[string]any, parseChildren ...any) *Element
- func Style(parseProps map[string]any, parseChildren ...any) *Element
- func Sub(parseProps map[string]any, parseChildren ...any) *Element
- func Summary(parseProps map[string]any, parseChildren ...any) *Element
- func Sup(parseProps map[string]any, parseChildren ...any) *Element
- func Svg(parseProps map[string]any, parseChildren ...any) *Element
- func Table(parseProps map[string]any, parseChildren ...any) *Element
- func Tbody(parseProps map[string]any, parseChildren ...any) *Element
- func Td(parseProps map[string]any, parseChildren ...any) *Element
- func Template(parseProps map[string]any, parseChildren ...any) *Element
- func Textarea(parseProps map[string]any, parseChildren ...any) *Element
- func Tfoot(parseProps map[string]any, parseChildren ...any) *Element
- func Th(parseProps map[string]any, parseChildren ...any) *Element
- func Thead(parseProps map[string]any, parseChildren ...any) *Element
- func Time(parseProps map[string]any, parseChildren ...any) *Element
- func Title(parseProps map[string]any, parseChildren ...any) *Element
- func Tr(parseProps map[string]any, parseChildren ...any) *Element
- func Track(parseProps map[string]any) *Element
- func U(parseProps map[string]any, parseChildren ...any) *Element
- func Ul(parseProps map[string]any, parseChildren ...any) *Element
- func Var(parseProps map[string]any, parseChildren ...any) *Element
- func Video(parseProps map[string]any, parseChildren ...any) *Element
- func Wbr(parseProps map[string]any) *Element
- func WithComponents(parseTagName string, parseProps map[string]any, ...) *Element
- type ErrorBoundaryType
- type Event
- type EventAdapter
- type EventHandler
- type FetchState
- type Fiber
- type FiberSnapshot
- type FlamegraphFrameSnapshot
- type Focuser
- type HookSnapshot
- type Hooks
- type HostAttr
- type HostMountSpec
- type HotBranchSnapshot
- type HotReloadComponentSnapshot
- type HotReloadFetchSnapshot
- type HotReloadMemoSnapshot
- type HotReloadRestoreDecision
- type HotReloadRestorePlan
- type HotReloadSnapshot
- type HydrationDebugSnapshot
- type HydrationMetrics
- type InspectionSnapshot
- type InspectionStats
- type InternalStateSnapshot
- type LogEntry
- type LogLevel
- type MemoryHygieneOptions
- type MemoryHygieneSnapshot
- type PanicLoggingOptions
- type PanicPhase
- type PanicReport
- type PanicReportRedactionContext
- type PanicReportRedactionPolicy
- type PassiveEventHandler
- type PortalElementType
- type ProfilingEvent
- type ProfilingPhaseTotalsSnapshot
- type ProfilingSnapshot
- type ReactiveRegionElementType
- type ReactiveTextElementType
- type RefValue
- type ReplayEvent
- type RouteStartupBudgetSnapshot
- type Runtime
- func (parseRt *Runtime) AdvanceAgentStateVersion() uint64
- func (parseRt *Runtime) AgentStateVersion() uint64
- func (parseRt *Runtime) BeginReplayCapture()
- func (parseRt *Runtime) BeginStartupProfiling(parseMode string)
- func (parseRt *Runtime) CaptureHotReloadSnapshot() HotReloadSnapshot
- func (parseRt *Runtime) CheckMemoryHygiene(parseOptions MemoryHygieneOptions) MemoryHygieneSnapshot
- func (parseRt *Runtime) CleanupAtomSubscriptions(parseFiber *Fiber)
- func (parseRt *Runtime) ClearProfiling()
- func (parseRt *Runtime) EndReplayCapture() []ReplayEvent
- func (parseRt *Runtime) FindNodesWithAttributeInSelector(parseSelector string, parseName string) []DOMNode
- func (parseRt *Runtime) FindNodesWithAttributeInTarget(parseTarget any, parseName string) []DOMNode
- func (parseRt *Runtime) FlushScheduledDiscreteWork()
- func (parseRt *Runtime) GetAtomValue(parseId string) (any, bool)
- func (parseRt *Runtime) GetAttributeValue(parseNode DOMNode, parseName string) (string, bool)
- func (parseRt *Runtime) GetTagName(parseNode DOMNode) (string, bool)
- func (parseRt *Runtime) HasPendingHotReloadSnapshot() bool
- func (parseRt *Runtime) Hydrate(parseElement *Element, parseContainer DOMNode)
- func (parseRt *Runtime) HydrateInto(parseTarget any, parseElement *Element) error
- func (parseRt *Runtime) HydrateTo(parseSelector string, parseElement *Element)
- func (parseRt *Runtime) InitAtomValue(parseId string, parseValue any) bool
- func (parseRt *Runtime) Inspect() InspectionSnapshot
- func (parseRt *Runtime) InternalStateSnapshot() InternalStateSnapshot
- func (parseRt *Runtime) PrepareForHotReload()
- func (parseRt *Runtime) RecordProfilingEvent(parseEvent ProfilingEvent)
- func (parseRt *Runtime) RecordStartupBootstrapRead(parseDurationNs int64, parseSource string)
- func (parseRt *Runtime) RecordStartupRouteContext(parseRoutePath string)
- func (parseRt *Runtime) RefreshEffectsForFiber(parseFiber *Fiber)
- func (parseRt *Runtime) RegisterDerivedAtom(parseId string, parseDeps []string, parseCompute func() any) error
- func (parseRt *Runtime) Render(parseElement *Element, parseContainer DOMNode)
- func (parseRt *Runtime) RenderInto(parseTarget any, parseElement *Element) error
- func (parseRt *Runtime) RenderTo(parseSelector string, parseElement *Element)
- func (parseRt *Runtime) ReplayEvents() []ReplayEvent
- func (parseRt *Runtime) ReplayUpdates(parseEvents []ReplayEvent)
- func (parseRt *Runtime) ResolveAgentRef(parseRef string) (*Fiber, error)
- func (parseRt *Runtime) RestoreAtomSnapshot(parseSnapshot map[string]any) error
- func (parseRt *Runtime) RestoreHotReloadSnapshot(parseSnapshot HotReloadSnapshot)
- func (parseRt *Runtime) RestoreHotReloadSnapshotWithPlan(parseSnapshot HotReloadSnapshot, parsePlan HotReloadRestorePlan) HotReloadRestoreDecision
- func (parseRt *Runtime) ScheduleGranularUpdateForFiber(parseFiber *Fiber)
- func (parseRt *Runtime) ScheduleGranularUpdateForFiberWithOrigin(parseFiber *Fiber, parseOrigin string)
- func (parseRt *Runtime) ScheduleOwnedFiberUpdate(parseFiber *Fiber)
- func (parseRt *Runtime) ScheduleOwnedFiberUpdateWithOrigin(parseFiber *Fiber, parseOrigin string)
- func (parseRt *Runtime) ScheduleSubscribedFiberUpdate(parseFiber *Fiber)
- func (parseRt *Runtime) ScheduleSubscribedFiberUpdateWithOrigin(parseFiber *Fiber, parseOrigin string)
- func (parseRt *Runtime) ScheduleTransition(parseFn func())
- func (parseRt *Runtime) ScheduleUpdate()
- func (parseRt *Runtime) ScheduleUpdateForFiber(parseFiber *Fiber)
- func (parseRt *Runtime) ScheduleUpdateForFiberWithOrigin(parseFiber *Fiber, parseOrigin string)
- func (parseRt *Runtime) ScheduleUpdateWithLane(parseLane UpdateLane)
- func (parseRt *Runtime) SchedulerSnapshot() SchedulerSnapshot
- func (parseRt *Runtime) SelectorResolves(parseSelector string) bool
- func (parseRt *Runtime) SerializedMountRoots() int
- func (parseRt *Runtime) SetAtomValue(parseId string, parseValue any) error
- func (parseRt *Runtime) SetIDSeed(parseSeed int)
- func (parseRt *Runtime) SetNextHydrationObserver(parseCorrelationID string, parseNotify func(HydrationMetrics))
- func (parseRt *Runtime) SetNextHydrationStrict(isStrict bool)
- func (parseRt *Runtime) ShouldDeferStateUpdates() bool
- func (parseRt *Runtime) SnapshotAtoms() map[string]any
- func (parseRt *Runtime) StartReplayRecording()
- func (parseRt *Runtime) StartTransition(parseFn func())
- func (parseRt *Runtime) StopReplayRecording() []ReplayEvent
- func (parseRt *Runtime) StoreStartupCostAttribution(storeAttribution StartupCostAttribution)
- type RuntimeLimits
- type SSRStreamChunk
- type SSRStreamOptions
- type Scheduler
- type SchedulerSnapshot
- type ScrollIntoViewer
- type StartupCostAttribution
- type StartupProfilingSnapshot
- type StrictDiagnosticsOptions
- type StrictModeOptions
- type Suspension
- type UpdateLane
- type WASMArtifactMetadata
- type WASMStackFrame
- type WASMStackFrameMapper
Constants ¶
const ( // SSRStreamChunkShell identifies the initial shell chunk. SSRStreamChunkShell = "shell" // SSRStreamChunkBoundary identifies an out-of-order async boundary chunk. SSRStreamChunkBoundary = "boundary" )
const DOMRefKey = "__gwc_dom_ref__"
DOMRefKey is the reserved props key that carries a DOMRefSink. It is namespaced like the other internal keys (e.g. the custom-element property prefix) so it can never collide with a real attribute name.
Variables ¶
var AsyncBoundaryNodeType = &AsyncBoundaryElementType{}
AsyncBoundaryNodeType marks async fallback boundaries.
var ErrAgentAtomHasSubscribers = errors.New("agent atom has live subscribers")
ErrAgentAtomHasSubscribers reports that a bridge.delete-atom command tried to delete an atom that still has live subscribers without force=true.
var ErrAgentNoHandler = errors.New("fiber has no handler for the requested event")
ErrAgentNoHandler reports that the named event (e.g. "onclick") has no handler registered on the resolved fiber. It is distinct from ErrAgentRefStale so callers can distinguish "node is gone" from "node exists but has no such handler".
var ErrAgentRefInvalid = errors.New("agent ref is invalid")
ErrAgentRefInvalid reports a malformed agent ref (for example an empty string). The agent bridge maps it to the bad-payload wire error.
var ErrAgentRefStale = errors.New("agent ref does not resolve in the current tree")
ErrAgentRefStale reports that an agent node ref no longer resolves in the current fiber tree (the component unmounted or the tree was replaced). The agent bridge maps it to the stale-ref wire error so callers re-query instead of retrying the same ref.
var ErrAgentStateSlotInvalid = errors.New("agent state slot is invalid")
ErrAgentStateSlotInvalid reports that a bridge.set-state command addressed a hook slot that does not exist or is not a state hook.
var PortalNodeType = &PortalElementType{}
PortalNodeType marks subtrees that should commit into a separate target container.
var ReactiveRegionNodeType = &ReactiveRegionElementType{}
ReactiveRegionNodeType marks anchored fine-grained update regions.
var ReactiveTextNodeType = &ReactiveTextElementType{}
ReactiveTextNodeType marks text-like fine-grained update regions.
Functions ¶
func ActionableFrameworkPanic ¶
func ActionableFrameworkPanic(parseOptions ActionablePanicOptions) string
ActionableFrameworkPanic is a core package helper.
func AgentRefForFiber ¶
AgentRefForFiber returns the stable agent ref for a live fiber: the same key/index-disambiguated path the hot reload snapshot keys component state by, so a ref survives re-renders that recreate the fiber. The root fiber has no ref (empty string) - agents address nodes, not the mount point.
func BeginStartupProfiling ¶
func BeginStartupProfiling(parseMode string)
BeginStartupProfiling marks the beginning of a startup workflow when one has not already been started for the current runtime.
func BuildDOMWrappedFunctionIfReadyGlobal ¶
BuildDOMWrappedFunctionIfReadyGlobal reports that DOM callback wrapping is unavailable on non-browser targets.
func BuildDiagnosticsService ¶
func BuildDiagnosticsService() pluginruntime.DiagnosticsService
BuildDiagnosticsService returns one runtime1-backed diagnostics facade.
func BuildRuntimeInspectionService ¶
func BuildRuntimeInspectionService() pluginruntime.RuntimeInspectionService
BuildRuntimeInspectionService returns one runtime1-backed inspection service.
func ClassIdProps ¶
ClassIdProps returns a props map with the given class and id.
func ClassProps ¶
ClassProps returns a props map with the given CSS class.
func ClearProfiling ¶
func ClearProfiling()
ClearProfiling resets collected profiling counters and timeline events.
func ConfigurePanicReportRedaction ¶
func ConfigurePanicReportRedaction(parsePolicy PanicReportRedactionPolicy)
ConfigurePanicReportRedaction installs runtime-local redaction for panic report fields.
func ConfigureStrictDiagnostics ¶
func ConfigureStrictDiagnostics(parseOptions StrictDiagnosticsOptions)
ConfigureStrictDiagnostics sets the current strict-diagnostics behavior.
func ConfigureUnhandledPanicLogging ¶
func ConfigureUnhandledPanicLogging(parseOptions PanicLoggingOptions)
ConfigureUnhandledPanicLogging sets the panic logging options including raw output visibility and the report hook.
func ContainPanic ¶
func ContainPanic(parseSource string, parsePhase PanicPhase, parseSubject string, parseRecovered any)
ContainPanic reports a recovered panic through the structured panic-report pipeline and never re-panics. Call it from a deferred recover at a containment boundary (goroutine top, host callback, work loop).
func CurrentFiberPath ¶
func CurrentFiberPath() string
CurrentFiberPath returns the current component path while a hook is rendering.
func DemoteDirectTextChild ¶ added in v4.1.0
func DemoteDirectTextChild(parseElem *Element)
DemoteDirectTextChild converts an element that carries its only text child directly on the host (the direct-text fast path) back to an explicit TEXT_ELEMENT child. Post-creation child appenders (html.WithChildren) must call this first: the direct-text representation renders TextContent and ignores structural children, so appending to Children alone would drop the new nodes.
func EmitAgentEvent ¶
func EmitAgentEvent(parseRt *Runtime, parseRef string, parseEventName string, parsePayload map[string]any) error
EmitAgentEvent resolves parseRef to its live fiber under schedulerMu, locates the handler for parseEventName (e.g. "click" or "onclick") in the fiber's props map, and invokes it with a synthesised zero-value event. It mirrors exactly the type-switch dispatch testkit/render uses so the same handler signatures that work in tests work here. The scheduler lock is acquired via resolveAgentRefLocked (not ResolveAgentRef) so the caller must NOT already hold schedulerMu. Panics inside the handler are caught and returned as errors (crash containment — an agent command must never kill the runtime). Returns ErrAgentRefStale when the ref no longer resolves, ErrAgentRefInvalid when the ref string is malformed, and ErrAgentNoHandler when the fiber carries no handler under parseEventName.
func EnqueueUI ¶
func EnqueueUI(parseFn func())
EnqueueUI adds a function to the UI queue for main-thread execution.
func EnsureElementProps ¶ added in v4.1.0
EnsureElementProps materializes and caches a legacy props-map view on one typed fast-lane element. Public tooling that reads Element.Props directly should call this first; elements built through the map lane are returned unchanged.
func FinalizeUnhandledPanicContext ¶
func FinalizeUnhandledPanicContext(parseSource string, parsePhase PanicPhase, parseSubject string, parsePath string, parseComponentStack []string, parseRecovered any) (any, bool)
FinalizeUnhandledPanicContext is a core package helper.
func FlushGlobalDiscreteWork ¶ added in v4.1.0
func FlushGlobalDiscreteWork()
FlushGlobalDiscreteWork flushes the global runtime's freshly scheduled pass; the wasm DOM event bridge uses it because adapter-level wrappers do not carry a runtime reference.
func GetAgentState ¶
GetAgentState resolves parseRef, validates parseHookSlot is a state hook, and returns the current value stored in that state slot WITHOUT mutating it. It is the read counterpart of SetAgentState, used to capture a prior value so an agent set-state can be recorded as a reversible mutation.
func GoUseAtom ¶
GoUseAtom provides access to global state with fine-grained reactivity. Unlike useState which is local to a component, atoms are shared across components. When an atom updates, only components that use that specific atom re-render.
func GoUseAtomGlobal ¶
GoUseAtomGlobal wraps GoUseAtom with the global runtime on non-browser targets.
func GoUseCallback ¶
GoUseCallback memoizes a callback function with dependency tracking
func GoUseContextValue ¶
func GoUseContextValue(parseDescriptor *ContextDescriptor) any
GoUseContextValue reads the nearest provider value for a context descriptor.
func GoUseEffect ¶
func GoUseEffect(parseEffect func() func(), parseDeps ...any)
GoUseEffect runs side effects and supports cleanup The effect function can return a cleanup function that will be called before the next effect runs or on unmount GoUseEffect registers a passive effect that runs after the commit's DOM mutation. See goUseEffectImpl.
func GoUseEffectGlobal ¶
func GoUseEffectGlobal(parseEffectFn func() func(), parseEffectDeps ...any)
GoUseEffectGlobal wraps GoUseEffect on non-browser targets.
func GoUseEffectOf ¶ added in v4.2.0
func GoUseEffectOf[D comparable](parseEffect func() func(), parseDep D)
GoUseEffectOf registers a passive effect keyed by a single comparable dependency without the variadic []any deps allocation. Same slot machinery as GoUseEffect ("effect" signature); not swappable with it between renders.
func GoUseFetch ¶
func GoUseFetch(parseFetchURL string, parseFetchOptions ...any) (func() FetchState, func())
GoUseFetch is a stub for non-WASM environments
func GoUseFunc ¶
GoUseFunc validates and stores a function for event handling The actual wrapping to js.Value happens in the WASM shim layer
func GoUseId ¶
func GoUseId() string
GoUseId generates a unique, stable identifier for accessibility attributes The ID is generated once and persists across renders without changing This is useful for associating labels with form inputs and other accessibility needs
func GoUseIdGlobal ¶
func GoUseIdGlobal() string
GoUseIdGlobal wraps GoUseId on non-browser targets.
func GoUseLayoutEffect ¶
func GoUseLayoutEffect(parseEffect func() func(), parseDeps ...any)
GoUseLayoutEffect registers a layout effect (G36): it runs synchronously after DOM mutation, before the browser paints, and before this fiber's passive effects. Use it for post-render DOM reads/writes that must be observed before paint — focusing a freshly mounted element, measuring layout, scrolling — so they need no setTimeout/rAF guess. Same (effect, deps...) contract as GoUseEffect.
func GoUseLayoutEffectGlobal ¶
func GoUseLayoutEffectGlobal(parseEffectFn func() func(), parseEffectDeps ...any)
GoUseLayoutEffectGlobal wraps GoUseLayoutEffect on non-browser targets (G36).
func GoUseMemoFor ¶ added in v4.2.0
GoUseMemoFor memoizes one typed computation without the func()-any adapter closure the untyped entry point forces on generic callers: the compute function passes through unwrapped, and the hot-reload type coercion target comes from the type parameter (reflect only runs on the restore path).
func GoUseMemoGlobal ¶
GoUseMemoGlobal wraps GoUseMemo on non-browser targets.
func GoUseMemoGlobalTyped ¶
func GoUseMemoGlobalTyped(parseMemoCompute func() any, parseMemoTargetType reflect.Type, parseMemoDeps ...any) any
GoUseMemoGlobalTyped wraps GoUseMemoTyped on non-browser targets.
func GoUseMemoOf ¶ added in v4.2.0
func GoUseMemoOf[T any, D comparable](parseCompute func(D) T, parseDep D) T
GoUseMemoOf memoizes one computation keyed by a single comparable dependency with zero steady-state allocations: the compute function receives the dependency (so it can be a static, non-capturing func), the unchanged-dep check type-asserts the stored box instead of boxing the new value, and the cached result is returned by assertion. It shares the memo slot machinery (and hook signature) with GoUseMemo, so the two may not be swapped for one another between renders of one component.
func GoUseMemoTyped ¶
GoUseMemoTyped memoizes expensive computations and coerces restored hot reload values to the caller's expected type when possible.
func GoUseState ¶
GoUseState provides state management for components
func GoUseStateGlobal ¶
GoUseStateGlobal wraps GoUseState with the global runtime on non-browser targets.
func GuardCallback ¶
GuardCallback wraps fn with panic containment for host-callback boundaries (js.FuncOf bodies, timer callbacks, observer callbacks). The returned function never lets a panic escape into the host bridge.
func InitGlobalRuntime ¶
func InitGlobalRuntime(parseConfig Config)
InitGlobalRuntime initializes or upgrades the global runtime with specific adapters.
func InputTypeProps ¶
InputTypeProps returns a props map with the given input type.
func IsCurrentFiberTransitionUpdate ¶
func IsCurrentFiberTransitionUpdate() bool
IsCurrentFiberTransitionUpdate reports whether the current fiber render originated from deferred transition work.
func IsDOMNodeNull ¶
IsDOMNodeNull reports whether a DOMNode is absent, whether that absence is represented as a nil interface or one explicit null-node wrapper.
func IsSameDOMNode ¶
IsSameDOMNode reports whether two DOMNode values reference the same platform node, treating all null-node representations as equivalent.
func NormalizeHotReloadValue ¶
NormalizeHotReloadValue exposes the hot-reload value normalizer for bridge code that receives JSON-decoded snapshots.
func OnFirstCommit ¶
func OnFirstCommit(parseFn func())
OnFirstCommit registers fn to run once, immediately after the first commit. If the first commit has already happened, fn runs synchronously now. A nil fn is ignored.
func PlaceholderProps ¶
PlaceholderProps returns a props map with the given placeholder text.
func PlainTextContent ¶ added in v4.1.0
PlainTextContent reports the text carried by one plain text node (as built by ui.Text / html.Text — no props, no key), so construction sugar can route single text children through the direct-text fast path without allocating a child slice.
func ProcessUIQueue ¶
func ProcessUIQueue()
ProcessUIQueue runs pending UI updates until the queue is empty.
func RecordStartupBootstrapRead ¶
RecordStartupBootstrapRead stores bootstrap read or decode timing and emits a profiling timeline event.
func RecordStartupRouteContext ¶
func RecordStartupRouteContext(parseRoutePath string)
RecordStartupRouteContext captures which route family the active startup flow is targeting so first-interaction budgets can be attributed correctly.
func RecoverContainedPanic ¶
RecoverContainedPanic is the deferred form of ContainPanic: place `defer runtime.RecoverContainedPanic(source, subject)` at the top of any goroutine or host callback that must never crash the program.
func RefreshElementHostProps ¶
func RefreshElementHostProps(parseElem *Element)
RefreshElementHostProps rebuilds one element's cached host-prop view after post-creation prop mutation. Typed fast-lane elements materialize their props map first, so a refresh never drops attributes that only lived in the compact slice.
func RenderDetached ¶
RenderDetached renders parseElement into the DOM container at parseSelector using a runtime INDEPENDENT of the global app runtime. Agent-injected or agent-mounted content therefore renders into its own root and can never clobber the app's single currentRoot (which a plain RenderTo into a second container would). Each selector gets its own isolated runtime, reused across calls, sharing the global runtime's DOM/event adapters and scheduler so the detached tree renders into the same live browser. A nil element clears the container.
func RenderToStream ¶
func RenderToStream(parseCtx context.Context, parseWriter io.Writer, parseElement *Element, parseOptions SSRStreamOptions) (parseErr error)
RenderToStream writes an SSR shell immediately and then flushes async boundary replacement chunks as their render-time suspensions resolve.
func RenderToString ¶
RenderToString renders a virtual element tree to HTML.
This is the first internal SSR slice: it supports host elements, text nodes, fragments, and simple function components that return *Element. Hydration and browser bootstrap are intentionally out of scope here.
func ReportDiagnostic ¶
func ReportDiagnostic(parseSource string, parseSeverity DiagnosticSeverity, parseMessage string)
ReportDiagnostic records or increments a runtime diagnostic entry.
func ReportDiagnosticWithContext ¶
func ReportDiagnosticWithContext(parseSource string, parseSeverity DiagnosticSeverity, parseMessage string, parsePath string, parseComponentStack []string)
ReportDiagnosticWithContext records or increments a runtime diagnostic entry and optionally attaches fiber-path context for devtools and debugging.
func ReportLogWithFields ¶
func ReportLogWithFields(parseDomain string, parseLevel LogLevel, parseClassification DiagnosticClassification, parseMessage string, parseCorrelationID string, parseFields map[string]string)
ReportLogWithFields records one structured framework log entry with optional correlation id and fields.
func ReportProfilingEvent ¶
func ReportProfilingEvent(parseDomain string, parseName string, parsePhase string, parseTarget string, parseDurationNs int64, parseFields map[string]string)
ReportProfilingEvent records a profiling timeline entry on the global runtime.
func ReportUnhandledPanicContext ¶
func ReportUnhandledPanicContext(parseSource string, parsePhase PanicPhase, parseSubject string, parsePath string, parseComponentStack []string, parseRecovered any) string
ReportUnhandledPanicContext is a core package helper.
func ResetFirstCommitHooksForTest ¶
func ResetFirstCommitHooksForTest()
ResetFirstCommitHooksForTest restores the pre-commit state. Test-only.
func ResetWASMArtifactMetadata ¶
func ResetWASMArtifactMetadata()
ResetWASMArtifactMetadata clears the current emitted artifact metadata.
func ResetWASMStackFrameMapper ¶
func ResetWASMStackFrameMapper()
ResetWASMStackFrameMapper clears the current wasm stack-frame mapper.
func SafeGo ¶
SafeGo starts fn on a new goroutine with panic containment. A panic inside fn is reported to the console (agent-readable, with stack buckets) and the goroutine ends; the program and the committed UI keep running.
func SanitizeURLAttributeValue ¶
SanitizeURLAttributeValue neutralizes a script-executing scheme (javascript: or vbscript:) in the value of a URL-bearing attribute such as href/src/action. Non-URL attributes and safe schemes (http(s), data, mailto, relative, fragment) are returned unchanged. It is shared by the SSR serializer and the browser DOM adapter so both render paths block the identical XSS vector at the point a value reaches the document.
func SetAgentState ¶
SetAgentState resolves parseRef, validates parseHookSlot against the fiber's recorded hook signature, writes the matching state hook's current and pending slots, and schedules the same owned-fiber update path used by GoUseState.
func SetCurrentFiber ¶
func SetCurrentFiber(parseFiber *Fiber)
SetCurrentFiber sets the current fiber (used during component rendering)
func SetWASMArtifactMetadata ¶
func SetWASMArtifactMetadata(parseArtifactMeta WASMArtifactMetadata)
SetWASMArtifactMetadata stores the current emitted artifact metadata for panic correlation.
func SetWASMStackFrameMapper ¶
func SetWASMStackFrameMapper(parseFrameMapper WASMStackFrameMapper)
SetWASMStackFrameMapper installs the current wasm stack-frame mapper.
func StoreStartupCostAttribution ¶
func StoreStartupCostAttribution(storeAttribution StartupCostAttribution)
StoreStartupCostAttribution stores startup-cost attribution values.
func StyleProps ¶
StyleProps returns a props map with the given inline style string.
func SuspendUntil ¶
func SuspendUntil(parseDone <-chan struct{}, parseReason string)
SuspendUntil interrupts the current render until done closes.
func ValueProps ¶
ValueProps returns a props map with the given value.
Types ¶
type ActionablePanicOptions ¶
type AgentDeleteAtomResult ¶
AgentDeleteAtomResult describes the outcome of DeleteAgentAtom.
func DeleteAgentAtom ¶
func DeleteAgentAtom(parseRt *Runtime, parseID string, parseForce bool) (AgentDeleteAtomResult, error)
DeleteAgentAtom deletes one atom from the registry. When live subscribers exist and parseForce is false, it fails closed and reports their refs.
type AgentDetachedRoot ¶
type AgentDetachedRoot struct {
// Selector is the container the tree was rendered into.
Selector string `json:"selector"`
// Root is the budgeted, redacted fiber tree for the detached runtime. Refs
// within it are relative to this detached root, scoped to Selector.
Root *AgentNodeSnapshot `json:"root,omitempty"`
}
AgentDetachedRoot is one isolated, agent-injected tree (e.g. from bridge.render-tree / bridge.mount) and the selector it was rendered into.
type AgentHookPreview ¶
type AgentHookPreview struct {
// Slot is the hook slot index.
Slot int `json:"slot"`
// Kind is the hook kind string (state, memo, ref, effect, …).
Kind string `json:"kind"`
// Value is the preview string; "[redacted]" when a redaction policy is active.
Value string `json:"value"`
}
AgentHookPreview is a JSON-serializable hook value preview produced by BuildAgentSnapshot. It reuses the string previews from inspectHooks.
type AgentNodeSnapshot ¶
type AgentNodeSnapshot struct {
// Name is the component or element name from describeFiber.
Name string `json:"name"`
// Kind is "component", "host", "text", "root", etc. from describeFiber.
Kind string `json:"kind"`
// Text is the full rendered text content for text nodes (empty otherwise),
// redacted to "[redacted]" when a redaction policy is active. This lets a
// reader recover the actual rendered copy, not just the node structure.
Text string `json:"text,omitempty"`
// AgentRef is the stable agent ref for this node; empty on the root fiber.
AgentRef string `json:"agentRef,omitempty"`
// HookCount is the number of hook slots on this fiber.
HookCount int `json:"hookCount"`
// Dirty reports whether this fiber has pending updates.
Dirty bool `json:"dirty,omitempty"`
// NeedsUpdate reports whether an ancestor queued an update for this fiber.
NeedsUpdate bool `json:"needsUpdate,omitempty"`
// Hooks carries hook value previews; values are redacted when a panic-report
// redaction policy is active (fail-closed: any configured policy silences
// hook values).
Hooks []AgentHookPreview `json:"hooks,omitempty"`
// Children is the (possibly truncated) list of child nodes in tree order.
Children []AgentNodeSnapshot `json:"children,omitempty"`
}
AgentNodeSnapshot is a JSON-serializable summary of one fiber node built by BuildAgentSnapshot. It carries the component name, kind, stable agent ref, hook count, dirty flags, hook value previews, and a children slice. Nodes beyond the depth or node budget are omitted and counted in the parent AgentSnapshot's TruncatedNodes field.
type AgentQueryMatch ¶
type AgentQueryMatch struct {
// AgentRef is the stable agent ref for the matched node.
AgentRef string `json:"agentRef"`
// Name is the component or element name.
Name string `json:"name"`
// Kind is "component", "host", "text", "root", etc.
Kind string `json:"kind"`
// Tag is the host element tag; empty for non-host nodes.
Tag string `json:"tag,omitempty"`
}
AgentQueryMatch describes one node returned by QueryAgentNodes.
func QueryAgentNodes ¶
func QueryAgentNodes(parseRt *Runtime, parseSel AgentQuerySelector) []AgentQueryMatch
QueryAgentNodes walks the live fiber tree under schedulerMu and returns all fibers that match the selector in tree (pre-order) order. It mirrors the testkit ByRole/ByLabel/ByText/ByID/AllByTag semantics:
- Role: derived from the host element tag via the same implicit role mapping as testkit (button→button, a[href]→link, input[type=*]→…, etc.) and from the "role" or "aria-role" prop (checked first); comparison is case-insensitive after normalisation.
- Label: matched against the "aria-label" prop as a case-insensitive substring.
- Text: matched against the concatenated textContent of the fiber subtree as a case-insensitive substring (same depth-first concatenation as testkit nodeText).
- ID: matched against the "id" prop exactly (case-sensitive).
- Tag: matched against the host element tag case-insensitively.
When multiple selector fields are set, all must match (logical AND). An empty selector returns all non-root fibers. A nil or empty runtime returns an empty slice, never an error.
type AgentQuerySelector ¶
type AgentQuerySelector struct {
// Role matches the computed ARIA role derived from the element tag or the
// "role" / "aria-role" prop (case-insensitive, same mapping as testkit
// ByRole).
Role string
// Label matches the accessible label from "aria-label" prop (substring,
// case-insensitive). When Role is also set, only nodes that have both the
// correct role AND a matching label are returned.
Label string
// Text matches the concatenated text content of the fiber subtree
// (substring, case-insensitive), the same text that testkit ByText uses.
Text string
// ID matches the "id" prop exactly (case-sensitive, same rule as testkit
// ByID).
ID string
// Tag matches the host element tag (case-insensitive), same rule as testkit
// AllByTag.
Tag string
}
AgentQuerySelector carries the optional selector fields recognised by QueryAgentNodes. All fields are optional; a match requires every non-empty field to match.
type AgentSnapshot ¶
type AgentSnapshot struct {
// Root is the budgeted, redacted fiber tree starting from the runtime root.
Root *AgentNodeSnapshot `json:"root,omitempty"`
// TruncatedNodes is the count of nodes omitted to satisfy the depth or node
// budget; zero when the full tree fit within the budget.
TruncatedNodes int `json:"truncatedNodes,omitempty"`
// BudgetApplied is true whenever either budget (maxDepth or maxNodes) was
// reached and at least one node was omitted. Callers must check this field
// rather than inferring truncation from the shape of Root.
BudgetApplied bool `json:"budgetApplied,omitempty"`
// Detached carries the trees rendered into separate containers via
// RenderDetached (agent-injected/mounted content), keyed by their selector.
// These live in their own isolated runtimes, so they are NOT part of Root;
// including them here lets an agent read injected content it cannot
// otherwise see in the global tree.
Detached []AgentDetachedRoot `json:"detached,omitempty"`
}
AgentSnapshot is the top-level result returned by BuildAgentSnapshot.
func BuildAgentSnapshot ¶
func BuildAgentSnapshot(parseRt *Runtime, parseMaxDepth int, parseMaxNodes int) AgentSnapshot
BuildAgentSnapshot wraps the full Inspect() output into a JSON-serializable tree (AgentSnapshot) that is safe to send over the agent bridge wire. It enforces a depth budget (parseMaxDepth, 0 = unlimited) and a node-count budget (parseMaxNodes, 0 = unlimited). Whenever either budget is reached the result carries explicit truncation metadata in TruncatedNodes and BudgetApplied – truncation is never silent. Hook value previews are redacted when a PanicReportRedactionPolicy is configured (fail-closed: presence of any policy silences hook values to "[redacted]" rather than risk leaking sensitive data).
The panic-report redaction hook (ConfigurePanicReportRedaction) is the runtime-local redaction mechanism used here because the telemetry redaction policy in internal/telemetryredaction is package-inaccessible from internal/runtime (it would create an import cycle through logging/). Using the panic-report state is therefore the documented pattern for runtime-local redaction, not a workaround.
type AsyncBoundaryElementType ¶
type AsyncBoundaryElementType struct{}
AsyncBoundaryElementType marks a subtree that can recover render-time suspensions by rendering fallback content until the suspended work resolves.
type AtomRegistry ¶
type AtomRegistry struct {
// contains filtered or unexported fields
}
AtomRegistry manages global state atoms with fine-grained reactivity. Each atom has a unique ID and tracks which fibers are subscribed to it.
func NewAtomRegistry ¶
func NewAtomRegistry() *AtomRegistry
NewAtomRegistry creates a new atom registry.
func (*AtomRegistry) GetAtom ¶
func (parseAr *AtomRegistry) GetAtom(parseId string) (any, bool)
GetAtom retrieves an atom's current value.
func (*AtomRegistry) GetAtomCount ¶
func (parseAr *AtomRegistry) GetAtomCount() int
GetAtomCount returns the total number of atoms.
func (*AtomRegistry) GetSubscriberCount ¶
func (parseAr *AtomRegistry) GetSubscriberCount(parseAtomID string) int
GetSubscriberCount returns the number of fibers subscribed to an atom.
func (*AtomRegistry) GetSubscriberTotal ¶
func (parseAr *AtomRegistry) GetSubscriberTotal() int
GetSubscriberTotal returns the total number of atom subscriptions across all atoms.
func (*AtomRegistry) InitAtom ¶
func (parseAr *AtomRegistry) InitAtom(parseId string, parseInitialValue any)
InitAtom initializes an atom if it doesn't exist.
func (*AtomRegistry) MoveSubscription ¶
func (parseAr *AtomRegistry) MoveSubscription(parseAtomID string, parseFrom *Fiber, parseTo *Fiber)
MoveSubscription transfers a fiber's ownership for a single atom subscription.
func (*AtomRegistry) MoveSubscriptions ¶
func (parseAr *AtomRegistry) MoveSubscriptions(parseAtomIDs []string, parseFrom *Fiber, parseTo *Fiber)
MoveSubscriptions transfers a fiber's ownership across several atom subscriptions under one lock.
func (*AtomRegistry) RegisterDerivedAtom ¶
func (parseAr *AtomRegistry) RegisterDerivedAtom(parseId string, parseDeps []string, parseCompute func() any) error
RegisterDerivedAtom registers or replaces a derived atom and computes its current value.
func (*AtomRegistry) RestoreSnapshot ¶
func (parseAr *AtomRegistry) RestoreSnapshot(parseSnapshot map[string]any) []*Fiber
RestoreSnapshot merges atom values from snapshot and returns subscribed fibers that should be notified about the updates.
func (*AtomRegistry) SetAtom ¶
func (parseAr *AtomRegistry) SetAtom(parseId string, parseValue any) []*Fiber
SetAtom updates an atom's value and returns subscribed fibers.
func (*AtomRegistry) Snapshot ¶
func (parseAr *AtomRegistry) Snapshot() map[string]any
Snapshot returns a shallow copy of all atom values currently stored.
func (*AtomRegistry) Subscribe ¶
func (parseAr *AtomRegistry) Subscribe(parseAtomID string, parseFiber *Fiber)
Subscribe adds a fiber to an atom's subscription list.
func (*AtomRegistry) Unsubscribe ¶
func (parseAr *AtomRegistry) Unsubscribe(parseAtomID string, parseFiber *Fiber)
Unsubscribe removes a fiber from an atom's subscription list.
func (*AtomRegistry) UnsubscribeFiberFromAll ¶
func (parseAr *AtomRegistry) UnsubscribeFiberFromAll(parseFiber *Fiber)
UnsubscribeFiberFromAll removes a fiber from all atom subscriptions.
func (*AtomRegistry) UnsubscribeMany ¶
func (parseAr *AtomRegistry) UnsubscribeMany(parseAtomIDs []string, parseFiber *Fiber)
UnsubscribeMany removes a fiber from several atom subscriptions under one lock.
type Blurrer ¶
type Blurrer interface {
Blur()
}
Blurrer / Clicker / ScrollIntoViewer are the optional capabilities a DOMNode may implement for the remaining common imperative-handle operations, mirroring Focuser. The wasm node implements all three; ui.DOMRef.Blur/Click/ScrollIntoView route through them so they work cross-build (no-op when the node — or the build — does not support the operation).
type BrowserState ¶
type BrowserState interface {
// History
PushState(state any, title, url string)
ReplaceState(state any, title, url string)
GetCurrentPath() string
OnPopState(callback func(path string))
// Storage
SetItem(key, value string) error
GetItem(key string) (string, bool)
RemoveItem(key string)
// Location
GetHash() string
SetHash(hash string)
Reload()
}
BrowserState abstracts browser state APIs.
type ComponentRenderTraceSnapshot ¶
type ComponentRenderTraceSnapshot struct {
Name string
Path string
RenderCount int
RerenderCount int
LastTrigger string
LastRenderDurationNs int64
TotalRenderDurationNs int64
AverageRenderDurationNs int64
LastRenderedAt string
TriggerCounts map[string]int
}
ComponentRenderTraceSnapshot captures per-component render activity.
type ComponentSignature ¶
type ComponentSignature struct {
Kind string
Name string
QualifiedName string
Key string
HookKinds []string
}
ComponentSignature captures the dev-time identity and hook shape of a component.
func (ComponentSignature) CompatibleWith ¶
func (parseSignature ComponentSignature) CompatibleWith(parseOther ComponentSignature) bool
CompatibleWith reports whether two component signatures can safely preserve state.
func (ComponentSignature) Summary ¶
func (parseSignature ComponentSignature) Summary() string
Summary renders a compact human-readable description of the signature.
type ComponentType ¶
type ComponentType struct {
ID string
Name string
QualifiedName string
// contains filtered or unexported fields
}
ComponentType provides a stable runtime-recognized component handle that can carry logical identity separately from the current callable implementation.
func NewComponentType ¶
func NewComponentType(parseComponentID string, parseComponentName string, parseComponentQualifiedName string, parseComponentImplementation any, render func(any, map[string]any) *Element) *ComponentType
NewComponentType constructs a component handle recognized by the runtime.
func (*ComponentType) IdentityKey ¶
func (parseComponentType *ComponentType) IdentityKey() string
IdentityKey returns the logical identity used to compare component handles.
func (*ComponentType) ImplementationMatches ¶ added in v4.1.0
func (parseComponentType *ComponentType) ImplementationMatches(parseComponentImplementation any) bool
ImplementationMatches reports whether the handle's current implementation is the very same function value (code pointer and closure data). Hot-swap callers use it to skip rebuilding an identical renderer on every element creation; a recreated closure (fresh captures, same code) does not match, so hot-reload and inline-component swaps still take the update path.
func (*ComponentType) Render ¶
func (parseComponentType *ComponentType) Render(parseComponentProps map[string]any) *Element
Render invokes the current implementation attached to the component handle.
func (*ComponentType) SetImplementation ¶
func (parseComponentType *ComponentType) SetImplementation(parseComponentImplementation any)
SetImplementation updates the current implementation for a stable component handle.
func (*ComponentType) SetImplementationRenderer ¶
func (parseComponentType *ComponentType) SetImplementationRenderer(parseComponentImplementation any, parseRender func(any, map[string]any) *Element)
SetImplementationRenderer updates the current implementation and, when provided, swaps in one matching renderer.
type Config ¶
type Config struct {
DOMAdapter DOMAdapter
EventAdapter EventAdapter
Scheduler Scheduler
BrowserState BrowserState
Reset bool
// HideRawPanicOutput is deprecated: crash containment (structured report,
// no raw rethrow) is now the default. Use ShowRawPanicOutput to opt back
// into re-panicking with the raw Go panic output.
HideRawPanicOutput bool
// ShowRawPanicOutput re-throws contained panics with their raw output
// after the structured report. In wasm this kills the page; only enable
// it for debugging native test runs.
ShowRawPanicOutput bool
OnUnhandledPanicReport func(PanicReport)
StrictMode StrictModeOptions
Limits RuntimeLimits
}
Config holds runtime adapter configuration.
type ContextDescriptor ¶
ContextDescriptor identifies a context value stream within a component tree.
func NewContextDescriptor ¶
func NewContextDescriptor(parseDefaultValue any) *ContextDescriptor
NewContextDescriptor creates a new context descriptor with a unique runtime ID.
type ContextProviderType ¶
type ContextProviderType struct {
Descriptor *ContextDescriptor
}
ContextProviderType marks provider elements in the runtime tree.
func NewContextProviderType ¶
func NewContextProviderType(parseDescriptor *ContextDescriptor) *ContextProviderType
NewContextProviderType creates a provider marker for the given descriptor.
type DOMAdapter ¶
type DOMAdapter interface {
// Element creation and manipulation
CreateElement(tag string) DOMNode
CreateTextNode(text string) DOMNode
SetAttribute(node DOMNode, name, value string)
RemoveAttribute(node DOMNode, name string)
SetProperty(node DOMNode, name string, value any)
GetProperty(node DOMNode, name string) any
// Tree manipulation
AppendChild(parent, child DOMNode)
RemoveChild(parent, child DOMNode)
InsertBefore(parent, newNode, referenceNode DOMNode)
ReplaceChild(parent, newNode, oldNode DOMNode)
// Queries
GetParent(node DOMNode) DOMNode
GetChildren(node DOMNode) []DOMNode
GetFirstChild(node DOMNode) DOMNode
GetNextSibling(node DOMNode) DOMNode
// Text nodes
SetTextContent(node DOMNode, text string)
// Styling
SetStyle(node DOMNode, property, value string)
SetStyles(node DOMNode, styles map[string]string)
// Function wrapping
WrapFunction(fn any) any
}
DOMAdapter abstracts all DOM operations used by the runtime.
type DOMNode ¶
DOMNode is an opaque reference to a platform-specific DOM node.
Contract: - implementations must treat a nil receiver as null and return true from IsNull - nil interface values and explicit null-node wrappers are equivalent absence states - callers should prefer IsDOMNodeNull and IsSameDOMNode instead of open-coding mixed nil and IsNull checks
type DOMRefSink ¶
type DOMRefSink interface {
SetDOMNode(node DOMNode)
}
DOMRefSink receives the live DOM node when its element mounts and nil when the element unmounts. ui.UseDOMRef returns a handle implementing this; the runtime only ever calls SetDOMNode from the (single-threaded) commit phase.
type Diagnostic ¶
type Diagnostic struct {
Source string
Severity DiagnosticSeverity
Classification DiagnosticClassification
Code string
Docs string
Remediation string
Recoverable bool
TopFrame string
Consequence string
Message string
Count int
Path string
ComponentStack []string
Fields map[string]string
}
Diagnostic describes one deduplicated runtime diagnostic entry.
func GetDiagnostics ¶
func GetDiagnostics() []Diagnostic
GetDiagnostics returns a copy of the current diagnostic list. The entries are value copies; their ComponentStack slices and Fields maps are shared with the store, which never mutates them after insert — treat them as read-only. (Deep-cloning them per read dominated the cost of devtools inspection snapshots.)
type DiagnosticClassification ¶
type DiagnosticClassification string
const ( DiagnosticInformational DiagnosticClassification = "informational" DiagnosticCorrectness DiagnosticClassification = "correctness" DiagnosticPerformance DiagnosticClassification = "performance" DiagnosticRecovered DiagnosticClassification = "recovered" DiagnosticUnsupportedRecover DiagnosticClassification = "unsupported_recovered" )
type DiagnosticSeverity ¶
type DiagnosticSeverity string
const ( DiagnosticInfo DiagnosticSeverity = "info" DiagnosticWarning DiagnosticSeverity = "warning" DiagnosticError DiagnosticSeverity = "error" )
type Effect ¶
type Effect struct {
Fn func() func()
CleanupIndex int
// Layout marks an effect that must run synchronously after DOM mutation but
// before the browser paints, and before this fiber's passive effects (G36 /
// UseLayoutEffect). Passive effects (UseEffect) leave it false.
Layout bool
}
Effect represents a side effect to be run after render.
type Element ¶
type Element struct {
Type any
Props map[string]any
Children []any
// Key carries the reconciliation key for elements built through the typed
// fast lane (html.Props). Map-built elements keep their key in Props; the
// key helpers consult this field first.
Key string
TextContent string // Optimization for TEXT_ELEMENT to avoid map allocation
// contains filtered or unexported fields
}
Element represents a virtual DOM node.
func Blockquote ¶
Blockquote creates a blockquote element.
func CreateElement ¶
CreateElement creates a new virtual DOM element.
func CreateElementCompactHostOwned ¶
func CreateElementCompactHostOwned(parseTag string, parseKey string, parseAttrs []HostAttr, parseChildren ...any) *Element
CreateElementCompactHostOwned creates one typed fast-lane host element from a reconciliation key and a caller-normalized, deterministic compact string-attribute view. Fast-lane elements carry no props map at all; cold readers materialize one on demand (see ensureElementProps).
func CreateElementCompactHostOwnedText ¶ added in v4.1.0
func CreateElementCompactHostOwnedText(parseTag string, parseKey string, parseAttrs []HostAttr, parseText string) *Element
CreateElementCompactHostOwnedText creates one typed fast-lane host element whose only child is plain text, skipping child-slice normalization entirely.
func CreateElementOwned ¶
CreateElementOwned creates a new virtual DOM element and takes ownership of the provided props map.
func DivWithComponents ¶
func DivWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
DivWithComponents creates a div element and renders component refs as children.
func Figcaption ¶
Figcaption creates a figcaption element.
func MainWithComponents ¶
func MainWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
MainWithComponents creates a main element and renders component refs as children.
func SectionWithComponents ¶
func SectionWithComponents(parseProps map[string]any, parseComponentRefs ...func(map[string]any) *Element) *Element
SectionWithComponents creates a section element and renders component refs as children.
type ErrorBoundaryType ¶
type ErrorBoundaryType struct{}
ErrorBoundaryType marks runtime-recognized error-boundary elements.
func NewErrorBoundaryType ¶
func NewErrorBoundaryType() *ErrorBoundaryType
NewErrorBoundaryType creates a marker type recognized by the runtime as an error boundary.
type Event ¶
type Event interface {
PreventDefault()
StopPropagation()
GetValue() string
GetTarget() DOMNode
GetKeyCode() int
GetKey() string
IsChecked() bool
}
Event abstracts platform-specific events.
type EventAdapter ¶
type EventAdapter interface {
AddEventListener(node DOMNode, eventType string, handler EventHandler)
RemoveEventListener(node DOMNode, eventType string, handler EventHandler)
CreateEventHandler(fn func(Event)) EventHandler
ReleaseEventHandler(handler EventHandler)
}
EventAdapter abstracts event handling.
type EventHandler ¶
type EventHandler interface {
Release()
}
EventHandler is an opaque reference to a platform-specific event handler.
type FetchState ¶
type FetchState struct {
Data any // The fetched data
Error string // Error message if fetch failed
Loading bool // Whether currently fetching
}
FetchState represents the state of a fetch operation.
type Fiber ¶
type Fiber struct {
// contains filtered or unexported fields
}
Fiber represents a unit of work in the virtual DOM tree.
func GetCurrentFiber ¶
func GetCurrentFiber() *Fiber
type FiberSnapshot ¶
type FiberSnapshot struct {
Name string
Path string
// AgentRef is the stable key/index-disambiguated ref the agent bridge
// resolves back to this node (empty on the root, which is not addressable).
AgentRef string
// Text is the full text content for text fibers (empty otherwise). Name
// only carries a short preview; Text lets a reader recover the rendered copy.
Text string
Kind string
Dirty bool
NeedsUpdate bool
FineGrained bool
ReactiveSource string
UpdateOrigin string
EffectCount int
HookCount int
Signature *ComponentSignature
RenderDurationNs int64
DiffDurationNs int64
CommitDurationNs int64
EffectDurationNs int64
CleanupDurationNs int64
SelfDurationNs int64
SubtreeDurationNs int64
Hooks []HookSnapshot
Children []FiberSnapshot
}
FiberSnapshot captures one inspected fiber subtree.
type FlamegraphFrameSnapshot ¶
type FlamegraphFrameSnapshot struct {
Name string
Kind string
Path string
Depth int
StartNs int64
DurationNs int64
SelfDurationNs int64
RenderDurationNs int64
DiffDurationNs int64
CommitDurationNs int64
EffectDurationNs int64
CleanupDurationNs int64
}
FlamegraphFrameSnapshot captures one nested flamegraph frame.
type Focuser ¶
type Focuser interface {
Focus()
}
Focuser is the optional capability a DOMNode may implement to move keyboard focus to itself. The wasm node implements it (element.focus()); ui.DOMRef.Focus and ui.UseAutoFocus route through it so they work cross-build (no-op when the node — or the build — does not support focusing).
type HookSnapshot ¶
HookSnapshot captures one hook entry from an inspected fiber.
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks manages component hook state for a fiber.
type HostMountSpec ¶
HostMountSpec stores one simple host mount description for one batched DOM append path.
type HotBranchSnapshot ¶
type HotBranchSnapshot struct {
Name string
Kind string
Path string
RenderDurationNs int64
DiffDurationNs int64
CommitDurationNs int64
EffectDurationNs int64
CleanupDurationNs int64
SelfDurationNs int64
SubtreeDurationNs int64
}
HotBranchSnapshot captures one high-cost subtree from profiling output.
type HotReloadComponentSnapshot ¶
type HotReloadComponentSnapshot struct {
Signature ComponentSignature `json:"signature"`
Path string `json:"path,omitempty"`
IdentityTrail []string `json:"identityTrail,omitempty"`
States []any `json:"states,omitempty"`
Memos []HotReloadMemoSnapshot `json:"memos,omitempty"`
Refs []any `json:"refs,omitempty"`
IDs []string `json:"ids,omitempty"`
Fetches []HotReloadFetchSnapshot `json:"fetches,omitempty"`
}
HotReloadComponentSnapshot stores the serializable hook slots for a single function component render in preorder traversal order.
type HotReloadFetchSnapshot ¶
type HotReloadFetchSnapshot struct {
URL string `json:"url"`
State FetchState `json:"state"`
}
HotReloadFetchSnapshot stores the serializable portion of a fetch hook.
type HotReloadMemoSnapshot ¶
HotReloadMemoSnapshot stores a memoized computation and its dependencies.
type HotReloadRestoreDecision ¶
HotReloadRestoreDecision reports whether selective restore was applied or the runtime fell back to the legacy full compatible restore path.
type HotReloadRestorePlan ¶
HotReloadRestorePlan controls whether hot-reload restore should preserve all compatible component snapshots or selectively drop changed subtrees.
type HotReloadSnapshot ¶
type HotReloadSnapshot struct {
Components []HotReloadComponentSnapshot `json:"components,omitempty"`
}
HotReloadSnapshot captures the component-local state that can be restored after a compatible hot reload.
type HydrationDebugSnapshot ¶
type HydrationMetrics ¶
type HydrationMetrics struct {
CorrelationID string
StartedAt time.Time
FinishedAt time.Time
Duration time.Duration
DurationNs int64
ExistingDOMNodeCount int
FallbackCount int
MismatchCount int
DiscardedNodeCount int
Strict bool
Failed bool
Failure string
}
HydrationMetrics summarizes one hydration pass for observability hooks.
type InspectionSnapshot ¶
type InspectionSnapshot struct {
Root *FiberSnapshot
Stats InspectionStats
Profiling ProfilingSnapshot
Hydration HydrationDebugSnapshot
Diagnostics []Diagnostic
Logs []LogEntry
}
InspectionSnapshot is the top-level runtime inspection payload.
type InspectionStats ¶
type InspectionStats struct {
TotalFibers int
DirtyFibers int
ComponentFibers int
HostFibers int
TextFibers int
FineGrainedFibers int
HookEntries int
Effects int
}
InspectionStats summarizes the inspected runtime tree.
type InternalStateSnapshot ¶
type InternalStateSnapshot struct {
FiberCount int
AtomCount int
AtomSubscriberCount int
PendingEffectFibers int
UIQueueSize int
DiagnosticCount int
LogCount int
ProfilingEventCount int
SchedulerBackpressure bool
}
InternalStateSnapshot captures bounded runtime state useful for long-session monitoring.
type LogEntry ¶
type LogEntry struct {
Domain string
Level LogLevel
Classification DiagnosticClassification
Code string
Docs string
Remediation string
Recoverable bool
TopFrame string
Consequence string
Message string
Timestamp string
CorrelationID string
Fields map[string]string
}
LogEntry describes one recent structured framework log.
type MemoryHygieneOptions ¶
type MemoryHygieneOptions struct {
MaxHeapAllocBytes uint64
MaxHeapObjects uint64
MaxFiberCount int
MaxAtomCount int
MaxSubscriberCount int
}
MemoryHygieneOptions configures leak and GC-pressure diagnostics.
type MemoryHygieneSnapshot ¶
type MemoryHygieneSnapshot struct {
HeapAllocBytes uint64
HeapObjects uint64
Internal InternalStateSnapshot
Diagnostics []string
}
MemoryHygieneSnapshot reports memory and internal-state pressure.
type PanicLoggingOptions ¶
type PanicLoggingOptions struct {
HideRawPanicOutput bool
OnReport func(PanicReport)
}
func CurrentUnhandledPanicLoggingOptions ¶
func CurrentUnhandledPanicLoggingOptions() PanicLoggingOptions
CurrentUnhandledPanicLoggingOptions returns a snapshot of the current panic logging configuration.
type PanicPhase ¶
type PanicPhase string
const ( PanicPhaseRender PanicPhase = "render" PanicPhaseEffect PanicPhase = "effect" PanicPhaseCleanup PanicPhase = "cleanup" PanicPhaseEvent PanicPhase = "event" PanicPhaseLoader PanicPhase = "loader" PanicPhaseHydration PanicPhase = "hydration" PanicPhaseStartup PanicPhase = "startup" PanicPhaseDeferred PanicPhase = "deferred" PanicPhaseSSR PanicPhase = "ssr" PanicPhaseAsync PanicPhase = "async" )
type PanicReport ¶
type PanicReport struct {
Source string
Phase PanicPhase
Subject string
Where string
Path string
ComponentStack []string
Summary string
Code string
Docs string
Remediation string
Consequence string
TopFrame string
AppFrames []string
FrameworkFrames []string
PlatformFrames []string
Artifact WASMArtifactMetadata
Formatted string
}
PanicReport describes one wrapped framework-owned fatal panic report.
type PanicReportRedactionPolicy ¶
type PanicReportRedactionPolicy struct {
Fields []string
Redact func(PanicReportRedactionContext) (any, error)
}
func CurrentPanicReportRedaction ¶
func CurrentPanicReportRedaction() PanicReportRedactionPolicy
CurrentPanicReportRedaction returns the active runtime-local panic report redaction policy.
type PassiveEventHandler ¶
type PassiveEventHandler struct {
Handler any
}
PassiveEventHandler marks an event handler that should be attached with passive listener options when the DOM adapter supports listener binding.
type PortalElementType ¶
type PortalElementType struct{}
PortalElementType marks a subtree whose committed DOM children should render into a separate target container.
type ProfilingEvent ¶
type ProfilingEvent struct {
Domain string
Name string
Phase string
Target string
CorrelationID string
DurationNs int64
Timestamp string
Fields map[string]string
}
ProfilingEvent captures one structured profiling timeline entry.
type ProfilingPhaseTotalsSnapshot ¶
type ProfilingPhaseTotalsSnapshot struct {
RenderDurationNs int64
DiffDurationNs int64
CommitDurationNs int64
EffectDurationNs int64
CleanupDurationNs int64
}
ProfilingPhaseTotalsSnapshot summarizes attributed phase time totals.
type ProfilingSnapshot ¶
type ProfilingSnapshot struct {
RenderCalls int
ScheduledRootUpdates int
ScheduledFiberMarks int
ScheduledGranularMarks int
WorkLoopPasses int
ProcessedUnits int
CommitCount int
FineGrainedCommits int
FineGrainedDescendantHostCommits int
FineGrainedDescendantTextCommits int
EffectExecutions int
CleanupExecutions int
LastRenderDurationNs int64
LastCommitDurationNs int64
LastEffectDurationNs int64
LastCleanupDurationNs int64
PhaseTotals ProfilingPhaseTotalsSnapshot
ComponentRenders []ComponentRenderTraceSnapshot
RecentEvents []ProfilingEvent
FlamegraphFrames []FlamegraphFrameSnapshot
Startup StartupProfilingSnapshot
HotBranches []HotBranchSnapshot
}
ProfilingSnapshot summarizes runtime profiling counters and hot branches.
type ReactiveRegionElementType ¶
type ReactiveRegionElementType struct{}
ReactiveRegionElementType marks a subscribed fine-grained region that can rerender its own child subtree without rerendering the owning component.
type ReactiveTextElementType ¶
type ReactiveTextElementType struct{}
ReactiveTextElementType marks a text node that can update from an explicit atom-backed subscription without rerendering the owning component.
type RefValue ¶
type RefValue struct {
Current any
}
RefValue represents a reference object that persists across renders.
type ReplayEvent ¶
ReplayEvent captures one deterministic scheduling event.
type RouteStartupBudgetSnapshot ¶
type RouteStartupBudgetSnapshot struct {
RouteFamily string
LastRoutePath string
SampleCount int
AverageBootstrapReadDurationNs int64
AverageWASMTransferBytes int64
AverageWASMDecodedBytes int64
AverageBootstrapDecodedBytes int64
AverageCacheWarmupDurationNs int64
AverageServiceWorkerOverheadNs int64
AverageInitialRouteDataBytes int64
AverageHydrationDurationNs int64
AverageStartupCommitDurationNs int64
AverageFirstInteractionDurationNs int64
}
RouteStartupBudgetSnapshot captures startup budget samples grouped by route family.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime represents the reconciliation and rendering engine.
func GetGlobalRuntime ¶
func GetGlobalRuntime() *Runtime
GetGlobalRuntime returns the global Runtime instance, creating it if needed. For WASM builds, this can be upgraded later by InitGlobalRuntime.
func NewRuntime ¶
NewRuntime creates a new runtime instance.
func (*Runtime) AdvanceAgentStateVersion ¶
AdvanceAgentStateVersion increments and returns the bridge-visible runtime state version. Agent write commands call this after a successful mutation or side-effect dispatch; commitRoot also advances it after a DOM commit.
func (*Runtime) AgentStateVersion ¶
AgentStateVersion returns the monotonic runtime version exposed by the live agent bridge. It advances on commits and on bridge-visible write commands so command acks can preserve read-your-writes ordering without inspecting DOM timing internals.
func (*Runtime) BeginReplayCapture ¶
func (parseRt *Runtime) BeginReplayCapture()
BeginReplayCapture is a compatibility alias for StartReplayRecording.
func (*Runtime) BeginStartupProfiling ¶
BeginStartupProfiling marks the beginning of a startup workflow when one has not already been started for the current runtime.
func (*Runtime) CaptureHotReloadSnapshot ¶
func (parseRt *Runtime) CaptureHotReloadSnapshot() HotReloadSnapshot
CaptureHotReloadSnapshot is an internal hot-reload helper.
func (*Runtime) CheckMemoryHygiene ¶
func (parseRt *Runtime) CheckMemoryHygiene(parseOptions MemoryHygieneOptions) MemoryHygieneSnapshot
CheckMemoryHygiene samples Go memory stats and reports configured long-session pressure diagnostics.
func (*Runtime) CleanupAtomSubscriptions ¶
CleanupAtomSubscriptions removes all atom subscriptions for a fiber This should be called when a fiber is being removed from the tree
func (*Runtime) ClearProfiling ¶
func (parseRt *Runtime) ClearProfiling()
ClearProfiling resets collected profiling counters and timeline events.
func (*Runtime) EndReplayCapture ¶
func (parseRt *Runtime) EndReplayCapture() []ReplayEvent
EndReplayCapture is a compatibility alias for StopReplayRecording.
func (*Runtime) FindNodesWithAttributeInSelector ¶
func (parseRt *Runtime) FindNodesWithAttributeInSelector(parseSelector string, parseName string) []DOMNode
FindNodesWithAttributeInSelector collects descendant DOM nodes under one selector-matched container that carry the requested attribute.
func (*Runtime) FindNodesWithAttributeInTarget ¶
FindNodesWithAttributeInTarget collects descendant DOM nodes under one resolved target that carry the requested attribute.
func (*Runtime) FlushScheduledDiscreteWork ¶ added in v4.1.0
func (parseRt *Runtime) FlushScheduledDiscreteWork()
FlushScheduledDiscreteWork synchronously runs a freshly scheduled, not yet started render pass. The DOM event bridge calls it after a component event handler returns, so a discrete user action commits inside its own task (React-style sync discrete flush) instead of waiting out the setTimeout(0) kick — while state writes from goroutines the handler spawned still land in a follow-up pass exactly as they would have with the macrotask hop. The already-queued kick later finds no pending work and no-ops. It refuses to run when any work loop is active on this stack (a handler fired synchronously by a commit-phase DOM write) or when the pass has already consumed work slices.
func (*Runtime) GetAtomValue ¶
GetAtomValue is a helper to get an atom value directly (for debugging/testing)
func (*Runtime) GetAttributeValue ¶
GetAttributeValue reports one attribute value from one DOM node when the active adapter exposes attribute reads.
func (*Runtime) GetTagName ¶
GetTagName reports one normalized lower-case tag name from one DOM node when the active adapter exposes host tag reads.
func (*Runtime) HasPendingHotReloadSnapshot ¶
HasPendingHotReloadSnapshot is an internal hot-reload helper.
func (*Runtime) HydrateInto ¶
HydrateInto hydrates an element tree into an explicit DOM node.
func (*Runtime) HydrateTo ¶
HydrateTo renders into a selector while preserving a dedicated hydration path. It attempts to reuse matching DOM, restores bootstrap state before resume via the public ui layer, and falls back per subtree if hydration cannot continue.
func (*Runtime) InitAtomValue ¶
InitAtomValue seeds an atom with value only if it has no value yet, without notifying any subscribers. It is the no-side-effect seeding primitive used by non-hook global-atom handles (state.GlobalAtom) so constructing a handle never clobbers a value written earlier (the G39 pre-render-write-survives guarantee) and never schedules a spurious render. Returns true if it seeded.
func (*Runtime) Inspect ¶
func (parseRt *Runtime) Inspect() InspectionSnapshot
Inspect captures a snapshot of the current runtime tree, profiling state, and diagnostics.
func (*Runtime) InternalStateSnapshot ¶
func (parseRt *Runtime) InternalStateSnapshot() InternalStateSnapshot
InternalStateSnapshot returns bounded internal queue, fiber, and listener counters.
func (*Runtime) PrepareForHotReload ¶
func (parseRt *Runtime) PrepareForHotReload()
PrepareForHotReload is an internal hot-reload helper.
func (*Runtime) RecordProfilingEvent ¶
func (parseRt *Runtime) RecordProfilingEvent(parseEvent ProfilingEvent)
RecordProfilingEvent records a profiling timeline entry on this runtime.
func (*Runtime) RecordStartupBootstrapRead ¶
RecordStartupBootstrapRead stores bootstrap read or decode timing and emits a profiling timeline event.
func (*Runtime) RecordStartupRouteContext ¶
RecordStartupRouteContext captures which route family the active startup flow is targeting so first-interaction budgets can be attributed correctly.
func (*Runtime) RefreshEffectsForFiber ¶
RefreshEffectsForFiber forces a fiber subtree's effects to clean up and rerun on the next render.
func (*Runtime) RegisterDerivedAtom ¶
func (parseRt *Runtime) RegisterDerivedAtom(parseId string, parseDeps []string, parseCompute func() any) error
RegisterDerivedAtom is a core package helper.
func (*Runtime) RenderInto ¶
RenderInto renders an element tree into an explicit DOM node.
func (*Runtime) ReplayEvents ¶
func (parseRt *Runtime) ReplayEvents() []ReplayEvent
ReplayEvents returns a copy of captured deterministic scheduling events.
func (*Runtime) ReplayUpdates ¶
func (parseRt *Runtime) ReplayUpdates(parseEvents []ReplayEvent)
ReplayUpdates replays captured scheduling events against the current fiber tree.
func (*Runtime) ResolveAgentRef ¶
ResolveAgentRef resolves a stable agent ref to its live fiber under the scheduler lock (the same discipline as Inspect). Resolution is read-only: it never marks fibers dirty or touches hook state.
func (*Runtime) RestoreAtomSnapshot ¶
RestoreAtomSnapshot merges atom values from snapshot and schedules updates for any subscribed fibers.
func (*Runtime) RestoreHotReloadSnapshot ¶
func (parseRt *Runtime) RestoreHotReloadSnapshot(parseSnapshot HotReloadSnapshot)
RestoreHotReloadSnapshot is an internal hot-reload helper.
func (*Runtime) RestoreHotReloadSnapshotWithPlan ¶
func (parseRt *Runtime) RestoreHotReloadSnapshotWithPlan(parseSnapshot HotReloadSnapshot, parsePlan HotReloadRestorePlan) HotReloadRestoreDecision
RestoreHotReloadSnapshotWithPlan is an internal hot-reload helper.
func (*Runtime) ScheduleGranularUpdateForFiber ¶
ScheduleGranularUpdateForFiber marks only the target fiber dirty and lets clean ancestors clone through to the dirty descendant on the next root pass.
func (*Runtime) ScheduleGranularUpdateForFiberWithOrigin ¶
func (parseRt *Runtime) ScheduleGranularUpdateForFiberWithOrigin(parseFiber *Fiber, parseOrigin string)
ScheduleGranularUpdateForFiberWithOrigin marks only the target fiber dirty and records the triggering cause for profiling and devtools inspection.
func (*Runtime) ScheduleOwnedFiberUpdate ¶
ScheduleOwnedFiberUpdate chooses the narrowest safe scheduling path for one component-owned update.
func (*Runtime) ScheduleOwnedFiberUpdateWithOrigin ¶
ScheduleOwnedFiberUpdateWithOrigin chooses the narrowest safe scheduling path for one component-owned update and records the triggering cause.
func (*Runtime) ScheduleSubscribedFiberUpdate ¶
ScheduleSubscribedFiberUpdate chooses the narrowest safe scheduling path for a subscription target.
func (*Runtime) ScheduleSubscribedFiberUpdateWithOrigin ¶
func (parseRt *Runtime) ScheduleSubscribedFiberUpdateWithOrigin(parseFiber *Fiber, parseOrigin string)
ScheduleSubscribedFiberUpdateWithOrigin chooses the narrowest safe scheduling path for a subscription target and records the triggering cause.
func (*Runtime) ScheduleTransition ¶
func (parseRt *Runtime) ScheduleTransition(parseFn func())
ScheduleTransition is a core package helper.
func (*Runtime) ScheduleUpdate ¶
func (parseRt *Runtime) ScheduleUpdate()
ScheduleUpdate schedules a full tree update from the root
func (*Runtime) ScheduleUpdateForFiber ¶
ScheduleUpdateForFiber schedules an update for a specific fiber.
func (*Runtime) ScheduleUpdateForFiberWithOrigin ¶
ScheduleUpdateForFiberWithOrigin schedules an update for a specific fiber and records the triggering cause for profiling and devtools inspection.
func (*Runtime) ScheduleUpdateWithLane ¶
func (parseRt *Runtime) ScheduleUpdateWithLane(parseLane UpdateLane)
ScheduleUpdateWithLane schedules a full root update on an explicit priority lane.
func (*Runtime) SchedulerSnapshot ¶
func (parseRt *Runtime) SchedulerSnapshot() SchedulerSnapshot
SchedulerSnapshot returns priority-lane and backpressure counters for diagnostics.
func (*Runtime) SelectorResolves ¶
SelectorResolves reports whether parseSelector resolves to a live DOM container in the current runtime. The agent bridge uses it to reject a bridge.mount onto a non-existent selector up front: RenderTo signals a missing selector by panicking, but the production panic policy suppresses that signal, so callers cannot otherwise tell a bad selector from success.
func (*Runtime) SerializedMountRoots ¶ added in v4.2.0
SerializedMountRoots reports how many placement roots (single subtrees or sibling-run members) mounted through the serialized-HTML strategy — the observable signal that the fast mount paths are actually firing.
func (*Runtime) SetAtomValue ¶
SetAtomValue is a helper to set an atom value directly (for debugging/testing)
func (*Runtime) SetNextHydrationObserver ¶
func (parseRt *Runtime) SetNextHydrationObserver(parseCorrelationID string, parseNotify func(HydrationMetrics))
SetNextHydrationObserver registers a one-shot observer for the next hydration attempt.
func (*Runtime) SetNextHydrationStrict ¶
SetNextHydrationStrict configures whether the next hydration attempt should fail fast on mismatches instead of warning and falling back per subtree.
func (*Runtime) ShouldDeferStateUpdates ¶
ShouldDeferStateUpdates is a core package helper.
func (*Runtime) SnapshotAtoms ¶
SnapshotAtoms returns a copy of all currently registered atoms.
func (*Runtime) StartReplayRecording ¶
func (parseRt *Runtime) StartReplayRecording()
StartReplayRecording clears and starts the runtime update replay buffer. It takes schedulerMu because the replay buffer is also written by recordReplayUpdate under that lock — accessing it unlocked is a data race.
func (*Runtime) StartTransition ¶
func (parseRt *Runtime) StartTransition(parseFn func())
StartTransition marks state and atom updates inside fn as non-urgent.
func (*Runtime) StopReplayRecording ¶
func (parseRt *Runtime) StopReplayRecording() []ReplayEvent
StopReplayRecording stops recording and returns a stable copy of captured events.
func (*Runtime) StoreStartupCostAttribution ¶
func (parseRt *Runtime) StoreStartupCostAttribution(storeAttribution StartupCostAttribution)
StoreStartupCostAttribution stores startup-cost attribution values.
type RuntimeLimits ¶
type RuntimeLimits struct {
MaxPendingEffectFibers int
MaxQueuedUpdates int
MaxReplayEvents int
MaxDiagnostics int
MaxProfilingEvents int
MaxLogEntries int
}
RuntimeLimits bounds internal queues so long-lived applications fail soft instead of accumulating unbounded framework state.
type SSRStreamChunk ¶
SSRStreamChunk describes one emitted streaming SSR chunk.
type SSRStreamOptions ¶
type SSRStreamOptions struct {
BoundaryIDPrefix string
DisableBoundaryScript bool
ScriptNonce string
OnChunk func(SSRStreamChunk)
Flush func()
}
SSRStreamOptions configures streaming SSR output.
type Scheduler ¶
type Scheduler interface {
RequestIdleCallback(callback func(deadline Deadline))
SetTimeout(callback func(), delay int)
}
Scheduler abstracts work scheduling.
type SchedulerSnapshot ¶
type ScrollIntoViewer ¶
type ScrollIntoViewer interface {
ScrollIntoView(behavior string)
}
type StartupCostAttribution ¶
type StartupCostAttribution struct {
WASMTransferBytes int64
WASMDecodedBytes int64
BootstrapDecodedBytes int64
CacheWarmupDurationNs int64
ServiceWorkerOverheadNs int64
InitialRouteDataBytes int64
}
StartupCostAttribution captures startup-cost components for startup reporting.
type StartupProfilingSnapshot ¶
type StartupProfilingSnapshot struct {
Mode string
StartedAt string
BootstrapReadDurationNs int64
WASMTransferBytes int64
WASMDecodedBytes int64
BootstrapDecodedBytes int64
CacheWarmupDurationNs int64
ServiceWorkerOverheadNs int64
InitialRouteDataBytes int64
HydrationDurationNs int64
StartupCommitDurationNs int64
FirstInteractionDurationNs int64
FirstInteractionCaptured bool
FirstInteractionEvent string
RouteBudgets []RouteStartupBudgetSnapshot
}
StartupProfilingSnapshot summarizes startup and hydration milestones.
type StrictDiagnosticsOptions ¶
type StrictDiagnosticsOptions struct {
Enabled bool
Codes []string
Sources []string
Classifications []DiagnosticClassification
RecoverableOnly bool
EscalationConsequence string
}
StrictDiagnosticsOptions controls whether selected recoverable diagnostics escalate into hard failures.
func CurrentStrictDiagnosticsOptions ¶
func CurrentStrictDiagnosticsOptions() StrictDiagnosticsOptions
CurrentStrictDiagnosticsOptions returns the current strict-diagnostics behavior.
type StrictModeOptions ¶
type StrictModeOptions struct {
Enabled bool
DoubleRender bool
WarnSetStateDuringRender bool
RequireEffectCleanup bool
PanicOnViolation bool
ViolationDiagnosticSource string
}
StrictModeOptions enables development-time runtime checks.
type Suspension ¶
type Suspension struct {
Reason string
Done <-chan struct{}
}
Suspension describes render-time async work that should be retried after Done closes.
func AsSuspension ¶
func AsSuspension(parseRecovered any) (*Suspension, bool)
AsSuspension returns a suspension payload when recovered carries one.
func NewSuspension ¶
func NewSuspension(parseDone <-chan struct{}, parseReason string) *Suspension
NewSuspension creates a render suspension payload.
func (*Suspension) Error ¶
func (parseS *Suspension) Error() string
Error returns the suspension reason.
type UpdateLane ¶
type UpdateLane uint8
UpdateLane names one runtime scheduling priority. Lower values run with larger work slices and win coalescing when multiple update causes arrive before a pending render commits.
const ( UpdateLaneSync UpdateLane = iota + 1 UpdateLaneInput UpdateLaneDefault UpdateLaneTransition UpdateLaneBackground )
func (UpdateLane) String ¶
func (parseLane UpdateLane) String() string
String returns the stable diagnostic label for one update lane.
type WASMArtifactMetadata ¶
type WASMArtifactMetadata struct {
BuildID string
ArtifactPath string
SHA256 string
ManifestPath string
SymbolSet string
Version string
}
WASMArtifactMetadata identifies the emitted browser artifact and related build records.
type WASMStackFrame ¶
WASMStackFrame describes one parsed wasm/browser panic frame before formatting.
type WASMStackFrameMapper ¶
type WASMStackFrameMapper func(WASMStackFrame) (WASMStackFrame, bool)
WASMStackFrameMapper maps one observed wasm/browser panic frame back to a higher-signal application-owned location when source-map metadata is available.
Source Files
¶
- agent_detached.go
- agent_read.go
- agent_ref.go
- agent_selector.go
- agent_state_read.go
- agent_state_version.go
- agent_write.go
- agent_write_native.go
- async_boundary.go
- commit_timing.go
- component_type.go
- context.go
- diagnostic_metadata.go
- dom_ref.go
- error_boundary.go
- event_wrap_cell.go
- event_wrap_native.go
- hook_threading.go
- hooks.go
- hooks_fetch_stub.go
- hooks_func_validate_native.go
- hot_reload.go
- html.go
- hydration.go
- hydration_metrics.go
- inspect.go
- inspect_reporting.go
- interfaces.go
- memory_hygiene.go
- panic_artifact_metadata.go
- panic_guard.go
- panic_report.go
- panic_report_console_stub.go
- panic_source_map.go
- passive_event.go
- plugininterposer.go
- profiling.go
- ready.go
- reconciler.go
- reconciler_commit.go
- reconciler_commit_subtree.go
- reconciler_elements.go
- runtime.go
- runtime_controls.go
- scheduler.go
- shim_native.go
- signature.go
- ssr.go
- ssr_stream.go
- state.go
- strict_diagnostics.go
- transition.go
- types.go