@ai-matrx/内容-ir-反应
共享 渲染图层 用于AI Matrx 内容 IR.
@ai-matrx/content-ir 实值
纯核——它描述一种,验证它,读取流出的部分
读取运行时间包装。 这个包是上面的一层:
决定 某类组件通过,并绘制 铬周围
那个决定.
这是框架便携式反应。 没有下一个J 没有Redux 没有Supabase 没有路由器, 没有主机错误抓取 。 每个特定东道方的能力都通过明确的 缝合.
npm install @ai-matrx/content-ir-react @ai-matrx/content-ir react
给主机接电一次
import {
ComponentResolver,
ContentIrRenderProvider,
applyIrKindRoute,
type ContentIrHost,
} from "@ai-matrx/content-ir-react";
const components = new ComponentResolver({
loadAll: () => fetchKindComponentRows(),
loadForKind: (kind, platform) => fetchKindComponentRows({ kind, platform }),
reportError: (report) => myErrorLog(report),
});
const host: ContentIrHost = {
platform: "web",
kinds: myKindDefinitionSource,
components,
reportError: (report) => myErrorLog(report),
// The host's dispatch table — the ONE place a component key becomes a
// component. Run the route here.
renderBlock: (block) => <MyBlockRenderer block={applyIrKindRoute(block, env)} />,
// The FLOOR: any JSON value as a human document.
renderValue: ({ value, kind, note }) => (
<MyStructuredValueView value={value} kind={kind} note={note} />
),
};
<ContentIrRenderProvider host={host}>
<App />
</ContentIrRenderProvider>;
你得到的东西
| 导出 | 这是什么 |
|---|---|
applyIrKindRoute | 类型路由: 信封 注册类型 右侧组件键 。 纯;从还原器或流积器中调用. |
resolveProvisionalKindRender 编号 : resolveAnnouncedKindLoading | 流出部分类型的路由——一个暂定值使得通过 SAME 组件,最终值会. |
ComponentResolver | (kind, platform, role) → component,编译出地板 + DB 覆盖,颗粒再油漆计数器,冷调图调取. |
KindInstanceRender | 穿过真正的生产道路 将一个小犬类的例子 放在地上. |
GenericStructuredView | 已知形状的R6处置没有引起任何信任的主张——可读、诚实、绝不是错误. |
NodeOutcomeView 编号 : RunResultView | 运行时间 包装铬。 透明的路由器:它们代表,它们从来不产生有效载荷. |
ProvisionalKindBoundary 编号 : ProvisionalKindFrame | 中游安全网和"还来"支付. |
useContentIrKindVersion | 粒状晚到再喷漆的一种. |
此软件包是用来执行的
形状有一个完全一样的成分,到处都是. 第二次执行 路线决定——在一个仪表板、一个扩展、一个桌面网页视图、一个 顾客的应用——是一种有保障的差异,它被禁止。 如果这个软件包 无法表达您的主机需求, 添加接合; 永远不要叉开路径 .
文档
- 软件包内部和边界 :
FEATURE.md除了这个文件. - 交叉检索记录系统 :
common-docs/systems/architecture/content-ir/FEATURE.md。 。 。 . - 形状系统语义 :
matrx-frontend/features/content-ir/docs/SHAPE_SYSTEM.md。 。 。 .