Show framework event metadata documentation in detail view and tree select

Reviewed By: lblasa

Differential Revision: D48348090

fbshipit-source-id: e48547508b78178b278f72ce72fc579c9f015570
This commit is contained in:
Luke De Feo
2023-08-21 04:24:16 -07:00
committed by Facebook GitHub Bot
parent f5bc03c263
commit 4918d21df8
5 changed files with 82 additions and 13 deletions

View File

@@ -19,6 +19,7 @@ import {
PerformanceStatsEvent,
SnapshotInfo,
ClientNode,
FrameworkEventMetadata,
} from './ClientTypes';
import {
UIState,
@@ -50,6 +51,10 @@ export function plugin(client: PluginClient<Events>) {
limit: 10000,
});
const frameworkEventMetadata = createState<
Map<FrameworkEventType, FrameworkEventMetadata>
>(new Map());
const uiState: UIState = createUIState();
//this is the client data is what drives all of desktop UI
@@ -78,6 +83,11 @@ export function plugin(client: PluginClient<Events>) {
draft.set(frameworkEventMeta.type, false);
});
});
frameworkEventMetadata.update((draft) => {
event.frameworkEventMetadata?.forEach((frameworkEventMeta) => {
draft.set(frameworkEventMeta.type, frameworkEventMeta);
});
});
});
client.onConnect(() => {
@@ -301,6 +311,7 @@ export function plugin(client: PluginClient<Events>) {
uiActions: uiActions(uiState, nodesAtom, snapshot, mutableLiveClientData),
nodes: nodesAtom,
frameworkEvents,
frameworkEventMetadata,
snapshot,
metadata,
perfEvents,