ObjectStackObjectStack

Plugin Loading

Plugin Loading protocol schemas

Plugin Loading Protocol

What remains of this module is the observational half: the lifecycle event a loader would emit (PluginLoadingEventSchema) and the per-plugin state it would track (PluginLoadingStateSchema).

The configuration half — PluginLoadingConfigSchema and the ten member schemas it combined, reached from authored metadata as manifest.loading — was REMOVED in v17 per ADR-0049 enforce-or-remove (#4914). See the block below.

Source: packages/spec/src/kernel/plugin-loading.zod.ts

TypeScript Usage

import { PluginLoadingEventSchema, PluginLoadingStateSchema } from '@objectstack/spec/kernel';
import type { PluginLoadingEvent, PluginLoadingState } from '@objectstack/spec/kernel';

// Validate data
const result = PluginLoadingEventSchema.parse(data);

PluginLoadingEvent

Plugin loading lifecycle event

Properties

PropertyTypeRequiredDescription
typeEnum<'load-started' | 'load-completed' | 'load-failed' | 'init-started' | 'init-completed' | 'init-failed' | 'preload-started' | 'preload-completed' | 'cache-hit' | … +5 more>
pluginIdstring
timestampinteger
durationMsintegeroptional
metadataRecord<string, any>optional
error{ message: string; code?: string; stack?: string }optional

Allowed Values: PluginLoadingEvent.type

  • load-started
  • load-completed
  • load-failed
  • init-started
  • init-completed
  • init-failed
  • preload-started
  • preload-completed
  • cache-hit
  • cache-miss
  • hot-reload
  • dynamic-load
  • dynamic-unload
  • dynamic-discover

PluginLoadingState

Plugin loading state

Properties

PropertyTypeRequiredDescription
pluginIdstring
stateEnum<'pending' | 'loading' | 'loaded' | 'initializing' | 'ready' | 'failed' | 'reloading' | 'unloading' | 'unloaded'>
progressnumber
startedAtintegeroptional
completedAtintegeroptional
lastErrorstringoptional
retryCountinteger

On this page