Reactor provides two sibling packages in one repository, with no python/typescript subpackage folders:
datalayer_reactor(Python): FastAPI + pluggy plugin platform for modular and SaaS-style extensibility.@datalayer/reactor(TypeScript): Lexical-inspired extension runtime with a framework-agnostic core and separate React integration.
This project targets a full extension platform, not only hook callbacks:
- Platform architecture with lifecycle phases and dependency graph
- Plugin marketplace metadata and discovery primitives
- Third-party ecosystem support through explicit manifest contracts
- Dynamic feature loading and runtime enable/disable
- Modular app concerns: interdependencies, lifecycle management, compatibility checks
- SaaS extensibility primitives: tenant-specific plugin activation, sandboxed execution, versioned compatibility
src/: TypeScript package source for@datalayer/reactordatalayer_reactor/: Python package sourceexamples/frontend/: frontend-only React + Primer UI demoexamples/frontend-backend/: combined React + Python demo
The TypeScript runtime implements a similar model to Lexical Extensions docs:
defineExtensionandconfigExtensiondependencies,peerDependencies,conflictsWith- ordered phases:
init->build->register->afterRegistration - runtime lifecycle control:
start,stop,enable,disable - signal primitives for reactive extension outputs:
signal,computed,effect,batch,untrackednamedSignals,watchedSignal
- Core runtime exports from
@datalayer/reactor - React bindings export from
@datalayer/reactor/react
React bindings include:
ReactorProvider: platform lifecycle in React treeReactorSlot: render plugin-provided components by named slotuseReactorPlatform: platform access for runtime toggles
npm install
npm run buildimport { buildPlatformFromExtensions, defineExtension } from '@datalayer/reactor';
const DemoExtension = defineExtension({
name: '@demo/core',
build() {
return { message: 'hello' };
},
});
const platform = buildPlatformFromExtensions([DemoExtension]);
platform.start();- Pluggy-powered plugin registration (
register_plugin) - Compatibility and dependency checks via
PluginManifest - Runtime enable/disable globally and by tenant
- Marketplace publication/listing (
PluginMarketplace) - Sandboxed execution option for plugin calls
- FastAPI control plane with plugin/tenant endpoints
python -m venv .venv
source .venv/bin/activate
pip install -e .
python -m datalayer_reactorGET /pluginsPOST /plugins/{plugin_name}/togglePOST /tenants/plugins/{plugin_name}/toggleGET /tenants/{tenant_id}/featuresGET /tenants/{tenant_id}/routesGET /marketplace
from datalayer_reactor import PluginManifest, PluginCompatibility, PluginPlatform
platform = PluginPlatform()
platform.register_plugin(
PluginManifest(
name="greeting-plugin",
version="1.0.0",
compatibility=PluginCompatibility(api_version="v1"),
),
plugin_impl=object(),
)The frontend demo at examples/frontend/ contains two plugins:
@demo/welcome-card@demo/status-banner
It renders them through ReactorSlot and exposes runtime enable/disable controls.
Run it:
npm install
npm run example:devRun the combined frontend-backend demo frontend:
npm run example:dev:frontend-backendRun the Python app for the combined frontend-backend demo:
python -m uvicorn --app-dir examples/frontend-backend python_platform_demo:app --reload --port 8788- Add a persisted marketplace backend (database + signed plugin artifacts)
- Add stronger sandbox isolation (subprocess/container boundaries)
- Add semantic version range support (
^,~) for compatibility contracts - Add plugin state migrations for compatibility layer upgrades