Skip to content

Commit 3bfb357

Browse files
refactor(components)!: retire the unused ViewSkeleton dispatcher and ShimmerSkeleton (#27388)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8MCjwDfBRBbh1qJBm2tbXAr)_ Fixes #25915 Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:从 `@object-ui/components` 的发布入口删掉两个没人用的组件:`ViewSkeleton`(按 variant 分发的骨架屏包装,连同它的两个类型)和 `ShimmerSkeleton`(连同其 props 类型)。 - 为什么改:裁决 B 收尾本卡;两者在整个工作区零导入,只是挂在公开面上的死导出。 - 风险与回滚:对外是破坏性变更(外部宿主若导入会编译失败),changeset 带 BREAKING 说明与逐个 FROM → TO 迁移;仓内零调用方。回滚即恢复两处导出。`GridSkeleton` 等其余骨架屏照常导出。 - 先看:`ui/packages/components/src/custom/view-skeleton.tsx`(只删分发器);`.changeset/25915-retire-view-and-shimmer-skeleton.md`(迁移说明与 ADR-0087 标记)。 - 两分钟验证:`git grep -nwE "ViewSkeleton|ShimmerSkeleton" -- ui ':!*CHANGELOG.md'`,预期零命中。 - 需要你做的:无,席位落地(合并前需 `CONTRACT_REVIEW_TIER` 契约复核,席位转交分诊)。 ## What changes - `ui/packages/components/src/custom/view-skeleton.tsx`: the `ViewSkeleton` variant dispatcher leaves, with `ViewSkeletonVariant` and `ViewSkeletonDispatchProps`. The file stays and keeps exporting `GridSkeleton`, `KanbanSkeleton`, `FormSkeleton`, `ListSkeleton`, `ChartSkeleton` and the `ViewSkeletonProps` / `GridSkeletonProps` / `KanbanSkeletonProps` types. `GridSkeleton` and `ChartSkeleton` have live importers (`plugin-dashboard`, `plugin-charts`). - `ui/packages/components/src/custom/shimmer-skeleton.tsx` is deleted (`ShimmerSkeleton`, `ShimmerSkeletonProps`), and so is its `custom/index.ts` line. - `ui/packages/app-shell/src/styles.css`: the `animate-shimmer` usage comment no longer points at `ShimmerSkeleton`. The keyframe and utility stay. - Changeset `@object-ui/components` `patch`: a BREAKING note, a FROM → TO line for each of the five retired exports, and an `adr-0087: not-required (runtime-export-retired …)` marker naming all five. `patch` because `Metadata-protocol: none` (AGENTS.md Post-Task Checklist step 3: a non-protocol change, breaking included, ships `patch` and keeps its BREAKING banner). Not touched, per ruling B (6486367718): `KanbanSkeleton`, `FormSkeleton` and `ListSkeleton` lose their only caller (the dispatcher) but stay exported. The Studio empty states and `DataEmptyState` are not touched either. ## Tests No new test. The removal is proven once on the built package (below), not pinned by a permanent file. The claim's file surface names no test file. ## Acceptance notes - Owes one `CONTRACT_REVIEW_TIER` contract review of the whole non-prose diff before the queue: `pm-dispatch` `references/contract-review.md` puts a `Clause-②: no (narrowing)` declaration at that tier. The seat hands it to triage. It is not Tier H, because no governed path is touched. - ADR-0145 does not govern this: it covers `?: never` tombstones on the ui authoring face, not React runtime exports. ## Verification All readings at head `8e055464` (base `c4c515ad`, #27366's merge). <details><summary>Build, type-check, tests and the removal proof</summary> - `pnpm --filter @object-ui/components build` under `os-verify-lock`: VERDICT command-exit 0. `pnpm --filter @object-ui/components type-check`: VERDICT command-exit 0, 0 `error TS`. - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/` under the lock: VERDICT command-exit 0, Test Files 447 passed | 1 skipped (448), Tests 4327 passed | 24 skipped. This includes `chart-primitives-removed-7397.test.ts`, which reads the package barrel and requires `ChartSkeleton` to stay exported. - Removal proof on the built `dist/`: `grep -cw` reads 0 for each of `ViewSkeleton`, `ViewSkeletonVariant`, `ViewSkeletonDispatchProps`, `ShimmerSkeleton` and `ShimmerSkeletonProps`, in `index.js` and in `custom/view-skeleton.d.ts`. `custom/shimmer-skeleton.d.ts` is not emitted, and `custom/index.d.ts` has no shimmer line. Control: `GridSkeleton` reads 2 in `custom/view-skeleton.d.ts` and 1 in `index.js`. - Importers before the change, `git grep -w` over `ui`, `packages`, `apps` and `examples` (CHANGELOGs and the two files themselves excluded): 0 for all five. The only other hit was the `styles.css` comment this PR rewords. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0, with no anchored file in the change set. </details> <details><summary>Gates and dogfood</summary> - `dispatch-gates --commands --repo objectstack-ai/objectstack` derived 28 families. All 28 ran, each with its exit code captured before any pipe, and all exited 0. `check-adr-0087-registration --base origin/main` verified the `runtime-export-retired` marker for all five operands. `--ran` reconciliation: 28 derived, 28 run, 0 NOT-MEASURED. - `pnpm --dir ui exec vitest run scripts/` first read 1 failed. The failure was `quick-reference-commands-4149` naming `apps/site`: a leftover `ui/apps/site` directory holding only ignored files from this worktree's install, before #27329 retired the site on `main`. With the directory removed, the rerun gave VERDICT command-exit 0, Test Files 169 passed | 2 skipped. - `dispatch-gates --tier`: no path-derived mandate. Changed lines: 111 (+21 / -90). - Full dogfood, required because the title carries `!` and Clause-② has the `(narrowing)` arm. The closure was built with `pnpm --filter '@objectstack/dogfood^...' build` (VERDICT 0), then `pnpm --filter @objectstack/dogfood test` ran under the lock with no shard and no path: VERDICT command-exit 0, Test Files 348 passed | 3 skipped (351), Tests 2806 passed | 20 skipped (2826). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbZK9w6fe2Y6mGQjj6L)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent c5d4634 commit 3bfb357

5 files changed

Lines changed: 21 additions & 90 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
refactor(components)!: retire the unused `ViewSkeleton` dispatcher and `ShimmerSkeleton`
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/components#ViewSkeleton, @object-ui/components#ViewSkeletonVariant, @object-ui/components#ViewSkeletonDispatchProps, @object-ui/components#ShimmerSkeleton, @object-ui/components#ShimmerSkeletonProps) the retired operands are React components and their prop types in a published ui package's entry that nothing in the workspace imported; no packages/spec schema, no registered node type, no ADR-0087 conversion surface and no stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports either component from `@object-ui/components`. Both were published from the package entry and had no importer anywhere in the workspace, so the Console and every `@object-ui/*` package are unaffected. The other skeletons in `view-skeleton.tsx` stay exported unchanged: `GridSkeleton`, `KanbanSkeleton`, `FormSkeleton`, `ListSkeleton`, `ChartSkeleton` and the `ViewSkeletonProps`, `GridSkeletonProps` and `KanbanSkeletonProps` types.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `ViewSkeleton` TO the skeleton for the variant you passed: `variant: "grid"` is `GridSkeleton`, `"kanban"` is `KanbanSkeleton`, `"form"` is `FormSkeleton`, `"list"` is `ListSkeleton`, `"chart"` is `ChartSkeleton`, each taking the same remaining props.
17+
- FROM `ViewSkeletonVariant` TO a local union of the variants you render, or no type at all once you call the skeleton components directly.
18+
- FROM `ViewSkeletonDispatchProps` TO `GridSkeletonProps` or `KanbanSkeletonProps` (which carry `columns`; `KanbanSkeletonProps` carries `cardsPerColumn`), or `ViewSkeletonProps` for the others.
19+
- FROM `ShimmerSkeleton` TO `Skeleton` from `@object-ui/components`, or a `div` carrying the `animate-shimmer` utility that `@object-ui/app-shell/styles.css` still declares.
20+
- FROM `ShimmerSkeletonProps` TO `React.HTMLAttributes<HTMLDivElement>`, which it aliased.

‎ui/packages/app-shell/src/styles.css‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
/* Shimmer keyframe + utility for skeleton loading placeholders.
1919
*
20-
* Usage: <div class="animate-shimmer ..."> or via ShimmerSkeleton
21-
* from @object-ui/components.
20+
* Usage: <div class="animate-shimmer ...">
2221
*
2322
* The keyframe slides a 200%-wide gradient across an element's
2423
* background. Pair with `bg-[length:200%_100%]` and a gradient that

‎ui/packages/components/src/custom/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export * from './spinner';
2121
export * from './sort-builder';
2222
export * from './grouping-editor';
2323
export * from './view-skeleton';
24-
export * from './shimmer-skeleton';
2524
export * from './RecordTitleChip';
2625
export * from './refresh-indicator';
2726
export * from './view-states';

‎ui/packages/components/src/custom/shimmer-skeleton.tsx‎

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎ui/packages/components/src/custom/view-skeleton.tsx‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -204,37 +204,7 @@ function ChartSkeleton({
204204
)
205205
}
206206

207-
// ---------------------------------------------------------------------------
208-
// ViewSkeleton – convenience wrapper that dispatches by variant
209-
// ---------------------------------------------------------------------------
210-
211-
export type ViewSkeletonVariant = "grid" | "kanban" | "form" | "list" | "chart"
212-
213-
export interface ViewSkeletonDispatchProps extends ViewSkeletonProps {
214-
variant: ViewSkeletonVariant
215-
/** Number of columns (grid / kanban) */
216-
columns?: number
217-
/** Cards per column (kanban only) */
218-
cardsPerColumn?: number
219-
}
220-
221-
function ViewSkeleton({ variant, ...props }: ViewSkeletonDispatchProps) {
222-
switch (variant) {
223-
case "grid":
224-
return <GridSkeleton {...props} />
225-
case "kanban":
226-
return <KanbanSkeleton {...props} />
227-
case "form":
228-
return <FormSkeleton {...props} />
229-
case "list":
230-
return <ListSkeleton {...props} />
231-
case "chart":
232-
return <ChartSkeleton {...props} />
233-
}
234-
}
235-
236207
export {
237-
ViewSkeleton,
238208
GridSkeleton,
239209
KanbanSkeleton,
240210
FormSkeleton,

0 commit comments

Comments
 (0)