Uh oh!
There was an error while loading. Please reload this page.
docs(runner): Error Boundaries 一条改为可达的 SchemaErrorBoundary (#3635) - #3725
Merged
Conversation
原示例从 @object-ui/components 导入 ErrorBoundary,而该包无此导出; runner 也不依赖真身所在的 app-shell。但 runner 直接依赖的 @object-ui/react 经 src/index.ts:9 的 `export * from './SchemaRenderer'` 已公开导出 SchemaErrorBoundary,故零 API 成本即可就地改正。 同时按裁决讲清内建/外层边界分工:SchemaRenderer 内建的按组件边界在 SchemaRenderer.tsx:447 才构造,此前的表达式求值与注册表查找路径的 抛出会外逃,外层边界并非纯冗余。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
marked this pull request as ready for review
August 8, 2026 10:06
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#3635
裁决依据:该单 2026-08-08 的 PM 重裁 (A')(issue comment 5223449796)—— 就地改正为
import { SchemaErrorBoundary } from '@object-ui/react',并按其第 3 条讲清内建/外层边界分工。零 API 成本,未新增任何公开导出。修前(全文引用)
@object-ui/components没有ErrorBoundary导出(grep -rn 'ErrorBoundary' packages/components/全包零命中),故该示例整体不可执行。前提更正:本单原诊断的第三条断言不成立
原单据「
packages/react/src/index.ts里搜Boundary零命中」判定SchemaErrorBoundary未公开导出,并由此得出「Runner 依赖面上无任何可 import 的错误边界」。该测量方法对星号再导出失明:export *携带该类,但字面量Boundary不出现在入口文件里。runner 直接依赖@object-ui/react(workspace:*),因此可达的错误边界今天就存在,零改动 —— 这把处置从「删节 / 新造 API」变成了本 PR 的零成本就地改正。修后
改用
SchemaErrorBoundary,并补齐两段行文(裁决第 3 条要求,不写成「再包一层保险」的模糊句):SchemaRenderer自身已对每个被渲染组件内建一层边界(packages/react/src/SchemaRenderer.tsx:447-468),单个 widget 抛出只降级为行内 "failed to render" 提示 + Retry 按钮,不会白屏;链接到已记载此行为的/docs/guide/architecture-overview(该页 :115 已写 "wrapped in a per-componentErrorBoundary")。SchemaRenderer在此之前做的事 —— 求值visibleOn/disabled等动态表达式、经注册表解析组件类型 —— 都在它之外,那里的抛出会越过内建边界向外传播。故外层边界并非纯冗余,它多保护的正是这一类失败。另注明两个可选 prop(均据实现核对):
componentType决定 fallback 文案里的组件名,resetKey变化时清除错误并重挂子树(componentDidUpdate的自动恢复路径)。验证(先预测后运行,五条全中)
node_modules解析(走exports/types)tsc→ 绿import { SchemaErrorBoundary } from '@object-ui/react'→ exit 0error TS2305: Module '"@object-ui/react"' has no exported member 'ErrorBoundary'.exit 2componentType="grid"+resetKey={…}一并tscexit 0from '@object-ui/components'→ 0;@object-ui/app-shell→ 0;文件内 4 处ErrorBoundary全部是SchemaErrorBoundarycheck-doc-links+check-control-bytes绿Links are valid across 7 scan roots./OK (scanned 3684 tracked text file(s)))门禁敏感度反证(本 PR 新引入一条内部链接,故须证明 linkchecker 不是「静默放过」):临时追加一条同形但不存在的
/docs/...路由,check-doc-links报- [docs-route] content/docs/utilities/runner.mdx:604 -> /docs/guide/architecture-overview-THIS-DOES-NOT-EXIST,真实退出码 1;还原后与备份diff一致、再跑复绿。故上表末条的绿是真检出。控制字符自扫:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' content/docs/utilities/runner.mdx零命中(gate 扫描面之外的自查)。范围
content/docs/utilities/runner.mdx(+16 / -4)。packages/react。本 PR 只是引用一个早已随@object-ui/react发布的符号,不产生新的 semver 契约(这正是裁决 (b) 原本想守护、而 (A') 完整满足的那条红线)。content/,@object-ui/site本就在.changeset/config.json的ignore列表内。main;本 PR 锚定0cf8f0f70按内容重定位,不依赖行号。content/docs/utilities/runner.mdx §Add Custom Routes 教读者用 react-router-dom 改写 App.tsx,但 runner 不依赖它,路由是手写的 history.pushState #3618(同页### Add Custom Routes)未碰。未立新 issue(与原派发口径的差异,已获重裁确认)
原派发要求另立「
@object-ui/react是否公开导出SchemaErrorBoundary」特性 issue。未提交 —— 其前提已被上述测量证伪(该导出已存在),立单等于向路线图提交一个已成立的问题。先搜重确认无既有同类单(is:open SchemaErrorBoundary、is:open ErrorBoundary export react均只命中 #3635 本身)。重裁第 2 条已确认此判断。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code