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
20 changes: 20 additions & 0 deletions .changeset/25915-retire-view-and-shimmer-skeleton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@object-ui/components': patch
---

refactor(components)!: retire the unused `ViewSkeleton` dispatcher and `ShimmerSkeleton`

Clause-②: no (narrowing)
Metadata-protocol: none

<!-- 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 -->

**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.

What leaves, and what to write instead:

- 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.
- FROM `ViewSkeletonVariant` TO a local union of the variants you render, or no type at all once you call the skeleton components directly.
- FROM `ViewSkeletonDispatchProps` TO `GridSkeletonProps` or `KanbanSkeletonProps` (which carry `columns`; `KanbanSkeletonProps` carries `cardsPerColumn`), or `ViewSkeletonProps` for the others.
- 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.
- FROM `ShimmerSkeletonProps` TO `React.HTMLAttributes<HTMLDivElement>`, which it aliased.
3 changes: 1 addition & 2 deletions ui/packages/app-shell/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

/* Shimmer keyframe + utility for skeleton loading placeholders.
*
* Usage: <div class="animate-shimmer ..."> or via ShimmerSkeleton
* from @object-ui/components.
* Usage: <div class="animate-shimmer ...">
*
* The keyframe slides a 200%-wide gradient across an element's
* background. Pair with `bg-[length:200%_100%]` and a gradient that
Expand Down
1 change: 0 additions & 1 deletion ui/packages/components/src/custom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export * from './spinner';
export * from './sort-builder';
export * from './grouping-editor';
export * from './view-skeleton';
export * from './shimmer-skeleton';
export * from './RecordTitleChip';
export * from './refresh-indicator';
export * from './view-states';
Expand Down
57 changes: 0 additions & 57 deletions ui/packages/components/src/custom/shimmer-skeleton.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions ui/packages/components/src/custom/view-skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,37 +204,7 @@ function ChartSkeleton({
)
}

// ---------------------------------------------------------------------------
// ViewSkeleton – convenience wrapper that dispatches by variant
// ---------------------------------------------------------------------------

export type ViewSkeletonVariant = "grid" | "kanban" | "form" | "list" | "chart"

export interface ViewSkeletonDispatchProps extends ViewSkeletonProps {
variant: ViewSkeletonVariant
/** Number of columns (grid / kanban) */
columns?: number
/** Cards per column (kanban only) */
cardsPerColumn?: number
}

function ViewSkeleton({ variant, ...props }: ViewSkeletonDispatchProps) {
switch (variant) {
case "grid":
return <GridSkeleton {...props} />
case "kanban":
return <KanbanSkeleton {...props} />
case "form":
return <FormSkeleton {...props} />
case "list":
return <ListSkeleton {...props} />
case "chart":
return <ChartSkeleton {...props} />
}
}

export {
ViewSkeleton,
GridSkeleton,
KanbanSkeleton,
FormSkeleton,
Expand Down
Loading