@datalayer/reactor

中文文档
1.3.5发布于 2026/11/07BSD-3-ClauseTypeScriptES Module构建来源已验证近 30 天下载 1.4万

Extension reactor with framework-agnostic core and React bridge

原始使用文档
文档目录5 节
  1. 📖 Documentation
  2. 🎵 The music store, running in the page
  3. Repository layout
  4. Develop
  5. Release

Datalayer

Become a Sponsor

⚛️ Reactor

Application builders hit a wall when a feature spans the browser and the server: frontend and backend plugin systems usually disagree about discovery, dependencies, lifecycle, compatibility, and enablement. Teams duplicate those contracts, hard-wire optional features into the host, and must coordinate rebuilds and deployments just to add, remove, or replace one capability.

Reactor gives JavaScript frontends and Python backends one extensibility model, inspired by VS Code, Eclipse (OSGi), and other proven plugin systems.

Reactor Example Music

Reactor provides two sibling packages:

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

Both tiers implement the same architecture. That is the point of writing it down once: a host that lists, describes, groups or draws plugins should never have to ask which side of the wire one came from.

📖 Documentation

reactor.datalayer.tech — everything is there, and only there. Source in docs/.

Why Reactorwhat this targets that a hook callback does not
Architecturethe seven constructs, and the two distinctions the model rests on
Get started in TypeScript · in Pythoninstall, and a plugin running
TypeScript runtimeplugins, lifecycle, contribution points, extensions, activation, lazy loading, remote plugins, allowed origins, React bindings, signals
Python runtimemanifests, contribution points, extensions, tenants, the HTTP API
Across the tierswhat a plugin may declare about its counterpart, and why it is not enforced
Federationplugins that arrive from a URL, containers, and where one is allowed to come from
Python-packaged extensionsone pip install shipping both tiers, the frontend built into the wheel

🎵 The music store, running in the page

reactor.datalayer.tech/examples/music/demo — a store assembled entirely from plugins, with a switch per plugin on both tiers. Untick one and watch what it contributed leave.

Repository layout

PathWhat is in it
src/TypeScript package source for @datalayer/reactor
reactor/Python package source for datalayer_reactor
plugins/reusable plugins shipped alongside the runtime — the manager and the graph
examples/the demos, including the music store
docs/the documentation site

Develop

# TypeScript: the runtime and the bundled plugins.
npm install
npm run build
npm test
npm run typecheck

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

# The music example, both tiers.
make music

# The documentation site.
cd docs && make install && make start

Release

See RELEASE.md.

版本与发布记录

@datalayer/reactor 共发布 14 个版本,首次发布于 2026/07/19;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.3.5latest2026/11/074 天前
1.3.42026/10/2814 天前
1.3.22026/10/2220 天前
1.3.12026/10/1725 天前
1.3.02026/10/1230 天前
1.2.02026/10/1230 天前

关于 @datalayer/reactor 的常见问题

@datalayer/reactor 是什么?

Extension reactor with framework-agnostic core and React bridge

如何安装 @datalayer/reactor?

在项目目录运行 npm install @datalayer/reactor,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18)、react-dom(>=18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@datalayer/reactor 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@datalayer/reactor 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@datalayer/reactor 可以商用吗?

@datalayer/reactor 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@datalayer/reactor 的下载量有多少?

根据 npm 官方下载统计,@datalayer/reactor 在 2026/10/12 – 2026/11/10 这 30 天内被下载 14,224 次,日均约 474 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@datalayer/reactor 还在维护吗?

最新版本 1.3.5 发布于 2026/11/07(4 天前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/07/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。