Skip to content

Commit 7fc6d14

Browse files
committed
chore(changeset): grade the batch 4 convergence for types, core, fields and app-shell (objectui#6349)
Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
1 parent c2d2567 commit 7fc6d14

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@object-ui/app-shell': minor
3+
---
4+
5+
The metadata-admin widget registry's labelling vocabulary (`WidgetLabelling`) and the dashboard widget inspector's `labelling` prop are typed against `@object-ui/core`'s `RegistryComponentMeta['labelling']` instead of `ComponentMeta['labelling']` (objectui#6349, batch 4). `@object-ui/core`'s `ComponentMeta` is now the general component metadata and no longer carries `labelling`; the registration type that does is `RegistryComponentMeta`.
6+
7+
**Breaking-change note.** Nothing breaks for a consumer of this package: both types still resolve to the same `'control' | 'group'` vocabulary, and no runtime behaviour changes. The breaking half of this rename is `@object-ui/core`'s, recorded in its changeset.

‎.changeset/6349-batch4-core.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
'@object-ui/core': minor
33
---
44

5-
`ActionContext` is re-exported from `@object-ui/types` instead of declared a second time (objectui#6349, batch 4), so an import of the name from either package is the same type.
5+
`ActionContext`, `ActionResult`, `UndoableOperation` and `ComponentMeta` are re-exported from `@object-ui/types` instead of declared a second time here (objectui#6349, batch 4), so an import of any of these names from either package is the same type. The registry's own registration type gets its own name, `RegistryComponentMeta`.
66

7-
**Type change, breaking for some consumers.** The runner's copy typed `record` and `user` as `any`; the one declaration types both as `Record<string, any>`. A non-object `record` or `user` on a value typed `ActionContext` no longer type-checks, and under `strict` a read such as `context.record.id` now needs optional chaining (`context.record?.id`). `data`, `selectedRecords`, `pageVariables` and the index signature are unchanged. No runtime behaviour changes.
7+
**Type changes, breaking for some consumers.**
8+
9+
- **`ComponentMeta` from this package no longer carries the five registry-only keys** (`tier`, `namespace`, `skipFallback`, `labelling`, `deprecated`). It used to be this package's registration type, `@object-ui/types`' `ComponentMeta` plus those keys, published under the general name. That type is now `RegistryComponentMeta`, with the same members. `ComponentRegistry.register`, `registerLazy` and `getMeta` are typed with it, so a registration literal passed straight to them still compiles. Code that annotates a value as `ComponentMeta` from `@object-ui/core` and writes or reads one of the five keys must use `RegistryComponentMeta` instead (for example `RegistryComponentMeta['labelling']`).
10+
- `ActionContext`: the runner's copy typed `record` and `user` as `any`; the one declaration types both as `Record<string, any>`. A non-object `record` or `user` on a value typed `ActionContext` no longer type-checks, and under `strict` a read such as `context.record.id` now needs optional chaining (`context.record?.id`). `data`, `selectedRecords`, `pageVariables` and the index signature are unchanged.
11+
- `ActionResult` and `UndoableOperation` keep their members exactly; only their declaring package moves.
12+
13+
No runtime behaviour changes.

‎.changeset/6349-batch4-fields.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@object-ui/fields': minor
3+
---
4+
5+
`FIELD_WIDGET_LABELLING` is typed against `@object-ui/core`'s `RegistryComponentMeta['labelling']` instead of `ComponentMeta['labelling']` (objectui#6349, batch 4). `@object-ui/core`'s `ComponentMeta` is now the general component metadata and no longer carries `labelling`; the registration type that does is `RegistryComponentMeta`.
6+
7+
**Breaking-change note.** Nothing breaks for a consumer of this package: the export's value type still resolves to the same `'control' | 'group' | 'display'` vocabulary, and no runtime behaviour changes. The breaking half of this rename is `@object-ui/core`'s, recorded in its changeset.

‎.changeset/6349-batch4-types.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
'@object-ui/types': minor
33
---
44

5-
`ActionContext` has one declaration again (objectui#6349, batch 4). `@object-ui/core` used to declare a second `ActionContext` in its action runner; it now re-exports this package's, so both packages publish the same type under the name.
5+
`ActionContext` and `ActionResult` each have one declaration again, here, and `UndoableOperation` is published from this package (objectui#6349, batch 4). `@object-ui/core` used to declare second copies of `ActionContext`, `ActionResult` and `UndoableOperation`; it now re-exports these, so both packages publish the same types under those names.
66

7-
**Type change.** `ActionContext` gains a declared `data?: Record<string, any>` member, the one member only the runner's copy declared (the runner reads it as the fallback record id and as an API request body). Before, `data` was reached only through the index signature, as `any`. A write of a non-object `data` on a value typed `ActionContext` no longer type-checks. No other member changes.
7+
**Type changes, breaking for some consumers.**
8+
9+
- `ActionContext` gains a declared `data?: Record<string, any>` member, the one member only the runner's copy declared (the runner reads it as the fallback record id and as an API request body). Before, `data` was reached only through the index signature, as `any`. A write of a non-object `data` on a value typed `ActionContext` no longer type-checks.
10+
- `ActionResult` becomes the runner's contract. It gains `reload`, `redirect`, `modal`, `silent` and `undo` (typed `UndoableOperation`). Its `refresh` member is **removed**: the runner reads `reload`, and nothing read or wrote `refresh`, so a handler that set it was ignored at runtime. A result literal naming `refresh` is now a compile error; write `reload` instead.
11+
- `UndoableOperation` (the `undo` payload: `id`, `type`, `objectName`, `recordId`, `timestamp`, `description`, `undoData`, `redoData`) is a new export, moved down from `@object-ui/core` with the same members.
12+
13+
No runtime behaviour changes.

0 commit comments

Comments
 (0)