@ethisyscore/components-react
v1.16.0
Published
Host-bound React contract for EthisysCore PlatformReact pages (RFC 0003). Provides the typed page-props contract and `definePlatformReactPage` helper so plugin authors get type-safe access to the host realm — extensionId, organisationId, mcp transport — w
Maintainers
Readme
@ethisyscore/components-react
Host-bound React contract for EthisysCore PlatformReact pages (RFC 0003).
Provides the typed page-props contract every PlatformReact page receives from
the host at surface mount time, plus a definePlatformReactPage helper so
plugin authors get type-safe access to the host realm without depending on
the host app's internal modules.
import { definePlatformReactPage, type PlatformReactPageProps } from "@ethisyscore/components-react";
const Dashboard = ({ extensionId, organisationId, pageId }: PlatformReactPageProps) => (
<section>
<h1>Dashboard</h1>
<p>Extension {extensionId} for org {organisationId} (page: {pageId})</p>
</section>
);
export default definePlatformReactPage(Dashboard);The plugin's feature.manifest.json references this module via
ui.platformReactPages[].moduleSpecifier; the host loads the module at surface
mount time, reads the declared exportName, and renders the component with the
typed props.
Why this package exists
PlatformReact is the high-trust platform-extension tier — the plugin's bundle runs in the host realm, so the plugin can use any npm package the author bundles. This package is the one dependency that has to come from the host side: the contract for what the host passes to the mounted page. Keeping it as a focused npm package means:
- The host's internal modules (
coreconnect-web'sPlatformReactSurfaceMount) do not leak as plugin dependencies. - The contract grows with explicit versioning — additive changes are backward-compatible, breaking changes bump the major.
- Plugin authors get strict TypeScript at the host-↔-plugin seam — no
any, no shape drift.
What's in the package
PlatformReactPageProps— the props every page receives from the host (extensionId,organisationId, optionaltenantId,pageId).definePlatformReactPage(Component)— pass-through helper today; the indirection point for future host integrations (boundary injection, suspense fallbacks, error contracts) to land without every plugin author updating their export.
See docs/authoring/platform-react.md for the full PlatformReact authoring
guide.
