Skip to content

gen:docs 把数组内的 passthrough 对象渲染成 Record<string, any>[],抹掉已声明键 —— #4001 战役每个 open 分类站点都会复发 #4912

Description

@xuyushun441-sys

从 PR #4909(bulk-action options.passthrough())的执行报告转立案,发现者为该单 dev,记录在报告的 out_of_scope_findings 里但未立案 —— 这里补上(PD#10)。未认领。

症状

gen:docs 对「数组元素是 .passthrough() 对象」的站点,把参考页上的类型渲染成 Record<string, any>[],把已声明键的形状整个抹掉。实例见 PR #4909content/docs/references/ui/bulk-action.mdx diff:

- | **options** | `{ label: string; value: string \| number \| boolean }[]` | …
+ | **options** | `Record<string, any>[]` | …

options 仍有两个必填键(label / value,零容忍缺失,测试钉着),但作者面文档显示成「无形状」。一个有形状、部分开放的对象,在文档上退化成完全无形状 —— 正是 strip 时代那种「声明与呈现不符」反过来。

为什么会复发

#4001 战役的分类规则会持续产出「declared 键 + 刻意 passthrough」的站点(dashboard widget configBulkActionParamSchema 本体等已是;后续 data/ 的 mixed 裁定还会新增)。每个这样的站点落地那天,它的参考页都会把声明的键抹掉。#4909 用该键的 .describe() 手工补了散文 —— 那是逐点补偿,不是修复。

建议修法

渲染器对 passthrough 对象输出「声明键的完整形状 + 开放性标记」(如 { label: string; value: … } & Record<string, unknown> 或表格 + 「接受额外键」一行),而不是塌缩成 Record<string, any>。落点在 packages/spec/scripts 的文档生成(build-docs / json-schema 投影),动之前按战役规矩先在 bulk-action 这个已知站点上证红。

关联:#4001(战役)、PR #4909(实例与临时补偿)、#4852(台账重测)。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions