Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .changeset/9256-remeasure-content-channels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
'@object-ui/types': minor
---

**BREAKING (shipped as `minor` — see below):** thirteen node types now refuse
both content channels by name. Each one's renderer reads neither `body` nor
`children`, so an authored child list on it rendered nothing, with no
render-time error or warning and no element; only the parser tier's
`not-a-container` warning (objectui#9910) noticed it (objectui#9256).

- `markdown`, `chart`, `bar-chart`, `code-editor`, `detail`, `report`: both keys
are now `?: never` on the TypeScript face (`MarkdownSchema`, `ChartSchema`,
`BarChartSchema`, `CodeEditorSchema`, `DetailSchema`,
`ReportComponentSchema`) and a by-name refusal on the zod mirror, each kept a
member of the mirror shape.
- `list-view`: a by-name refusal on the zod mirror. `ListViewSchema`'s
TypeScript face is derived from that mirror, so it refuses both keys too.
- `page-designer`, `data-model-designer`, `process-designer`,
`report-designer`, `object-manager`, `field-designer`: `?: never` on the
TypeScript face (`PageDesignerSchema`, `DataModelDesignerSchema`,
`ProcessDesignerSchema`, `ReportDesignerSchema`, `ObjectManagerSchema`,
`FieldDesignerSchema`). None of them has a zod mirror, so the TypeScript face
is the only one that changes.

What moves for an author:

- `children` on any of these nodes type-checked, and parsed green where a zod
mirror exists; it is now refused at authoring time and, where a zod mirror
exists, at `safeParse` time, at its own path.
- `body` was already refused on these faces, by `BaseSchema`. On the zod
mirrors its refusal message now names what the node renders instead, where
it used to point at `children`, which these nodes do not read either.

No render behaviour changes: nothing read these keys, which is the whole reason
they could be refused.

Migration: each of these nodes renders from its own keys, so there is no channel
to move the content to. Put it in the key the node does render (`markdown`'s
`content`, a `detail` tab's `content`, a chart's `data`), place it beside the
node in a container that reads `children`, or drop it.

`minor` rather than `major` because this repo's version policy forbids `major`
in any changeset — one `fixed` group — and records `minor` plus an explicit
breaking note as the spelling for a breaking change here.
294 changes: 294 additions & 0 deletions packages/types/src/__tests__/content-channel-remeasure-9256.test.ts

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions packages/types/src/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,40 @@ export interface DetailSchema extends BaseSchema {
* @default false
*/
loading?: boolean;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `detail` reads NEITHER
* content channel; see `children` below for the measurement.
*
* {@link BaseSchema} already refuses `body` (objectui#6771), but its
* refusal names `children` as the remedy, which this node does not read
* either. The member is restated here so the refusal points at what the
* node renders instead.
*
* @deprecated Not a channel `detail` reads — nothing renders it.
*/
body?: never;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `detail` reads NEITHER
* content channel, so an authored child list here rendered NOTHING: no
* render-time error or warning and no element; only the parser tier's
* `not-a-container` warning (objectui#9910) noticed it.
*
* Measured with the TypeScript type checker, not grep, over one program per
* workspace package on a built tree (the family-D re-measure). The bare
* `detail` key is owned by `view:detail` (`@object-ui/plugin-detail`),
* which hands the node to `DetailView`; `DetailView` reads it as
* `DetailViewSchema`, and no `body` or `children` read is filed under that
* type. `SchemaRenderer` strips `body` and `children` out of the props bag
* it spreads, so neither reaches the component by another route, and the
* registration declares no `children` slot (objectui#9910).
*
* What it renders instead: the record named by `objectName` and
* `resourceId`, laid out by `DetailView` from `fields`, `sections` and
* `tabs`.
*
* @deprecated Not a channel `detail` reads — nothing renders it.
*/
children?: never;
}

/**
Expand Down
98 changes: 98 additions & 0 deletions packages/types/src/data-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,38 @@ export interface MarkdownSchema extends BaseSchema {
* @deprecated Not part of `MarkdownSchema`'s contract — the value was inert.
*/
components?: never;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `markdown` reads NEITHER
* content channel; see `children` below for the measurement.
*
* {@link BaseSchema} already refuses `body` (objectui#6771), but its
* refusal names `children` as the remedy, which this node does not read
* either. The member is restated here so the refusal points at what the
* node renders instead.
*
* @deprecated Not a channel `markdown` reads — nothing renders it.
*/
body?: never;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `markdown` reads NEITHER
* content channel, so an authored child list here rendered NOTHING: no
* render-time error or warning and no element; only the parser tier's
* `not-a-container` warning (objectui#9910) noticed it.
*
* Measured with the TypeScript type checker, not grep, over one program per
* workspace package on a built tree (the family-D re-measure). The
* `markdown` registration (`@object-ui/plugin-markdown`) reads the node
* through an inline props type and forwards only `content` and `className`
* to the Markdown implementation; nothing on that path reads the node's
* `body` or `children`. `SchemaRenderer` strips `body` and `children` out
* of the props bag it spreads, so neither reaches the component by another
* route, and the registration declares no `children` slot (objectui#9910).
*
* What it renders instead: `content`, rendered as sanitized Markdown.
*
* @deprecated Not a channel `markdown` reads — nothing renders it.
*/
children?: never;
}

/**
Expand Down Expand Up @@ -2322,6 +2354,39 @@ export interface ChartSchema extends BaseSchema {
* segment opens a filtered list view (drawer/dialog).
*/
drillDown?: DrillDownConfig;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `chart` reads NEITHER content
* channel; see `children` below for the measurement.
*
* {@link BaseSchema} already refuses `body` (objectui#6771), but its
* refusal names `children` as the remedy, which this node does not read
* either. The member is restated here so the refusal points at what the
* node renders instead.
*
* @deprecated Not a channel `chart` reads — nothing renders it.
*/
body?: never;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `chart` reads NEITHER content
* channel, so an authored child list here rendered NOTHING: no render-time
* error or warning and no element; only the parser tier's `not-a-container`
* warning (objectui#9910) noticed it.
*
* Measured with the TypeScript type checker, not grep, over one program per
* workspace package on a built tree (the family-D re-measure). The `chart`
* registration (`@object-ui/plugin-charts`, and its `chart:bar` alias)
* reads the node through `ChartRenderer`'s inline props type; nothing on
* that path reads the node's `body` or `children`. `SchemaRenderer` strips
* `body` and `children` out of the props bag it spreads, so neither reaches
* the component by another route, and the registration declares no
* `children` slot (objectui#9910).
*
* What it renders instead: a chart of the `data` rows, drawn by `chartType`
* and `series`.
*
* @deprecated Not a channel `chart` reads — nothing renders it.
*/
children?: never;
}

/**
Expand Down Expand Up @@ -3314,6 +3379,39 @@ export interface BarChartSchema extends BaseSchema {
* @default '#8884d8'
*/
color?: string;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `bar-chart` reads NEITHER
* content channel; see `children` below for the measurement.
*
* {@link BaseSchema} already refuses `body` (objectui#6771), but its
* refusal names `children` as the remedy, which this node does not read
* either. The member is restated here so the refusal points at what the
* node renders instead.
*
* @deprecated Not a channel `bar-chart` reads — nothing renders it.
*/
body?: never;
/**
* REFUSED BY NAME (objectui#9256, ADR-0049) — `bar-chart` reads NEITHER
* content channel, so an authored child list here rendered NOTHING: no
* render-time error or warning and no element; only the parser tier's
* `not-a-container` warning (objectui#9910) noticed it.
*
* Measured with the TypeScript type checker, not grep, over one program per
* workspace package on a built tree (the family-D re-measure). The
* `bar-chart` registration (`@object-ui/plugin-charts`) reads the node
* through `ChartBarRenderer`'s inline props type, which forwards `data`,
* `dataKey`, `xAxisKey`, `height`, `className` and `color` and nothing
* else. `SchemaRenderer` strips `body` and `children` out of the props bag
* it spreads, so neither reaches the component by another route, and the
* registration declares no `children` slot (objectui#9910).
*
* What it renders instead: one bar per `data` row, its value from `dataKey`
* and its category from `xAxisKey`.
*
* @deprecated Not a channel `bar-chart` reads — nothing renders it.
*/
children?: never;
}

/**
Expand Down
Loading
Loading