Repository navigation
Commit 8c8c5b5
refactor(ui)!: retire zero-consumer exports from
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDNjQXVZgdT2wbAyWd5s4eX)_
Part of #25921 — the per-package zero-reference barrel batch for
`@object-ui/plugin-gantt`, `@object-ui/plugin-designer`,
`@object-ui/collaboration` and `@object-ui/mobile` (claim 6541128113).
The card stays open: the other items it lists are untouched, and this PR
does not finish the batch for gantt or designer (see Acceptance notes).
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no file under `skills/**` or `content/docs/**` names
any of the eight retired exports (repo-wide `git grep -w`, zero hits
each)
## 维护者速读
- 改了什么:从 `@object-ui/collaboration` 入口去掉
`useCommentSearch`(连同模块)、它的两个类型和 `createPresenceUpdater`;从
`@object-ui/mobile` 入口去掉
`useOfflineSync`(连同模块)、`OfflineSyncState`、`requestBackgroundSync` 和
`resolveResponsiveValue`。共 8 个名字,每包一个 `!` changeset。
- 为什么改:这 8 个名字在全仓(含
`examples/**`、`packages/console`、文档和技能)除自己包以外零引用,README
也没教;继续发布只是没人用的公开面。
- 风险与回滚:仓内没有任何消费者,Console 和其它 `@object-ui/*` 包不受影响;外部 npm
用户若用到会在升级时编译报错,changeset 里写了每个名字的替代写法。回滚就是 revert 本 PR。
-
先看:`ui/packages/mobile/src/index.ts`、`ui/packages/collaboration/src/index.ts`、`.changeset/25921-mobile-zero-consumer-exports.md`。
- 两分钟验证:`git grep -n -w -e useOfflineSync -e useCommentSearch -e
requestBackgroundSync -e resolveResponsiveValue -e createPresenceUpdater
-- ':!**/CHANGELOG.md' ':!.changeset/**'`,预期只剩 mobile/collaboration
自己的模块内定义与内部调用。
- 需要你做的:无,席位落地(入队前欠一次契约复审档的复审)。
## What changes
- `@object-ui/collaboration`: the entry stops exporting
`useCommentSearch`, `CommentSearchConfig`, `CommentSearchReturn` and
`createPresenceUpdater`. `src/useCommentSearch.ts` is deleted: the
barrel was its only importer and it had no test. `createPresenceUpdater`
stays in `usePresence.ts` (that module is also imported by
`PresenceAvatars`), it only leaves the entry.
- `@object-ui/mobile`: the entry stops exporting `useOfflineSync`,
`OfflineSyncState`, `requestBackgroundSync` and
`resolveResponsiveValue`. `src/useOfflineSync.ts` is deleted: the barrel
was its only importer and it had no test. `requestBackgroundSync` stays
in `serviceWorkerSource.ts` (beside the kept `getServiceWorkerSource`)
and `resolveResponsiveValue` stays in `breakpoints.ts` (`useResponsive`
calls it; `breakpoints.test.ts` imports it from the module, unchanged).
- Two changesets, `patch` (`Metadata-protocol: none`), each with the
`**BREAKING**` banner, the ADR-0087 `not-required
(runtime-export-retired …)` marker naming every operand, and one FROM →
TO line per name.
## How the set was chosen
Every name each barrel exports was listed from the barrel's AST (35 / 38
/ 38 / 51), then `git grep -l -w -F` ran for each over the whole tree at
`origin/main` `a878ff6c` minus the package's own directory,
`**/CHANGELOG.md`, `pnpm-lock.yaml`, `.changeset/**` and
`ui/.changeset/**`. Positive controls with the same command:
`useRecordPresence` 101 files, `ResponsiveContainer` 89, `ObjectGantt`
108. A name was retired only when all three hold:
1. zero hits outside its package (any hit, prose included, keeps the
name);
2. the package's own `README.md` / `demo` / `docs` do not name it
(`check-readme-exports` holds every README self-import to a real export,
and the READMEs are outside this claim's surface);
3. no export that stays needs it: a prop, option or result type of a
kept component or hook stays, and so does the offline queue family
(`createOfflineQueue`, the two queue classes, `generateOpId`,
`OfflineQueueBackend`, `OfflineOperation`), because the kept
`createOfflineDataSource` requires `queue: OfflineQueueBackend`.
| package | barrel names | zero hits outside | of those, named by the
package README/demo | of those, needed by a kept export | retired here |
|:--|--:|--:|--:|--:|--:|
| `@object-ui/plugin-gantt` | 35 | 24 | 24 | — | 0 |
| `@object-ui/plugin-designer` | 38 | 15 | 6 | 9 | 0 |
| `@object-ui/collaboration` | 38 | 18 | 0 | 14 | 4 |
| `@object-ui/mobile` | 51 | 24 | 1 | 19 | 4 |
## Tests
Read at code head `1c0cadd8` (the later merge commit `b6c6ff29` brings 5
`origin/main` commits, none under the four packages; the derived command
list re-computed on it is identical).
- `pnpm --filter @object-ui/collaboration --filter @object-ui/mobile run
type-check` → both `Done` (`tsc --noEmit && tsc -p tsconfig.test.json`);
`pnpm --dir ui exec vitest run packages/collaboration packages/mobile` →
13 files, 133 tests passed (os-verify-lock `VERDICT command-exit 0`).
- Public surface moved, so the direct importers were type-checked after
the console closure build (`turbo run build
--filter=@object-ui/console...` 71/71, then `--filter=./ui/packages/*`
73/73): `@object-ui/app-shell`, `plugin-calendar`, `plugin-grid`,
`plugin-list`, `plugin-timeline` and `@object-ui/console` `type-check`
all `Done`.
- `pnpm --dir ui exec vitest run scripts/` → 169 files passed, 2
skipped; 4901 tests passed.
- Full dogfood battery (the title carries `!`): closure `turbo run build
--filter=@objectstack/dogfood^...` 68/68, then `pnpm --filter
@objectstack/dogfood test` → Test Files 361 passed, 3 skipped (364);
Tests 2917 passed, 28 skipped (2945); `VERDICT command-exit 0`, held the
lock 1385 s.
- No ablation: export lines removed and two untested modules deleted; no
tested behaviour changed.
## Acceptance notes
- **gantt and designer yield nothing under this claim's surface.** All
24 zero-hit gantt names (`QuickFilterBar`, `ResourceWorkload`,
`computeWorkload`, the `shifts` helpers and their types, …) are taught
in `ui/packages/plugin-gantt/README.md`; the 6 zero-hit designer values
(`CollaborationProvider`, `ConnectionStatusIndicator`, `useClipboard`,
`useMultiSelect`, `useCanvasPanZoom`, `PropertyEditor`) are taught in
`ui/packages/plugin-designer/README.md`. Retiring them needs a README
edit in the same PR, which is outside the claimed file surface; the
other 9 designer names are the `…Props` types of components that stay
exported. Whether documented exports are in scope at all is the seat's
call.
- `createPresenceUpdater` (in `usePresence.ts`) and
`requestBackgroundSync` (in `serviceWorkerSource.ts`) are now exported
by their modules only and read by nothing; deleting their bodies edits
modules the claim does not cover, so they are left for the next pass.
- `CommentSearchResult` in `@object-ui/types` loses its only code reader
with `useCommentSearch` (a test in that package still names it); that is
another package's batch. `CommentEntry` keeps `plugin-detail`'s
`RecordComments` as a reader.
## Verification
<details><summary>Derived gates — 28/28 run, 0 NOT-MEASURED</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 28 commands; `--ran` with an exit code on
every line: "28 derived famil(ies) accounted for — 28 run, 0
NOT-MEASURED (a DERIVED zero)". Every command exit 0, among them
`check-adr-0087-registration --base origin/main` (re-run on `b6c6ff29`:
exit 0), `check-empty-changeset --base origin/main`,
`check-changeset-no-major`, `check-sdui-manifest`,
`check:published-files`, `check:undeclared-dep-imports` and `vitest run
scripts/`.
Outside the derived set: `check-platform-checklist --changed-from
origin/main` exit 0 (0 anchored files); `eslint` on the two changed
barrels exit 0; `git merge-tree --write-tree HEAD origin/main` exit 0.
`dispatch-gates --tier`: no path-derived mandate; 214 changed lines,
under the 3000 threshold.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgTDDVJ8ZXyEBkyGSyv)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgTDDVJ8ZXyEBkyGSyv
---------
Co-authored-by: Claude <noreply@anthropic.com>@object-ui/collaboration and @object-ui/mobile (#28385)1 parent fa74b48 commit 8c8c5b5
6 files changed
Lines changed: 39 additions & 175 deletions
File tree
- .changeset
- ui/packages
- collaboration/src
- mobile/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 71 | | |
79 | 72 | | |
80 | 73 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
| |||
This file was deleted.
0 commit comments