docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A host layout that forwards routing and micro-app lifecycle details to a telemetry sink.
routeInfo, emit a telemetry payload containing the pathname and matched app name exactly once per change via the provided sender. @testappEnter data is present, emit a telemetry payload before rendering children that includes the app name, entry path, and timestamp, and ensure repeated renders with the same data are not double-sent. @testappLeave data is present, emit a telemetry payload after unmount that includes the app name, leave path, and timestamp. @testrouteInfo through a hook so nested components can read the active pathname and matched app without prop drilling. @testimport React from "react";
export interface RouteInfo {
pathname: string;
matchedApp?: {
name: string;
path: string;
};
}
export interface AppLifecycleEvent {
name: string;
path: string;
timestamp: number;
extras?: Record<string, unknown>;
}
export type TelemetryPayload =
| { type: "route-change"; routeInfo: RouteInfo }
| { type: "app-enter"; app: AppLifecycleEvent }
| { type: "app-leave"; app: AppLifecycleEvent };
export type SendTelemetry = (payload: TelemetryPayload) => Promise<void> | void;
export interface TelemetryLayoutProps {
routeInfo: RouteInfo;
appEnter?: AppLifecycleEvent;
appLeave?: AppLifecycleEvent;
sendTelemetry: SendTelemetry;
renderApp: () => React.ReactNode;
}
export function TelemetryLayout(props: TelemetryLayoutProps): JSX.Element;
export function useLatestRoute(): RouteInfo;Provides micro-frontend routing context and lifecycle data.