RoutedReactApplication class final

Composes React document and server-action handlers into a Routed handler.

Non-document requests are delegated to staticHandler. Document requests are rendered through ssr when ssr and rootComponent are configured. The action endpoint reuses react_server's registry and react_actions' versioned server-function protocol directly on routed.EngineContext.

Constructors

RoutedReactApplication({required ServerFunctionRegistry actionRegistry, required Handler staticHandler, required String indexTemplate, String actionPath = '/__react/actions', ReactSsrClient? ssr, String? rootComponent, RoutedReactPageProps pageProps = _emptyPageProps, RoutedReactPageMetadata pageMetadata = _emptyPageMetadata, RoutedReactPartialDocumentBuilder? partialDocument, RoutedReactSsrEndpoint? ssrEndpoint, ReactDataCache? partialDataCache, ReactRouteManifest? routeManifest, bool streamingSsr = false, ReactDocumentCache? documentCache, ReactDocumentStore? documentStore, RoutedReactCacheKey cacheKey = _defaultCacheKey, RoutedReactCacheTags cacheTags = _emptyCacheTags, Duration documentTtl = const Duration(minutes: 1), Duration staleWhileRevalidate = Duration.zero, RoutedReactAuthentication? authenticate, Duration requestTimeout = const Duration(seconds: 30), int maxActionBodySize = 1024 * 1024})
Creates a Routed/React application handler composition.

Properties

actionPath String
Path handled by the server-action endpoint.
final
actionRegistry → ServerFunctionRegistry
The registry used by the React server-action endpoint.
final
authenticate RoutedReactAuthentication?
Resolves the principal used by server actions.
final
cacheKey RoutedReactCacheKey
Selects a cache key when documentCache is enabled.
final
cacheTags RoutedReactCacheTags
Supplies tags written to the memory and persistent document caches.
final
documentCache → ReactDocumentCache?
Optional in-process cache for completed, buffered documents.
final
documentStore → ReactDocumentStore?
Optional persistent or distributed document storage.
final
documentTtl Duration
Lifetime written to documentStore entries.
final
handler → Handler
Returns the composed Routed handler.
no setter
hashCode int
The hash code for this object.
no setterinherited
indexTemplate String
HTML template containing {{SSR}} and optionally {{PROPS}} markers.
final
maxActionBodySize int
Maximum accepted server-action request body size.
final
pageMetadata RoutedReactPageMetadata
Builds title, SEO, and link metadata for the document head.
final
pageProps RoutedReactPageProps
Builds the props passed to the SSR root component.
final
partialDataCache → ReactDataCache
Cache used by partialDocument shells and regions.
final
partialDocument → RoutedReactPartialDocumentBuilder?
Builds a shell and independently cached dynamic regions for PPR.
final
requestTimeout Duration
Maximum time allowed for a server action.
final
rootComponent String?
Generated component name registered by the SSR bundle.
final
routeManifest → ReactRouteManifest?
Optional route-level ISR policies.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ssr → ReactSsrClient?
Client for the Node SSR worker.
final
ssrEndpoint RoutedReactSsrEndpoint?
Resolves the base URI used for relative ssr endpoints.
final
staleWhileRevalidate Duration
How long expired documents may be served while refreshing in the background.
final
staticHandler → Handler
Handles assets and requests that are not React documents or actions.
final
streamingSsr bool
Whether document responses should be progressively streamed from React.
final

Methods

mount(Engine engine) → void
Mounts the composed handler on engine.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited