Architecture
IIFE Build and Registration
Built as an IIFE bundle via Vite (see
vite.config.lib.ts).Library entry:
src/index.tsFormat:
iifeOutput file:
dist/index.iife.jsReact is externalized and exposed via globals (
React,ReactDOM).
During initialization,
src/index.tsregisters the widget definition with the global Octopus host:It uses
makeWidgetDefto create the widget descriptor, then callsO.registerWidget(...).A small IIFE polls
globalThis.Octopusto register as soon as the frontend host is available.
This packaging allows octopus-frontend to load the widget bundle directly and auto-register at runtime.
Runtime Data Flow
The widget code typically uses the Octopus Widget SDK and Apollo GraphQL hooks. Generated widgets may include support for:
Polling queries at the configured dashboard refresh rate
Live streams via GraphQL subscriptions
Mutations (optional)
See src/SkaOctopusCoverageWidget.tsx and src/graphql/ops.ts for the actual operations included when scaffolding.