Commit 5eaa861
`SchemaRenderer` 把 dataSource 放在 `SchemaRendererContext` 上,**从不**注入组件
props。所以任何从 `props.dataSource` 读取的组件,都需要注册处包一层把二者桥接起来。
`object-form` / `object-kanban` / `object-calendar` 一直都有这层。这两个没有:
- `list-view`(以及 `view:list` 别名)直接注册裸 `ListView`,而 `ListView.tsx:585`
是 `const dataSource = props.dataSource` —— 于是取 object schema 的那个 effect
直接 return,永远不取数,渲染出 `data-testid="empty-state"` 的 "Nothing here"。
- `embeddable-form` 的渲染器是 `({ schema }) => <EmbeddableForm config={schema} />`,
把 context 整个丢了 —— 内层 ObjectForm 用来取字段的那个只读源(`formDataSource`)
永远构造不出来,而提交路径 `if (dataSource) await dataSource.create(...)` 也没东西
可调:公开表单会"提交成功"却什么都没写。
两者的 registry `inputs` 都把 `objectName` 标为 **required**。协议逼作者填、而这条
路径上没有任何东西读得到的绑定,就是 objectstack#4413 的形状往上挪了一层。之所以一直
没人报,是因为 console 走的不是这条路:它经 `ObjectView` 的 `renderListView`
render-prop,由宿主自己把 dataSource 递进去。应用内是好的,注册表/SDUI 路径是坏的
——而后者正是 sdui.manifest.json 描述的那份契约、`kind:'react'` 页面走的那条路。
发现自 `public-block-binding-reach.test.tsx`(objectstack#4472),不是人肉读出来的。
那个台账把这两条记为具名欠债;桥接一加上,台账的双向断言**立刻变红,直到条目被删掉**
——机制按设计工作。现在只剩 `record:related_list`,且是合理的。
显式传入的 `dataSource` prop 仍然优先,宿主自带数据源的用法不受影响;
`ListViewRenderer` 用 forwardRef,`ListViewHandle` 经注册表仍可用。
验证:plugin-list / plugin-form / plugin-view 三个包 53 files / 662 tests 全绿;
两个包 `turbo type-check`(依赖已构建)clean;console 21 tests 全绿,其中把这两条塞回
台账会立刻变红("now reaches the data layer — delete its NO_DATA_REACH entry")。
Closes #3144
Claude-Session: https://claude.ai/code/session_01S3cP1eY1novcNhQEDBrSZD
Co-authored-by: Claude <noreply@anthropic.com>
1 parent cc70b8f commit 5eaa861
4 files changed
Lines changed: 94 additions & 28 deletions
File tree
- .changeset
- apps/console/src/__tests__
- packages
- plugin-form/src
- plugin-list/src
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Lines changed: 14 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
118 | 115 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
133 | 123 | | |
134 | 124 | | |
135 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
25 | 57 | | |
26 | | - | |
| 58 | + | |
27 | 59 | | |
28 | 60 | | |
29 | 61 | | |
| |||
63 | 95 | | |
64 | 96 | | |
65 | 97 | | |
66 | | - | |
| 98 | + | |
67 | 99 | | |
68 | 100 | | |
69 | 101 | | |
| |||
0 commit comments