Skip to main content

Datalayer

Become a Sponsor

🔌 Reactor

Reactor provides two sibling packages in one repository, with no python/typescript subpackage folders:

  • datalayer_reactor (PyPI distribution, imported as reactor): FastAPI + pluggy plugin reactor for modular and SaaS-style extensibility.
  • @datalayer/reactor (TypeScript): Extension runtime with a framework-agnostic core and separate React integration.

Why Reactor

This project targets a full extension reactor, 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

Repository Layout

  • src/: TypeScript package source for @datalayer/reactor
  • reactor/: Python package source
  • examples/frontend/: frontend-only React + Primer UI demo
  • examples/frontend-backend/: combined React + Python demo

TypeScript Package: @datalayer/reactor

Design

The TypeScript runtime implements:

  • defineExtension and configExtension
  • dependencies, 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, untracked
    • namedSignals, watchedSignal

Core vs React split

  • Core runtime exports from @datalayer/reactor
  • React bindings export from @datalayer/reactor/react

React bindings include:

  • useReactor: register the reactor in the zustand store and manage its lifecycle
  • ReactorSlot: render plugin-provided components by named slot
  • useReactorPlatform: reactor access for runtime toggles

Build

npm install
npm run build

Minimal TypeScript usage

import { buildReactorFromExtensions, defineExtension } from '@datalayer/reactor';

const DemoExtension = defineExtension({
	name: '@demo/core',
	build() {
		return { message: 'hello' };
	},
});

const reactor = buildReactorFromExtensions([DemoExtension]);
reactor.start();

Python Package: datalayer_reactor

Capabilities

  • 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

Install and run

python -m venv .venv
source .venv/bin/activate
pip install -e .
python -m reactor

API app endpoints

  • GET /plugins
  • POST /plugins/{plugin_name}/toggle
  • POST /tenants/plugins/{plugin_name}/toggle
  • GET /tenants/{tenant_id}/features
  • GET /tenants/{tenant_id}/routes
  • GET /marketplace

Minimal Python usage

from reactor import PluginManifest, PluginCompatibility, PluginPlatform

reactor = PluginPlatform()
reactor.register_plugin(
		PluginManifest(
				name="greeting-plugin",
				version="1.0.0",
				compatibility=PluginCompatibility(api_version="v1"),
		),
		plugin_impl=object(),
)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datalayer_reactor-0.1.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file datalayer_reactor-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for datalayer_reactor-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64c3094a3b2816843140fe3b01b39018378280ced97181d298e461e7e8ff3cd9
MD5 09059e252971f99bd063b9c123ac3b0d
BLAKE2b-256 6a2e5fa28ab070f9efb5933c1cc032c80cdbd5abba9f0f2bb6c95ae5ab59c4e9

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

1 file

This release

0.1.3 This release

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page