Skip to content

Blazor Integration: Diagrams

Diagrams for the Blazor integration concepts introduced in Part 3.

Component Hierarchy

ComponentPurpose
ComponentBaseBlazor's base class
FusionComponentBaseOptimized parameter comparison & events
CircuitHubComponentBaseCircuitHub access & service shortcuts
StatefulComponentBase<T>State management & auto-updates
ComputedStateComponent<T>Auto-computed state, dependency tracking
ComputedRenderStateComponent<T>Tracks render state snapshot, optimized re-rendering
MixedStateComponent<T, TMutable>Computed state + mutable state for form inputs

FusionComponentBase Parameter Comparison Flow

Comparer Resolution OrderDescription
1. [ParameterComparer] on propertyIf found, use it
2. KnownComparerTypes[propertyType]If found, use it
3. [ParameterComparer] on property's typeIf found, use it
4. [ParameterComparer] on declaring classIf found, use it
5. DefaultParameterComparerFallback

CircuitHub Service Architecture

CircuitHub is a scoped service providing access to commonly used services and state:

CategoryPropertyDescription
Fusion ServicesSessionCurrent user session
CommanderCommand executor
Blazor ServicesNavManagerNavigation manager
JSRuntimeJavaScript interop runtime
UICommanderUI-aware command executor
JSRuntimeInfoRuntime type inspection
UIActionFailureTrackerTracks command failures
State InfoRenderModeCurrent Blazor render mode
IsPrerenderingWhether currently prerendering

ComputedStateComponent Lifecycle

StepDescription
CreateState()Creates ComputedState<T> with ComputeState as the computation function
First RenderState.HasValue determines what to render
ComputeState()Calls your compute methods (tracked)
StateChanged()Calls NotifyStateHasChanged()

MixedStateComponent Lifecycle

StatePurpose
MutableState<string>User input binding, always consistent, Set() updates value
ComputedState<T>Reads MutableState.Value, calls compute services, returns computed result

Note: ComputeState doesn't need to explicitly call .Use() on MutableState - the dependency is assumed. Any change to MutableState triggers an immediate re-render (no update delays).

Example Flow:

  1. User types "react" in search box
  2. MutableState.Value updates to "react"
  3. ComputeState() executes: reads search term → calls SearchService.Search() → returns results
  4. UI renders search results

Authentication Flow

MethodDescription
GetUser()Compute method returning current user
IsSignOutForced()Compute method checking forced sign-out

PresenceReporter.Run Flow

TimelineSequence
NormalStart → Update (~3min) → Update (~3min) → Update (~3min)
On FailureStart → Update (fail) → Retry 10s (fail) → Retry 30s (success) → Update (~3min)

Render Mode Switching

ModeCodeDescription
AutoaAutomatic mode selection
ServersBlazor Server mode
WebAssemblywBlazor WebAssembly mode