fix(console): binding-reach 探针少报了自己 6 个块的覆盖面,而且是静默的 (#3149 第 1 层) - #3153
Merged
Conversation
`public-block-binding-reach.test.tsx` 靠 `getPublicConfigs()` 里"有没有 objectName
输入"来选候选。但 console 对多数对象块走 `registerLazy`,而 pending stub 不带
`inputs`——`Registry.getMeta` 的注释原话是:consumer 应当把这当成"还不知道",**不是**
"没声明"。过滤器当成了后者,于是 `object-chart` / `object-kanban` /
`object-calendar` / `object-gantt` / `object-timeline` / `object-map` 六个 Tier A 块
(每一个都把 `objectName` 声明为 required)整批落出候选集,而套件报告"八个探针全绿、
无缺口"。
这是 objectui#2953 的形状(lazy 注册悄悄掉出契约)在消费端复发,也是 objectstack#4472
的形状在那个**为了回答它而写的套件**内部复发:声明的作用域比实际够得着的范围宽。原来
的覆盖守卫看不见——`length > 0` 和 `toContain('object-form')` 在 8/14 的时候都是真的。
- 候选筛选前,先经注册表自己的 `loadLazy` 解析所有 pending 的 public lazy 条目。用注册表
记录的 loader,不是在测试里手写一份插件 import 清单——那份清单会和
`register-plugins.ts` 脱节,换条路把同样的缩水再引入一次。
- 守卫改成**精确**候选清单,照搬 `public-contract.test.ts` 已经写明的教训:失败模式是集合
变小,只有精确比较能让两个方向都成为 deliberate edit。已用"关掉解析"模拟回归验证:断言
变红并列出缺失的块。
六个块的接线本来就是对的(`ObjectChart` 自己读 context;gantt/timeline/map 与
kanban/calendar 有 context→prop wrapper),所以没有发现新的 #3144 类缺陷。倒是又抓出两个
探针自身的假信号——同一个教训的第三、第四次:给每个输入一个合理值,不等于一份合理的**配置**。
- **`data` 会盖掉绑定**。`ObjectChart` 的取数判据是
`if ((schema.objectName || schema.dataset) && !boundData && !schema.data)`,而 spec 对
`data` 的注释就是"直接图示静态数据,**取代**经 objectName 绑定"。填了它再报告
"objectName 没到达数据层",等于探针自造发现。现在把这类"盖掉绑定"的输入排除,范围很窄,
并且把判据原文抄在注释里,让下一个读的人能核而不是只能信。
- **卸载不是被测对象**。`object-map` 挂 maplibre-gl,其 `map.remove()` 在 jsdom 里因为没有
WebGL context 而抛异常。现在 unmount 被 catch,断言只讲数据到达;**渲染**期抛的异常仍然
照常传播。
覆盖面:14/14 个对象绑定 public block。#3149 的其余部分——objectName 之外的绑定、
record:* 家族在 record context 下、以及展示原语——未动,仍然开着。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3cP1eY1novcNhQEDBrSZD
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
August 1, 2026 12:29
This was referenced Aug 1, 2026
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 free
to 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.
#3149 的第 1 层。第 2、3 层(objectName 之外的绑定、record:* 家族、展示原语)未动,issue 仍开着。
缺陷
public-block-binding-reach.test.tsx(#3146)靠getPublicConfigs()里"有没有objectName输入"选候选。但 console 对多数对象块走registerLazy,pending stub 不带inputs——Registry.getMeta的注释原话:过滤器当成了后者。于是这六个整批落出候选集,而套件报告"八个探针全绿、无缺口":
object-chartplugin-charts/src/index.tsx:64objectNamerequiredobject-kanbanplugin-kanban/src/index.tsx:359objectNamerequiredobject-calendarplugin-calendar/src/index.tsx:37objectNamerequiredobject-ganttplugin-gantt/src/index.tsx:67objectNamerequiredobject-timelineplugin-timeline/src/index.tsx:321objectNamerequiredobject-mapplugin-map/src/index.tsx:30objectNamerequired这是 #2953 的形状(lazy 注册悄悄掉出契约)在消费端复发,也是 objectstack#4472 的形状在那个为了回答它而写的套件内部复发:声明的作用域比实际够得着的范围宽。原来的守卫看不见——
length > 0和toContain('object-form')在 8/14 的时候都是真的。改了什么
loadLazy解析所有 pending 的 public lazy 条目。用注册表记录的 loader,不是在测试里手写一份插件 import 清单——那份清单会和register-plugins.ts脱节,换条路把同样的缩水再引入一次。public-contract.test.ts已写明的教训:失败模式是集合变小,toContain会径直放过)。结果:没有新缺陷,但抓出两个探针假信号
六个块的接线本来就是对的——
ObjectChart自己读 context(ObjectChart.tsx:253:props.dataSource || context?.dataSource,所以裸注册在它这里是安全的),gantt/timeline/map 与 kanban/calendar 都有 context→prop wrapper。没有第三个 #3144。倒是又抓出两个探针自身的假信号,同一个教训的第三、第四次——给每个输入一个合理值,不等于一份合理的配置:
data会盖掉绑定。ObjectChart的取数判据是if ((schema.objectName || schema.dataset) && !boundData && !schema.data),而 spec 对data的注释就是"直接图示静态数据,取代经 objectName 绑定"。填了它再报告"objectName 没到达",是探针自造发现。现在排除这类"盖掉绑定"的输入,范围很窄,判据原文抄在注释里,让下一个人能核而不是只能信。object-map挂 maplibre-gl,其map.remove()在 jsdom 里因为没有 WebGL context 抛异常。unmount 被 catch,断言只讲数据到达;渲染期抛的异常仍照常传播。验证
apps/console全套 27 tests 全绿(16 binding-reach + 11 public-contract)。特别确认public-contract.test.ts的EXPECTED_LAZY精确断言不受影响——console 项目isolate: true,loadLazy的注册表变更不跨文件泄漏resolveLazyPublicBlocks()关掉,套件从 16 掉到 10,新断言变红并列出缺失的object-chart/object-map等no-explicit-anywarning)、tsc --noEmit在该文件零错误覆盖面:14/14 个对象绑定 public block。
🤖 Generated with Claude Code
https://claude.ai/code/session_01S3cP1eY1novcNhQEDBrSZD
Generated by Claude Code