@ethisyscore/components-react

中文文档
1.167.0发布于 2026/10/25SEE LICENSE IN LICENSETypeScriptESM + CJS零依赖近 30 天下载 8476

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

此软件包已被标记为弃用

This package has moved to the Ethisys Core package feed. In Ethisys Core, open the Developers page and follow the setup steps (cc login connects npm to the feed).

原始使用文档

@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's PlatformReactSurfaceMount) 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, optional tenantId, 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.

版本与发布记录

@ethisyscore/components-react 共发布 243 个版本,首次发布于 2026/06/01;过去 12 个月发布了 243 个版本。

版本发布日期距今
1.167.0latest2026/10/2520 天前
1.166.02026/10/2420 天前
1.165.02026/10/2420 天前
1.164.02026/10/2321 天前
1.163.32026/10/2321 天前
1.163.22026/10/2321 天前

关于 @ethisyscore/components-react 的常见问题

@ethisyscore/components-react 是什么?

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注意:该包已被作者标记为弃用——This package has moved to the Ethisys Core package feed. In Ethisys Core, open the Developers page and follow the setup steps (cc login connects npm to the feed).

如何安装 @ethisyscore/components-react?

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

@ethisyscore/components-react 支持 TypeScript 吗?

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

@ethisyscore/components-react 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ethisyscore/components-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ethisyscore/components-react 可以商用吗?

@ethisyscore/components-react 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@ethisyscore/components-react 的下载量有多少?

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

@ethisyscore/components-react 还在维护吗?

最新版本 1.167.0 发布于 2026/10/25(20 天前);至今共发布 243 个版本,其中过去 12 个月发布了 243 个;首次发布于 2026/06/01。作者已将其标记为弃用,新项目建议寻找替代方案。