Skip to content

Commit 48b3ae6

Browse files
refactor(plugin-dashboard, plugin-list)!: retire eight zero-consumer entry exports (#30541)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDadpmv8nuw2HbLjjF77YBK)_ Part of #25921. The umbrella stays open; this is one barrel batch of it (claim 6660204183, amended 6660498263, seat `domain:ui#6`). Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:`@object-ui/plugin-dashboard` 的包入口不再导出 5 个名字(配置面板的默认英文表与翻译钩子、已退役节点类型的墓碑组件及其上报/重置函数),`@object-ui/plugin-list` 不再导出 3 个名字(视图切换下拉、标签栏下拉、条件格式包装函数)。模块本身全部保留。 - 为什么改:这 8 个名字在仓内(包外)与 hotcrm 均零引用,只是让公开面看起来比实际大;本卡逐包清理无人使用的 barrel 导出。 - 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台与所有 `@object-ui/*` 包不受影响,退役节点仍按名拒绝。回滚即 revert 本 PR。 - 先看:`ui/packages/plugin-dashboard/src/index.tsx`(两段导出改写)、`.changeset/25921-plugin-dashboard-zero-consumer-exports.md`(迁移说明)、`ui/packages/plugin-list/src/index.tsx`。 - 两分钟验证:`git grep -n -w -e ViewSwitcherDropdown -e TabBarSelect -e evaluateConditionalFormatting -e useConfigPanelTranslation -e RetiredDashboardNodeTombstone -- ':!ui/packages/plugin-list' ':!ui/packages/plugin-dashboard' ':!**/CHANGELOG.md'` 应只命中两份新 changeset。 - 需要你做的:无,席位落地。 ## What changes - `ui/packages/plugin-dashboard/src/index.tsx`: the entry stops exporting `CONFIG_PANEL_DEFAULT_TRANSLATIONS`, `useConfigPanelTranslation`, `RetiredDashboardNodeTombstone`, `reportRetiredDashboardNodeType` and `resetRetiredDashboardNodeTypeReports`. `ConfigPanelTranslate` (the README teaches it) and `RETIRED_DASHBOARD_NODE_TYPES` stay. The two comments that justified the old exports are rewritten: the defaults-vs-pack mirror gate (`defaults-maps-mirror-en-pack.test.tsx`) discovers every defaults table from source through `scanDefaultsTables`, so it needs no import from this entry. - `ui/packages/plugin-dashboard/src/__tests__/dashboardBareKeyOwnership.test.tsx`: imports `RetiredDashboardNodeTombstone` and `resetRetiredDashboardNodeTypeReports` from `../retired-node-types` instead of `../index`. Same objects, so the identity comparison is unchanged; the entry import still performs the registrations. - `ui/packages/plugin-list/src/index.tsx`: the entry stops exporting `ViewSwitcherDropdown`, `TabBarSelect` and `evaluateConditionalFormatting`. - Two new changesets, `.changeset/25921-plugin-dashboard-zero-consumer-exports.md` and `.changeset/25921-plugin-list-zero-consumer-exports.md`: patch level, `!` title, BREAKING paragraph, one FROM/TO line per retired name, ADR-0087 marker `not-required (runtime-export-retired …)` naming every operand. - No module file is deleted. Every retired name keeps an in-package reader (`ListView` renders `ViewSwitcherDropdown`; the config panels use the hook; `index.tsx` registers the tombstone; the rest are read by their own tests). ## Tests Census on `origin/main` fa9c0aa with the #28385 / #29388 method: the entry export list from the TypeScript checker; per name `git grep -o -w -F` over the whole tree minus the package directory, `**/CHANGELOG.md`, lockfiles and `.changeset/**`; the package README, SKILL.md and demo; keep rule 3 (a name a kept export's declared signature reaches, walked with the checker); hotcrm `6961ab1` `git grep -l -w -F`. | Package | Name | Hits outside the package | hotcrm | Verdict | |:--|:--|--:|--:|:--| | plugin-dashboard | `CONFIG_PANEL_DEFAULT_TRANSLATIONS` | 0 | 0 | retired | | plugin-dashboard | `useConfigPanelTranslation` | 0 | 0 | retired | | plugin-dashboard | `RetiredDashboardNodeTombstone` | 0 | 0 | retired | | plugin-dashboard | `reportRetiredDashboardNodeType` | 0 | 0 | retired | | plugin-dashboard | `resetRetiredDashboardNodeTypeReports` | 0 | 0 | retired | | plugin-dashboard | `ConfigPanelTranslate` | 0 | | kept: README "TypeScript Support" teaches it | | plugin-dashboard | `WidgetDatasetCatalogEntry`, `WidgetDatasetDimension`, `WidgetDatasetMeasure` | 0 | | kept: rule 3, via `WidgetConfigPanelProps` | | plugin-dashboard | `DashboardMetricNodeSchema` | 0 | | kept: its entry line is what loads `widgetDispatch`'s `CustomNodeRegistry` augmentation into consumers' programs | | plugin-list | `ViewSwitcherDropdown` | 0 | 0 | retired | | plugin-list | `TabBarSelect` | 0 | 0 | retired | | plugin-list | `evaluateConditionalFormatting` | 0 | 0 | retired | | plugin-list | `TabBarProps`, `UserFiltersHandle`, `ListViewRowGroup` | 0 | | kept: rule 3, via `TabBar`, `UserFiltersProps`, `ListViewProps` | | controls | `DashboardRenderer` 76, `RETIRED_DASHBOARD_NODE_TYPES` 2, `ViewSwitcher` 29, `TabBar` 11, `normalizeFilterCondition` 9, `ListView` 621; hotcrm `ListView` 7 | | | | Readings at head 14d4c82: - `turbo run type-check` for `@object-ui/plugin-dashboard`, `@object-ui/plugin-list`, `@object-ui/app-shell`, `@object-ui/console` with their `^build` closure: 77 of 77 tasks successful (lock VERDICT command-exit 0, 8m39s). - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-dashboard/ packages/plugin-list/`: Test Files 391 passed (391); Tests 3741 passed, 6 skipped (3747); VERDICT command-exit 0. - Reverse check on the rebuilt `.d.ts`: a temporary probe in app-shell importing all eight retired names plus four kept controls gave exactly eight errors, one per retired name (`TS2305` / `TS2724 … has no exported member`), while `RETIRED_DASHBOARD_NODE_TYPES`, `DashboardRenderer`, `TabBar` and `ViewSwitcher` resolved. Probe deleted; `git status` clean. - `pnpm --dir ui run check:readme-exports`: `0 fabricated, 0 stale omission(s)`; exit 1 only on the known prerequisite (`packages/cli` dist unbuilt, its two self-imports unjudged). - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0, 0 anchored files. - No ablation: export lines removed, no tested behaviour changed. ## Acceptance notes - `TabBarSelect` and `evaluateConditionalFormatting` now have no reader in the package's non-test code either: only their own tests import them from the module. `evaluateConditionalFormatting` is a one-line wrapper over `@object-ui/core`'s `resolveConditionalFormatting`. Retiring the bodies (and their tests) is a later pass on this card, not filed separately. - `ui/packages/plugin-dashboard/README.md` says the package's "whole type export surface is `WidgetConfigPanelProps`, `ConfigPanelTranslate` and the three `WidgetDataset*` catalog types"; `DashboardMetricNodeSchema` has been on the entry since an earlier release, so that sentence was already incomplete before this PR. Untouched here (README not on the claim's surface). - Branch name is the platform-assigned `claude/project-thread-h719zv`, not `claude/issue-25921-*`. - A contract-review-tier review is owed before the queue (narrowing batch); the seat runs it. ## Verification Derived gates, dogfood battery and the final-head readings are in the os-dev-report comment on #25921; CI check-runs on this PR are the record for every family CI runs. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgTj6bWX8Rq5fpUGNv7)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent b6f4c0e commit 48b3ae6

5 files changed

Lines changed: 56 additions & 26 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/plugin-dashboard': patch
3+
---
4+
5+
refactor(plugin-dashboard)!: retire five zero-consumer exports (the config panel's defaults table and hook, the retired-node tombstone and its report and reset helpers)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-dashboard#CONFIG_PANEL_DEFAULT_TRANSLATIONS, @object-ui/plugin-dashboard#useConfigPanelTranslation, @object-ui/plugin-dashboard#RetiredDashboardNodeTombstone, @object-ui/plugin-dashboard#reportRetiredDashboardNodeType, @object-ui/plugin-dashboard#resetRetiredDashboardNodeTypeReports) the retired operands are a provider-less English defaults table, the translation hook that reads it, the React widget that refuses a retired dashboard node type and its two console-report helpers; nothing in the workspace or in hotcrm imports any of them from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these five names from `@object-ui/plugin-dashboard`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package: the config panels keep using the hook and its table, and the package still registers the tombstone for every retired dashboard node type, so an authored `view:dashboard` is refused by name exactly as before. Only the entry stops publishing them. `RETIRED_DASHBOARD_NODE_TYPES`, `ConfigPanelTranslate`, `DashboardMetricNodeSchema`, the three `WidgetDataset*` types and every component stay exported unchanged.
13+
14+
What leaves, and what to write instead (none has a replacement export):
15+
16+
- FROM `CONFIG_PANEL_DEFAULT_TRANSLATIONS`, `useConfigPanelTranslation` TO no replacement: `DashboardConfigPanel` and `WidgetConfigPanel` translate their own labels; mount an `I18nProvider` to change them.
17+
- FROM `RetiredDashboardNodeTombstone` TO no replacement: the package registers it under every key of `RETIRED_DASHBOARD_NODE_TYPES` itself, so rendering a retired node through `SchemaRenderer` still shows the refusal.
18+
- FROM `reportRetiredDashboardNodeType`, `resetRetiredDashboardNodeTypeReports` TO no replacement: the tombstone reports on its own, once per retired type; read the migration text from `RETIRED_DASHBOARD_NODE_TYPES`.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/plugin-list': patch
3+
---
4+
5+
refactor(plugin-list)!: retire three zero-consumer exports (the view switcher dropdown, the tab bar select and the conditional formatting wrapper)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-list#ViewSwitcherDropdown, @object-ui/plugin-list#TabBarSelect, @object-ui/plugin-list#evaluateConditionalFormatting) the retired operands are two React components and a function that wraps `@object-ui/core`'s conditional formatting resolver; nothing in the workspace or in hotcrm imports any of them from the package entry, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these three names from `@object-ui/plugin-list`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected. Every module stays in the package (`ListView` keeps rendering `ViewSwitcherDropdown`); only the entry stops publishing them. `ListView`, `ViewSwitcher`, `TabBar`, `UserFilters`, `normalizeFilterCondition`, `normalizeFilters`, `LIST_DEFAULT_TRANSLATIONS` and every exported type, `TabBarProps` included, stay exported unchanged.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `ViewSwitcherDropdown` TO `ViewSwitcher`, or render `ListView`, which draws the dropdown itself.
17+
- FROM `TabBarSelect` TO `TabBar`, which takes the same `TabBarProps`.
18+
- FROM `evaluateConditionalFormatting` TO `resolveConditionalFormatting` from `@object-ui/core`, the function it wrapped: same arguments, result typed as `React.CSSProperties`.

‎ui/packages/plugin-dashboard/src/__tests__/dashboardBareKeyOwnership.test.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ import { ComponentRegistry, Registry, type ComponentMeta } from '@object-ui/core
6767
// Importing the package entry is what performs the registrations, exactly as a
6868
// host does. The renderer is compared by IDENTITY below, so these pins cannot be
6969
// satisfied by a look-alike.
70+
import { DashboardRenderer, RETIRED_DASHBOARD_NODE_TYPES } from '../index';
71+
// Not on the package entry: the module the entry registers them from.
7072
import {
71-
DashboardRenderer,
72-
RETIRED_DASHBOARD_NODE_TYPES,
7373
RetiredDashboardNodeTombstone,
7474
resetRetiredDashboardNodeTypeReports,
75-
} from '../index';
75+
} from '../retired-node-types';
7676

7777
afterEach(cleanup);
7878

‎ui/packages/plugin-dashboard/src/index.tsx‎

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ import {
2929

3030
export { DashboardRenderer, DashboardGridLayout, MetricWidget, MetricCard, ObjectMetricWidget, PivotTable, ObjectPivotTable, ObjectDataTable, DashboardConfigPanel, WidgetConfigPanel, DashboardWithConfig, DrillDownDrawer };
3131
export type { WidgetConfigPanelProps } from './WidgetConfigPanel';
32-
// objectui#4748 — the config sidebar's provider-less English, exported for the
33-
// same reason the sibling plugins export theirs: a defaults map that disagrees
34-
// with the `en` pack renders two labels for one control, and the assertion that
35-
// it does not needs to be able to import it.
36-
export {
37-
CONFIG_PANEL_DEFAULT_TRANSLATIONS,
38-
useConfigPanelTranslation,
39-
type ConfigPanelTranslate,
40-
} from './useConfigPanelTranslation';
32+
// The config sidebar's translate function type. `CONFIG_PANEL_DEFAULT_TRANSLATIONS`
33+
// and `useConfigPanelTranslation` left this entry with zero importers outside
34+
// the package: the defaults-vs-pack mirror gate reads every defaults table
35+
// from source, so it needs no import from here.
36+
export type { ConfigPanelTranslate } from './useConfigPanelTranslation';
4137
export type {
4238
WidgetDatasetCatalogEntry,
4339
WidgetDatasetDimension,
@@ -48,17 +44,13 @@ export type {
4844
// Exported from the entry so the published typings load that declaration for
4945
// every consumer of this package, not only for this package's own program.
5046
export type { DashboardMetricNodeSchema } from './widgetDispatch';
51-
// objectui#9533 — the retirement table and the widget it renders. Exported for
52-
// the same reason the sibling packages export their tombstones: the assertion
53-
// that an authored `view:dashboard` is refused BY NAME, with the migration in
54-
// the refusal's own text, has to be able to import the text it asserts rather
55-
// than restate it.
56-
export {
57-
RETIRED_DASHBOARD_NODE_TYPES,
58-
RetiredDashboardNodeTombstone,
59-
reportRetiredDashboardNodeType,
60-
resetRetiredDashboardNodeTypeReports,
61-
} from './retired-node-types';
47+
// objectui#9533 — the retirement table. Exported so an assertion that an
48+
// authored `view:dashboard` is refused BY NAME, with the migration in the
49+
// refusal's own text, can import the text it asserts rather than restate it.
50+
// The tombstone widget and its report/reset helpers left this entry with zero
51+
// importers outside the package; the package's own tests import them from
52+
// `./retired-node-types`.
53+
export { RETIRED_DASHBOARD_NODE_TYPES } from './retired-node-types';
6254

6355
// Register dashboard component
6456
//

‎ui/packages/plugin-list/src/index.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import { ViewSwitcher } from './ViewSwitcher';
1414
import { ObjectGallery } from './ObjectGallery';
1515

1616
export { ListView, ListViewBlock, ViewSwitcher, ObjectGallery };
17-
export { ViewSwitcherDropdown } from './ViewSwitcher';
18-
export { TabBar, TabBarSelect } from './components/TabBar';
17+
// `ViewSwitcherDropdown`, `TabBarSelect` and `evaluateConditionalFormatting`
18+
// left this entry with zero importers outside the package; their modules keep
19+
// them for `ListView` and the package's own tests.
20+
export { TabBar } from './components/TabBar';
1921
export type { TabBarProps, ViewTab } from './components/TabBar';
2022
export { UserFilters } from './UserFilters';
2123
export type { UserFiltersProps, UserFiltersHandle } from './UserFilters';
22-
export { evaluateConditionalFormatting, normalizeFilterCondition, normalizeFilters } from './ListView';
24+
export { normalizeFilterCondition, normalizeFilters } from './ListView';
2325
// The provider-less fallback table, exported so objectui#4401's mirror gate can
2426
// compare it against the `en` pack from a package that depends on both.
2527
export { LIST_DEFAULT_TRANSLATIONS } from './ListView';

0 commit comments

Comments
 (0)