civaapple-alt/mini-dsh--packages-client-slots ↗★ 7
@mini-dsh/client-slots
🚀 Educational & minimalist DeepSeek Harness (DSH) architecture implementation powered by Cordis microkernel. 极简版 DeepSeek Harness 架构实现与学习指南。 适合想了解插槽驱动前端解耦的开发者,用于学习组件注册与渲染机制。
설치
검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗
@mini-dsh/client-slots
English | 中文
Mini-DSH 浏览器端的声明式 UI 插槽注册表服务。
核心职责与 Cordis 契约
- 注册服务:
ctx.slots(SlotRegistryService); - 核心功能:
ctx.slots.register(slotName, renderer):允许任意插件向指定命名插槽(如main.cards、sidebar.widgets)贡献 UI 组件,返回 Disposer;ctx.slots.renderSlot(slotName, container):将插槽内的所有组件渲染到指定的 DOM 容器中;ctx.emit('slot/updated', slotName):当插槽增删插件时触发事件通知。
对应 DeepSeek Harness (dsh) 模块
- 对应 dsh 仓库的
packages/client/ui-slots(ctx.slots)。 - 异同对比:
- 设计理念完全一致:都是为了让前端组件间实现零耦合、完全由插槽声明驱动;
mini-dsh使用简洁的原生 DOM 渲染函数;dsh完整版深度结合 React,提供了SlotMap类型级声明合并、4 种 Props Share 派生(PropsRuntime、PropsRenderSlots、PropsStore、inject)、以及对 Session Scope 和 Store 的复杂绑定。