ump-plugin-test-binding
v0.0.1
Published
In-tree demo plugin that exercises the `binding_registry` pattern end-to-end. Returns `42` from native via a registered JSI global, or `-1` if the native side never linked the registrar.
Readme
ump-plugin-test-binding
In-tree demo plugin that exercises the binding_registry pattern
end-to-end. Returns 42 from native via a registered JSI global, or -1
if the native side never linked the registrar.
Install
npm install ump-plugin-test-binding --save
(Marked private: true — this package is not intended for external
publish; it ships in-tree as a smoke test for the native plugin
registration flow.)
Usage
import { TestBinding, testBindingPlugin } from 'ump-plugin-test-binding';
pm.register(testBindingPlugin());
const v = TestBinding.get(); if (v === 42) { // native side wired up __ump_test_binding_get correctly } else if (v === -1) { // native registrar never linked — check ump.native config in package.json }
The native source under native/test_binding_register.cpp is referenced
by all three platforms via this package's ump.native manifest, which is
how the runtime knows to compile and link the registrar.
See src/index.ts for the full API.
Plugin authoring
This is a UMP plugin. See docs/superpowers/specs/plugin-authoring-guide.md for the plugin model.
