npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@x1a0f3n9/dsh-client-ui-renderer

v0.1.7-rc.3

Published

Browser UI renderer: React slot bindings, ctx.uiRenderer, and the assembled application root

Readme


description: "浏览器 UI 渲染器:普通 Slot 与可复用 Component Factory 的 React 绑定、ctx.uiRenderer 与组装后的 dsh Web 应用根。" kind: "package-reference"

@x1a0f3n9/dsh-client-ui-renderer

English | 中文

概述

dsh-client-ui-renderer 挂载组装完成的 dsh Web 客户端 GUI:一旦 uiRenderer 存在,启动内核就调用 ctx.uiRenderer.mount(container),它会 hydrate 不依赖框架的启动页并切换到 React 应用;若 layout 尚未注册,root outlet 会等待。业务插件仍是接收类型化 props 的普通 React 组件,通过 props 获取会话与 Workspace 数据,永远不需要自行接线订阅——渲染器在 slot outlet 处把运行时的裸 observable source 绑定为 selector 钩子。Web 外壳与启动内核是它仅有的直接消费方,因此只要组合需要 React 渲染的 GUI,就需要它。

目录


使用本包

本包属于基础设施:Web 外壳与启动内核是它仅有的直接消费方。只要组合需要 React 渲染的 GUI,就需要它——dsh-client-web 启动名册,并在该服务一出现就调用 ctx.uiRenderer.mount(container)。

挂载做什么

mount(container) 会安装 slot 渲染器、在存在时 hydrate 现有启动 DOM、在 layout 条目占用 root 之前保持该启动页、然后再渲染组装后的应用,并返回一个卸载 React 根的 disposer。渲染器执行全程序唯一一次上下文级 renderSlot('root') 调用;注册的根占用方拥有产品布局与文档元数据。

对业务插件

业务插件注册普通 Slot entry 或可复用 Component Factory;渲染器在渲染位置把运行时的会话与 Workspace observable source 绑定为 selector 钩子。插件通过推导出的 Component props 收到标准 scope props——它绝不导入渲染器,也不触碰 React 内部机制。每个由 renderer 创建的 Component 都能渲染 Factory occurrence,Factory 也能暴露由调用方选择的局部 Component,而无需在包之间共享实现值。


理解实现

本包实现一条边界:对象层(运行时,无 React)拥有业务状态;这里是 ctx 到 React 集成唯一发生的位置——slot 渲染器、SessionProvider 与 useSyncExternalStore 适配器。

激活与挂载

插件在 slots、sessions 与 layout 就绪后激活;它安装 createSlotRenderer() 并 reflect uiRenderer 服务。mountApp 会查找启动内核的 [data-dsh-boot] 元素:存在时经 BootHandoff(一个保留加载 DOM 的单帧透传)hydrate,否则创建全新的根节点并同步提交渲染。

Slot 绑定

createSlotRenderer 把 slot 注册表连接到 React:普通 entry list 与 Factory definition 成为响应式 source,每个 outlet 或 occurrence 经已安装的渲染器渲染。业务插件通过带类型的 hooks 传递裸 observable source;渲染器经 uSES 适配器在渲染位置完成绑定。Factory Store factory 保持 lazy,直到 occurrence 首次物化时才创建 handle;其 exclusive handle 拒绝持久化,渲染期记录保持弱引用,幂等 effect 仅强引用 mounted occurrences,同时在 effect replay 期间保留 identity。Factory 错误使用普通监督通道且不会 abdicate 共享 definition:definition 及其 fallback 局部 Component 的失败归属 definition,调用方所选局部 Component 的失败归属调用方 registration,每个边界随自身 scope incarnation 重置。

身份

React、React DOM、Cordis、ui-slots 与 ui-primitives 通过 Web 外壳的静态模块表保持同一浏览器身份;本包则以动态客户端 bundle 的形式加载。


进一步探索

以下页面覆盖周边机制与组合模型。

  • ui-slots——本渲染器绑定到 React 的 slot 注册表纯核心。
  • web——加载名册并调用 mount 的外壳。
  • ui-session——提供本渲染器所绑定标准会话 source 与钩子的适配器。
  • Web 客户端架构——加载链、对象层与分层红线。
  • slot 系统标准——权威组合模型。
  • Component Factory——可复用 definitions、局部 Component 选择与 occurrence 生命周期。

模型体验

无。该包是浏览器端渲染组装层,不注册任何面向模型的内容。

KV Cache 影响

无;该包既不组装也不发送提供方请求。

已知限制与延期工作

这些限制说明应用首帧何时出现、按区域就绪能走多远;它们是当前包约束。

  • uiRenderer 出现后即挂载:启动内核那时交出挂载点;root outlet 会等待第一次有效注册。
  • slot 渲染没有 Suspense 集成或逐 entry 惰性加载:其余插件在挂载后仍作为普通 Cordis entry 到达。

开发备注

无。