@cratis/showrunner.usher.react

中文文档
1.21.1发布于 2026/11/11MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2946

React components for Usher — the Showrunner support part for issue reporting and support conversations, built on Cratis Arc and Cratis Components.

原始使用文档
文档目录5 节
  1. Component hierarchy
  2. Architecture decisions
  3. State
  4. CSS conventions
  5. Extending

@cratis/showrunner.usher.react

React components for Usher, the Showrunner support part: report a problem, report this error, and the my issues side sheet with each issue's conversation. Built on @cratis/components and the generated proxies in @cratis/showrunner.usher. How to use it: Documentation/Usher/react.md.

Component hierarchy

UsherProvider                 provides UsherContext, wraps ArcContext for correlation tracking, renders the dialogs once
├── ReportIssueDialog         CommandDialog<ReportIssue>
│   ├── SentWithReport        what is sent along: location, version, recent requests
│   └── AccessFields          share identity / grant access / duration, with AccessNotice
├── ReportErrorDialog         CommandDialog<ReportError>
│   ├── TechnicalDetails      collapsed <details>: type, correlation id, stack frames
│   ├── SentWithReport
│   └── AccessFields
└── MyIssuesDialog            Dialog placement='end', 720px
    ├── IssueList             DataTableForObservableQuery<MyIssues>
    └── IssueView             also exported on its own
        ├── IssueHeader, StatusStrip, QuestionBanner
        ├── IssueConversationPanel   ChatConversation; AnswerQuestion or AddDetails
        ├── IdentityPanel            ShareIdentityDialog
        ├── AccessPanel              GrantAccessDialog, revoke with confirmation, SupportSessions
        └── IssueActions             ReopenIssueDialog, withdraw with confirmation
ReportButton, MyIssuesButton  open the dialogs through useUsher()

Architecture decisions

  • One provider, dialogs rendered once. UsherProvider owns the useDialog wrappers; the buttons and useUsher() only call into UsherContext. The location of the caller is taken with useSliceContext() where useUsher() is called and passed to the dialog, because the dialogs render at the provider, outside the caller's slice scope.
  • Correlation tracking through the HTTP headers callback. Arc has no global observer of command or query results, but Arc React hands each command and snapshot query the httpHeadersCallback of the nearest ArcContext. The provider wraps it to add an X-Correlation-ID to every request and remember it (Correlation/). Arc's backend uses the id a request carries. Observable queries go over Arc's shared hub connection and are not tracked.
  • UsherBoundary keeps Usher out of what it reports. Usher's own components run with the untracked ArcContext and inside a <Slice> boundary, so its requests are not sent with a report and its proxies do not change the slice context of the application around them.
  • Granting access forces sharing identity. useAccessChoice follows the form through onFieldChange and forces shareIdentity through currentValues. shareIdentity is left out of initialValues, because the form merges initialValues over currentValues.

State

Decisions live in pure, specified modules; the components render and wire events:

ModuleDecides
Reporting/AccessChoice.tsaccess choice transitions, forced identity, until when access lasts
Reporting/reportValues.tsthe initial values of a report, error details from what was thrown
Issues/issueStates.tsstate badges, closed states, status strip step
Issues/MyIssuesList.tswaiting count, closed filter, fix released
Issues/conversationMessages.tschat authors and message bodies
Issues/accessStatus.tswhether support may sign in, against the clock
Issues/MyIssues/MyIssuesNavigation.tslist or issue, show closed
Buttons/buttonModels.tstext, tooltip and accessible name of the buttons
Labels/English defaults, deep overrides, placeholders

CSS conventions

One stylesheet, styles.css, exported as @cratis/showrunner.usher.react/styles; the build has no CSS pipeline, so components do not import CSS. Classes are prefixed usher- with BEM-like element names, and every color, border and radius comes from the --cratis-* tokens. State is styled through data-* attributes (data-highlighted, data-reached, data-current).

Extending

  • A new text: add it to UsherLabels and defaultUsherLabels; every component reads labels from UsherContext.
  • A new conversation entry kind: add its sentence to ConversationEventLabels and map it in conversationMessages.ts.
  • A new dialog: render its useDialog wrapper in UsherProvider and add an opener to UsherContextValue and useUsher.

版本与发布记录

@cratis/showrunner.usher.react 共发布 18 个版本,首次发布于 2026/10/27;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.21.1latest2026/11/11今天
1.21.02026/11/11今天
1.20.02026/11/101 天前
1.19.02026/11/092 天前
1.18.02026/11/092 天前
1.17.12026/11/082 天前

其他发布通道:bootstrap → 0.0.0-bootstrap.0。

关于 @cratis/showrunner.usher.react 的常见问题

@cratis/showrunner.usher.react 是什么?

React components for Usher — the Showrunner support part for issue reporting and support conversations, built on Cratis Arc and Cratis Components.

如何安装 @cratis/showrunner.usher.react?

在项目目录运行 npm install @cratis/showrunner.usher.react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.0.0)、@cratis/arc(^22.155.0)、@cratis/arc.react(^22.155.0)、@cratis/components(^4.38.0)、@cratis/fundamentals(^7.27.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cratis/showrunner.usher.react 支持 TypeScript 吗?

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

@cratis/showrunner.usher.react 支持 ESM 还是 CommonJS?

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

@cratis/showrunner.usher.react 可以商用吗?

@cratis/showrunner.usher.react 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cratis/showrunner.usher.react 的下载量有多少?

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

@cratis/showrunner.usher.react 还在维护吗?

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