Skip to content

feat(plugins): loadStatic accepts a companion dialog vtable for static builds#147

Open
facontidavide wants to merge 1 commit into
mainfrom
feat/wasm-static-plugin-dialogs
Open

feat(plugins): loadStatic accepts a companion dialog vtable for static builds#147
facontidavide wants to merge 1 commit into
mainfrom
feat/wasm-static-plugin-dialogs

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Motivation

Statically-composed applications (the PJ4 WebAssembly build links official plugins as static archives) cannot dlsym a plugin's companion dialog getter from a DSO the way the dynamic loader does. This PR lets the application pass the class-keyed dialog vtable directly at registration time.

What changed

  • DataSourceLibrary::loadStatic, MessageParserLibrary::loadStatic, and ToolboxLibrary::loadStatic accept an optional const PJ_dialog_vtable_t* dialog_vtable (default nullptr, fully backward compatible).
  • When a dialog vtable is supplied, it is validated exactly like the dynamic path (protocol version, struct size, required slots) before the library is constructed; resolveDialogVtable() then serves it to the host.
  • dialog_plugin_base.hpp exports the unique class-keyed getter used by static compositions.

Consumer

PJ4 feat/wasm-reboot: PluginRuntimeCatalog::registerStaticPlugins(StaticPluginSet) passes these vtables through; the host side adds a registration-time fail-fast when a plugin advertises HAS_DIALOG without a dialog vtable (host-side tests in PJ4's plugin_runtime_catalog_test).

Release note

Per the versioning policy this is a backward-compatible API addition → MINOR bump warranted (0.17.0) when convenient (three synced sources: conanfile.py, PJ_PACKAGE_VERSION, recipe.yaml). Not bumped in this PR; happy to add it here if preferred.

🤖 Generated with Claude Code

…c builds

Static compositions cannot dlsym the dialog getter from a DSO, so
DataSourceLibrary/MessageParserLibrary/ToolboxLibrary::loadStatic take the
class-keyed dialog vtable directly and validate it like the dynamic path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant