Skip to content

Commit 309cad1

Browse files
committed
refactor(ui)!: retire zero-consumer exports from collaboration and mobile
Drop useCommentSearch (module deleted) and createPresenceUpdater from the @object-ui/collaboration entry, and useOfflineSync (module deleted), requestBackgroundSync and resolveResponsiveValue from the @object-ui/mobile entry. Each name was re-measured with no reference anywhere in the repo outside its own package and is not taught by the package README. One breaking changeset per package carries the FROM/TO list. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTDDVJ8ZXyEBkyGSyv
1 parent a878ff6 commit 309cad1

6 files changed

Lines changed: 39 additions & 175 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/collaboration': patch
3+
---
4+
5+
refactor(collaboration)!: retire the zero-consumer `useCommentSearch` and `createPresenceUpdater` exports
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/collaboration#useCommentSearch, @object-ui/collaboration#CommentSearchConfig, @object-ui/collaboration#CommentSearchReturn, @object-ui/collaboration#createPresenceUpdater) the retired operands are a React hook, its two option and result types, and a plain helper factory 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 any of these four names from `@object-ui/collaboration`. None had an importer anywhere in the workspace, so the Console and every `@object-ui/*` package are unaffected. `useCommentSearch` is deleted with its module; `createPresenceUpdater` leaves the package entry only. Everything else the entry exports is unchanged, including `usePresence`, `PresenceProvider`, `CommentThread` and their types.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `useCommentSearch` TO a `useMemo` over your own comment list that keeps the entries whose `text` or `author` contains the trimmed, lower-cased query.
17+
- FROM `CommentSearchConfig` TO `{ comments: CommentEntry[] }`, with `CommentEntry` from `@object-ui/types`.
18+
- FROM `CommentSearchReturn` TO the shape your own search state returns; the result rows can keep using `CommentSearchResult` from `@object-ui/types`.
19+
- FROM `createPresenceUpdater` TO a `Map<string, PresenceUser>` keyed by `userId` that you update from your realtime channel, or `PresenceProvider` with `useTenantPresence` / `useRecordPresence`, which the package keeps exporting.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/mobile': patch
3+
---
4+
5+
refactor(mobile)!: retire the zero-consumer `useOfflineSync`, `requestBackgroundSync` and `resolveResponsiveValue` exports
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/mobile#useOfflineSync, @object-ui/mobile#OfflineSyncState, @object-ui/mobile#requestBackgroundSync, @object-ui/mobile#resolveResponsiveValue) the retired operands are a React hook, its state type and two plain helpers 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 any of these four names from `@object-ui/mobile`. None had an importer anywhere in the workspace, so the Console and every `@object-ui/*` package are unaffected. `useOfflineSync` is deleted with its module; `requestBackgroundSync` and `resolveResponsiveValue` leave the package entry only (`useResponsive` still resolves through the latter internally). The offline data source (`createOfflineDataSource`, `createOfflineQueue` and its queue classes), `getServiceWorkerSource`, `useResponsive` and `BREAKPOINTS` stay exported unchanged.
13+
14+
What leaves, and what to write instead:
15+
16+
- FROM `useOfflineSync(source)` TO your own effect on the `OfflineDataSource` that `createOfflineDataSource` returns: read `source.pending()` into state, call `source.replay()` on the window `online` event, and use `source.drop(opId)` / `source.clear()` for the queue controls.
17+
- FROM `OfflineSyncState` TO the state shape that effect keeps (`isOnline`, `pending: OfflineOperation[]`, `isReplaying`).
18+
- FROM `requestBackgroundSync(tag)` TO `(await navigator.serviceWorker.ready).sync?.register(tag)`, guarded for browsers without Background Sync.
19+
- FROM `resolveResponsiveValue(value, breakpoint)` TO `useResponsive(value)` inside a component, which reads the current breakpoint itself.

‎ui/packages/collaboration/src/index.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export {
2929

3030
export {
3131
usePresence,
32-
createPresenceUpdater,
3332
type PresenceUser,
3433
type PresenceConfig,
3534
type PresenceResult,
@@ -69,12 +68,6 @@ export {
6968
type MentionNotificationsResult,
7069
} from './useMentionNotifications.js';
7170

72-
export {
73-
useCommentSearch,
74-
type CommentSearchConfig,
75-
type CommentSearchReturn,
76-
} from './useCommentSearch.js';
77-
7871
export {
7972
PresenceAvatars,
8073
type PresenceAvatarsProps,

‎ui/packages/collaboration/src/useCommentSearch.ts‎

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

‎ui/packages/mobile/src/index.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ export {
5050
type OfflineDataSourceOptions,
5151
type QueueableDataSource,
5252
} from './createOfflineDataSource.js';
53-
export { useOfflineSync, type OfflineSyncState } from './useOfflineSync.js';
5453
export {
5554
getServiceWorkerSource,
56-
requestBackgroundSync,
5755
type ServiceWorkerSourceOptions,
5856
} from './serviceWorkerSource.js';
59-
export { BREAKPOINTS, resolveResponsiveValue } from './breakpoints.js';
57+
export { BREAKPOINTS } from './breakpoints.js';
6058

6159
// Re-export types for convenience
6260
export type {

‎ui/packages/mobile/src/useOfflineSync.ts‎

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

0 commit comments

Comments
 (0)