You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build the @host/sdk TypeScript module — the stable façade plugins import. Versioned in lockstep with abi_version. Provides: host.activePlugins, host.boot(), registration functions (registerMenu, registerAdminRoute, registerBlock, registerEditorPanel, registerInteractiveBlock, ...), glue (api(), i18n, log, events, settings).
Plugins do NOT import React from their own bundle; they get it via the import map. Plugins do NOT make raw HTTP calls; host.api() is the only blessed way.
Design reference
docs/02-plugin-system.md §7.2, Appendix C
Acceptance criteria
Package @host/sdk with TypeScript source + ambient type declarations
Summary
Build the
@host/sdkTypeScript module — the stable façade plugins import. Versioned in lockstep withabi_version. Provides:host.activePlugins,host.boot(), registration functions (registerMenu,registerAdminRoute,registerBlock,registerEditorPanel,registerInteractiveBlock, ...), glue (api(),i18n,log,events,settings).Plugins do NOT import React from their own bundle; they get it via the import map. Plugins do NOT make raw HTTP calls;
host.api()is the only blessed way.Design reference
Acceptance criteria
@host/sdkwith TypeScript source + ambient type declarationshostconst exposesactivePlugins: ReadonlyArray<{slug, entry, version}>(fromwindow.__host_state.plugins) andboot()registerMenu,registerAdminRoute,registerBlock(thin wrapper that constructs the doc 04 §2.1BlockTypeDefinition),registerEditorPanel,registerEditorPlugin,registerInteractiveBlock,registerShortcodeapi<T>(path, init?)-> hits/api/plugins/{currentSlug}/{path}with auth token attached, rate-limit hints, JSON parsei18n.t(key, vars?)resolves against the current plugins translation maplog.debug/info/warn/error-> console + optional remote shipping (per config)events.on(name, fn)andevents.emit(name, data?)for cross-extension client-side messagingsettings.get<T>(key)/settings.set<T>(key, v)-> persisted via plugin REST APIapi()automatically targets the correct plugins endpoint) — no manual slug-passing requiredtsdorexpectType); SDK loaded in a test page; registration calls update internal registries;api()round-trips through MSWDependencies
#206 (frontend serving), doc 04 §2.1 (BlockTypeDefinition)
Complexity
L