|
| 1 | +--- |
| 2 | +'@object-ui/types': minor |
| 3 | +'@object-ui/plugin-detail': patch |
| 4 | +--- |
| 5 | + |
| 6 | +`record:related_list` accepts `relationshipValueField`, and three record |
| 7 | +renderers stop erasing their own props annotation (objectui#8649). |
| 8 | + |
| 9 | +**`@object-ui/types` — `RecordRelatedListComponentProps` gains |
| 10 | +`relationshipValueField?: string`.** Nothing that worked stops working; a |
| 11 | +document that was already valid everywhere else stops being refused here. |
| 12 | +`@objectstack/spec` declares the key (`RecordRelatedListProps.relationshipValueField`, |
| 13 | +`z.string().default('id')`), `RecordRelatedListRenderer` has always read it, and |
| 14 | +`@object-ui/plugin-detail`'s registry has published it as an input since |
| 15 | +objectui#3808 — every layer declared it except this published TypeScript face: |
| 16 | + |
| 17 | +```ts |
| 18 | +// before — TS2353, while the platform accepted the same document |
| 19 | +const props: RecordRelatedListComponentProps = { |
| 20 | + objectName: 'task', relationshipField: 'account', relationshipValueField: 'name', |
| 21 | +}; |
| 22 | +// after — accepted, with the contract's own type |
| 23 | +``` |
| 24 | + |
| 25 | +This is an **alignment, not a widening**: the accept set of this face moves to |
| 26 | +the contract's and never past it. The pin that says so re-derives the contract |
| 27 | +side on every run rather than restating it |
| 28 | +(`packages/plugin-detail/src/renderers/__tests__/detailRendererUndeclaredKeys-8649.test.ts`). |
| 29 | + |
| 30 | +**`@object-ui/plugin-detail` — the annotation-erasing destructure default is |
| 31 | +gone from three renderers.** `record-details.tsx`, `record-highlights.tsx` and |
| 32 | +`record-related-list.tsx` each annotated `schema` correctly and then wrote |
| 33 | +`schema = {} as any`. A destructuring default's type joins the annotated |
| 34 | +property type at the binding, so `any` erased the annotation for *every* read |
| 35 | +site in the file — declared keys and undeclared ones alike read `any`. No |
| 36 | +published surface moves: the exported annotations were always correct. |
| 37 | + |
| 38 | +The repair made the compiler name a latent contract violation the `any` had |
| 39 | +hidden, and it is fixed here: `RecordRelatedListBody` passed a possibly-unbound |
| 40 | +`objectName` into `ResolveRelatedRecordActionsInput.objectName`, which is |
| 41 | +`string`. The call is now gated on the key being bound. **Output-identical**, |
| 42 | +both halves measured rather than assumed — `resolve` is pure and its only use of |
| 43 | +the key (`objects.find((o) => o?.name === objectName)`) finds nothing for |
| 44 | +`undefined` and returns `{}`, and the result is discarded on that path by the |
| 45 | +`if (!objectName)` placeholder return. |
| 46 | + |
| 47 | +**`record:reference_rail` declares the node-level `properties` envelope it |
| 48 | +reads, and the read now uses the declaration.** The renderer accepts a node |
| 49 | +either flattened (`schema.entries`) or enveloped (`schema.properties.entries`). |
| 50 | +The enveloped read went through an explicit `(schema as any)` cast — **not** |
| 51 | +through the schema type's `[k: string]: any`, which had nothing to do with it — |
| 52 | +so `entries` arrived as `any` on that path. Both halves are fixed here: the |
| 53 | +member is declared **and** the cast is removed, so the checker types the read |
| 54 | +`ReferenceRailEntry[]` (the trailing `as ReferenceRailEntry[]` assertion went |
| 55 | +with it — the declared type supplies it). `properties` is `@objectstack/spec`'s |
| 56 | +own node-level key (`PageComponentSchema.properties`, "Component props passed to |
| 57 | +the widget") with the standing `dataSource` and `className` have. Declaring it |
| 58 | +**narrows** an accept this face already granted through its index signature — it |
| 59 | +widens nothing, and `properties` itself stays open because the contract declares |
| 60 | +it as a record. |
| 61 | + |
| 62 | +⚠️ Declaring a member is not enough on its own when the read site casts: a cast |
| 63 | +defeats the declaration while a membership instrument still reports the member |
| 64 | +as present. The pin now fails if the cast returns. |
| 65 | + |
| 66 | +⚠️ **Three keys are deliberately NOT declared, and no runtime behaviour |
| 67 | +changes.** `enforceFieldSecurity`, `redactFields` and `requiredPermissions` are |
| 68 | +read by all three renderers and are **routed to the producer**, not declared |
| 69 | +here and not retired here. Measured on the installed contract over the block-tag |
| 70 | +map `ComponentPropsMap` — the authoring surface an author writes into — plus the |
| 71 | +node envelope every block shares, with controls in the same pass: |
| 72 | + |
| 73 | +``` |
| 74 | +enforceFieldSecurity · redactFields declared by no block, and not on the node |
| 75 | +requiredPermissions declared by exactly one block, |
| 76 | + `record:quick_actions`, and by none of |
| 77 | + record:details / :highlights / :related_list |
| 78 | +aria · fields declared by many blocks <- CONTROL |
| 79 | +zzqx_no_such_key declared by none <- CONTROL |
| 80 | +``` |
| 81 | + |
| 82 | +Declaring them here would make this repo accept what the platform refuses; |
| 83 | +retiring the reads would delete a redaction that works today on the raw-node |
| 84 | +path. Both keys stay honoured exactly as before, and the census above is a test, |
| 85 | +so it goes red the day the platform declares one of them. |
0 commit comments