Documentation
¶
Overview ¶
Package resolver provides property resolution logic for Inertia. It handles partial reloads, deferred props, merge strategies, and infinite scroll.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestHeaders ¶
type RequestHeaders struct {
PartialComponent string
PartialOnly string
PartialExcept string
Reset string
ExceptOnceProps string
InfiniteScrollMergeIntent string
}
RequestHeaders contains Inertia-specific request headers extracted from HTTP requests. These headers control partial reloads, prop filtering, and infinite scroll behavior.
type ResolveResult ¶
type ResolveResult struct {
// Props contains the final resolved page properties after filtering and evaluation.
Props map[string]any
SharedProps []string
// MergeProps lists prop paths the client should merge (append) into existing state.
MergeProps []string
// PrependProps lists prop paths the client should prepend into existing state.
PrependProps []string
// DeepMergeProps lists prop paths the client should deep-merge into existing state.
DeepMergeProps []string
// MatchPropsOn lists property keys used for item matching during merge operations.
MatchPropsOn []string
// DeferredProps maps defer group names to the prop paths belonging to each group.
DeferredProps map[string][]string
// ScrollProps contains per-prop pagination metadata for infinite scroll props.
ScrollProps map[string]any
// OnceProps contains per-prop metadata for once-resolved props, keyed by their once-key.
OnceProps map[string]any
}
ResolveResult contains the fully resolved properties and metadata for an Inertia response. It is produced by Resolver.Resolve and consumed by the engine to build the Page object.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves Inertia property values based on request headers and prop types.
func New ¶
func New(isPartial, isInertia bool, headers *RequestHeaders) *Resolver
New creates a new Resolver configured for the given request type. isPartial indicates a partial reload request. isInertia indicates an Inertia request (vs. first-visit).