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
19 changes: 19 additions & 0 deletions .changeset/25921-collaboration-zero-consumer-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@object-ui/collaboration': patch
---

refactor(collaboration)!: retire the zero-consumer `useCommentSearch` and `createPresenceUpdater` exports

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

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

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

What leaves, and what to write instead:

- FROM `useCommentSearch` TO a `useMemo` over your own comment list that keeps the entries whose `text` or `author` contains the trimmed, lower-cased query.
- FROM `CommentSearchConfig` TO `{ comments: CommentEntry[] }`, with `CommentEntry` from `@object-ui/types`.
- FROM `CommentSearchReturn` TO the shape your own search state returns; the result rows can keep using `CommentSearchResult` from `@object-ui/types`.
- 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.
19 changes: 19 additions & 0 deletions .changeset/25921-mobile-zero-consumer-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@object-ui/mobile': patch
---

refactor(mobile)!: retire the zero-consumer `useOfflineSync`, `requestBackgroundSync` and `resolveResponsiveValue` exports

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

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

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

What leaves, and what to write instead:

- 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.
- FROM `OfflineSyncState` TO the state shape that effect keeps (`isOnline`, `pending: OfflineOperation[]`, `isReplaying`).
- FROM `requestBackgroundSync(tag)` TO `(await navigator.serviceWorker.ready).sync?.register(tag)`, guarded for browsers without Background Sync.
- FROM `resolveResponsiveValue(value, breakpoint)` TO `useResponsive(value)` inside a component, which reads the current breakpoint itself.
7 changes: 0 additions & 7 deletions ui/packages/collaboration/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export {

export {
usePresence,
createPresenceUpdater,
type PresenceUser,
type PresenceConfig,
type PresenceResult,
Expand Down Expand Up @@ -69,12 +68,6 @@ export {
type MentionNotificationsResult,
} from './useMentionNotifications.js';

export {
useCommentSearch,
type CommentSearchConfig,
type CommentSearchReturn,
} from './useCommentSearch.js';

export {
PresenceAvatars,
type PresenceAvatarsProps,
Expand Down
86 changes: 0 additions & 86 deletions ui/packages/collaboration/src/useCommentSearch.ts

This file was deleted.

4 changes: 1 addition & 3 deletions ui/packages/mobile/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ export {
type OfflineDataSourceOptions,
type QueueableDataSource,
} from './createOfflineDataSource.js';
export { useOfflineSync, type OfflineSyncState } from './useOfflineSync.js';
export {
getServiceWorkerSource,
requestBackgroundSync,
type ServiceWorkerSourceOptions,
} from './serviceWorkerSource.js';
export { BREAKPOINTS, resolveResponsiveValue } from './breakpoints.js';
export { BREAKPOINTS } from './breakpoints.js';

// Re-export types for convenience
export type {
Expand Down
79 changes: 0 additions & 79 deletions ui/packages/mobile/src/useOfflineSync.ts

This file was deleted.

Loading