Uh oh!
There was an error while loading. Please reload this page.
docs(plugin-report): README 按真实导出面重写三处虚构导出与陈旧幸存清单 - #5053
Conversation
`ReportBuilder`、`registerDrillHandler`、`ScheduleConfig` 三个名字都不在
`packages/plugin-report/src/index.tsx` 的导出面上。逐条核对 CHANGELOG 后判定:
三者都不是「改名」,而是 ADR-0021 9.0 切换时**已删除**的旧件,README 是那次
删除的幸存者。
- `ReportBuilder`:删除,本包不再有编辑器组件。Quick Start 改教真组件与真签名
(`ReportRenderer` 取 `schema`、`DatasetReportRenderer` 取 `report`、
`ReportViewer` 的 props 是 `{ schema, onRefresh }`)。
- `registerDrillHandler`:删除,机制也换了 —— 下钻是宿主回调
`onDrill?: (args: DatasetDrillArgs) => void`,导航归宿主(ADR-0021 D2)。
- `ScheduleConfig`:删除。排程是报表 schema 上的**数据**
(`ReportComponentSchema.schedule`,类型 `ReportScheduleConfig`);两个类型都在
`@object-ui/types`、本包不 re-export,示例改从那里导入,并按真签名
`createScheduleTrigger(report, dataSource, resource, onComplete)` 重写。
同一次删除的另两处遗留一并修正:陈旧幸存清单里的 `ReportBuilder`,以及
schema 示例中无组件注册的 `"type": "report-builder"`(真实注册的是 `report`/
`spec-report`/`report-viewer`)。两条断言已删机制的 feature 条目改为 dataset 形。
Fixes#5016
Co-authored-by: Claude <noreply@anthropic.com>✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
commented
Aug 17, 2026
本地验证读数(补正文第四节第 3 条)工位: 仓根 type-check 示例真编译(README 四个 tsx/ts 块 → scratch 文件, 依赖先建过再跑,避免 fresh worktree 的假红: 门禁 CI 终态(按 runs + 11 个 workflow run 全 草稿状态保留,未 undraft、未 merge。 Generated by Claude Code |
yinlianghui
commented
Aug 17, 2026
PM 验收:ACCEPT(session 实物核验:merge-base 恰为批次基线 验收要点:
派生物分诊(本评论即分诊记录):#5047(pre-9.0 查询形当现行教 + 三个退休 renderer 点名 —— migrate vs 标注 bridge 段是 ADR-0021 迁移口径,#4600 同族)→ 转 ready 并挂 auto-merge(squash)。 Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
…t types (#5138) objectui#5138 shape 2, as ruled: promote the snippet-extraction + `tsc --strict`-against-built-`dist` harness into `scripts/`, where it runs once in CI instead of three times by hand. The harness already existed three times, hand-rolled and private — in #5053, #5060 and #5047's PR — and each copy found defects its reviewer had not listed. This keeps the practice each one proved: extraction by script rather than by hand, resolution against the package's built `dist/*.d.ts` with a self-check that says so, and a planted sentinel export that must produce a diagnostic. The false-green mechanism #5047 measured is designed against structurally rather than noted: parse errors suppress semantic checking program-wide, so a run can print a few syntax errors, no semantic diagnostics at all, and read as a meaningful red. The two phases are separate here, unparseable blocks are reported and kept out of the semantic program, every failure line is tagged `[syntax]` or `[semantic]`, and the summary always states how many blocks the semantic phase actually judged. Fragments are declared, never guessed: a block that is not meant to compile carries a marker with a written reason immediately above its fence. A block that fails to parse is a failure, never a skip — the alternative turns every real defect into a silent skip. Coverage is declared too. A document is covered unless it is named in the script's ledger with a reason; the default is covered, so a new page is gated from the day it lands. 13 documents and 67 blocks are covered today; the 44 documents on the ledger are debt with names, and the script's header says plainly that they are unverified. Scope of the gate, stated in its header because an unstated blind spot is how this class stays green: it judges TypeScript resolvability only — not schema-key validity against the spec (#5138 shape 1, unruled), not `type`-literal registration (`check-doc-component-types.mjs`), and not shell examples (#5151).
Fixes#5016
packages/plugin-report/README.md教三个本包没有的导出。逐条判定后按 #5002 → PR #5021 的减法形重写:删虚构名、按真身重教,不加任何新导出。基线origin/main=dc9d651a2c55c10a9e4d30434e429e5fdc5ae968,改动 1 个 README + 1 个 changeset。一、逐条判定:未实现 vs 改名
三条都不是「改名」,也不是「从未实现」—— 是 ADR-0021 9.0 切换时已删除的旧件,README 是那次删除的幸存者。判据不是 grep,而是
packages/plugin-report/CHANGELOG.md:1284的原文::30/:33ReportBuilder当主编辑器组件ReportRenderer(dispatcher,取schema)、DatasetReportRenderer(取report)、ReportViewer:125-126registerDrillHandler(actionRunner, …)ReportRendererProps.onDrill?: (args: DatasetDrillArgs) => void(src/ReportRenderer.tsx:47-52)、DatasetReportRenderer.tsx:52-58的 ADR-0021 D2 注释onDrill+DatasetDrillArgs五个字段表,写明导航归宿主(renderer 只认 dimension 名):191-198ScheduleConfig当组件ReportScheduleConfig是类型,且不在本包ReportScheduleConfig定义在packages/types/src/reports.ts:254,由packages/types/src/index.ts:730导出,本包只 import(src/LiveReportExporter.ts:27)不 re-exportReportComponentSchema.schedule上的数据,类型从@object-ui/types导入;createScheduleTrigger按真签名(report, dataSource, resource, onComplete)→() => Promise< LiveExportResult[] >(src/LiveReportExporter.ts:245-251):155"ReportBuilder,ReportViewerand the export functions below remain"ReportViewer/LegacyReportRenderer+ 显式记下哪些是被删的,免得再被当成存活项加回来ScheduleConfig的真身是「类型ReportScheduleConfig(src/LiveReportExporter.ts:27/:82)」。类型确实存在,但那两行是 import 与使用,不是定义 —— 它在@object-ui/types,本包不 re-export,所以写成import type { ReportScheduleConfig } from '@object-ui/plugin-report'会是 TS2305。这正是 #5010 那条CalendarViewSchema同形陷阱,修法(改导入路径)与 #1、#2(删)不同。README 里把这一点明写了出来。二、名集合核对读数(导出面,非「src 里出现过」)
方法学按 #5010 评论:名集合取自 TypeScript program 对包入口
src/index.tsx的 exported symbols(checker.getExportsOfModule),不是 grep src —— 注释里的名字和「只 import 不 re-export 的邻居包名字」都会骗过后者。README 侧按 import 语句解析,含多行 import 块与内联type修饰符。导出面 25 名:
DatasetDrillArgs, DatasetReportRenderer, DatasetReportRendererProps, ExcelColumnConfig, LegacyReportRenderer, LegacyReportRendererProps, LiveExportOptions, LiveExportResult, ReportRenderer, ReportRendererProps, ReportRendererSchema, ReportViewer, ScheduleTriggerCallback, createScheduleTrigger, exportAsCSV, exportAsExcel, exportAsHTML, exportAsJSON, exportAsPDF, exportExcelWithFormulas, exportReport, exportWithLiveData, formatValue, isDatasetReport, mergeFilters改前(14 个自包命名导入 / 3 假):
改后(仍是 14 个自包命名导入 / 0 假 —— 数量没掉,所以这个绿不是「把 import 全删光」换来的):
跨包导入另行核对:
ReportComponentSchema(packages/types/src/index.ts:721)、ReportScheduleConfig(:730)均在@object-ui/types导出面上;示例里的字面量也对过 union ——frequency: 'monthly'∈ReportScheduleFrequency(reports.ts:47),formats: ['pdf','excel']⊂ReportExportFormat(:42)。三、每一节的「删因」
ReportBuilder示例< ReportViewer report={…} showToolbar />与< ReportRenderer title=… description=… chart={…} />也都不是真 props(见下方反向验证 (b)),照抄不编译registerDrillHandler整节(含 "Drill targets" 两条)drillDown.report侧抽屉那条也无对应读点,留着等于教一个不存在的 API 面### ScheduleConfig组件块"type": "report-builder"JSON 示例ComponentRegistry.register('report-builder', …)(ReportBuilderSchema只剩packages/types里的 zod/TS 声明),照抄得到一个解析不到组件的节点。改为列出真实注册的三个 type:8/:11useReportData()查询管线与ActionRunner派发的drillaction —— 正是 #1/#2 删掉的两个机制(src/index.tsx:33-37记了useReportData随 ADR-0021 一并移除)。不改会与重写后的正文自相矛盾:3"build, view, render"### Export小标题:158-161是一段无标题的悬空引导句(同一次删除留下的空洞),补回标题让该节可读四、验证
README不进编译,所以另外三条都是为「照抄可跑」做的实证:@object-ui/plugin-report指向构建产物packages/plugin-report/dist/index.d.ts(即消费者看到的公开类型面),@object-ui/types走仓根 paths →tsc --noEmit0 error。pnpm exec turbo run type-check --concurrency=2:确认工位干净(结果见下方评论)。node scripts/check-doc-links.mjs→Links are valid across 13 scan roots.(packages/*/README.md在其SCAN_ROOTS内);node scripts/check-control-bytes.mjs→ OK;改动文件grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'无命中;check-changeset-no-major通过。反向验证(两次,方向都是事先定好的)
(a) 核对流程自证 —— 预期方向:注入的假名被抓出,且能区分「src 里出现过」。往改后 README 的 import 里临时塞两个名字,一个纯虚构(
ReportBuilder)、一个在src/里出现两次但不在导出面上(ReportScheduleConfig,LiveReportExporter.ts:27/:82):两个都被抓出。
ReportScheduleConfig这一个是判别性的:若核对用的是「src 里出现过」的近似,它会被判 REAL —— 被判 FAKE 才证明读的是导出面。临时改动已还原,sha256与还原前逐字节相同(c13ebf21bbed…),未进 commit。(读数口径说明:我脚本的退出码经了管道,所以以上以读数为证,不以 exit code 为证。)
(b) 示例编译自证 —— 预期方向:把旧 README 的三处写法放回 scratch 文件,
tsc必须转红,且报的错要正好对上我改的三处。实测转红(rc=2),三条一一对应:即:旧 README 的
ReportViewer/ReportRenderer用法本来也编译不过,不只是三个假名的问题 —— 这是本次顺带修正的部分。(ReportBuilder/registerDrillHandler两个假名无法参与本项,它们连符号都不存在,由 (a) 覆盖。)五、changeset 口径(请复核一处取舍)
按派发口径写成
'@object-ui/plugin-report': patch(README 在本包 publishedfiles里,修正随下次 publish 到 npm)。同族先例 PR #5021 选的是空 frontmatter(「无代码/行为变更,不声明发版」),scripts/check-changeset-presence.mjs也认为本次不欠 changeset(0 of them under the src/)。两种都过门禁;若维护者更认 #5021 的口径,把 frontmatter 清空即可,一行改动。六、本单未修、已另立的发现(scope = 本 issue)
content/docs/plugins/plugin-report.mdx仍把前 9.0 查询形(objectName+columns+groupingsDown/Across)当作现行写法教,并点名三个已退休的 renderer(SpecReportGrid/MatrixRenderer/JoinedReportRenderer)。是 schema 形态问题,不是导出名问题,且牵涉 ADR-0021 迁移口径的取舍,不该由实施者代决。exportAsCSV(data, 'file.csv')passes a filename where the data argument goes #5048 —— README 三个导出示例的签名/参数序全错(名字都是真的,所以名集合核对看不见):exportAsCSV(reportData, 'sales-report.csv')把文件名传进了data位;exportWithLiveData缺必填dataSource/resource;exportExcelWithFormulas少一个参数且列键应为name而非field。两条都先搜过在开 issue(关键词 + 文件路径),无重复;均未打
finding标签,交 PM 分诊。