Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(react)!: retire useClientNotifications, a second inbox poller with zero consumers (objectui#7389) - #10468

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-7389-retire-use-client-notifications
Sep 25, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-7389-retire-use-client-notifications

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #7389
Clause-②: yes

Retires useClientNotifications from @object-ui/react, as ruled on the card (comment 5809224666, letter remove). Dispatched under PM claim 5826117848, PM session session_01BA3nKVUwKQJf8DBxrSVtNC.

What changed

  • Deleted packages/react/src/hooks/useClientNotifications.ts: the hook and its two exported types, UseClientNotificationsOptions and UseClientNotificationsResult. Its private helpers (toSeverity, ClientBearingDataSource, hasGetClient, useResolvedClient) had no other reader and go with it. The hook had no tests of its own.
  • Barrel: its export * line leaves packages/react/src/hooks/index.ts.
  • Docs: the "Server-side notifications" section of content/docs/guide/notifications.md no longer teaches the hook. It now points at the shell's shared inbox feed (sharedUserFeeds in @object-ui/app-shell) through the feed's two public surfaces: the header bell in AppHeader, and a global:notifications page node. It also says the feed itself is not exported, and that a second poller beside the shell is the shape the feed exists to remove.
  • Cadence pin comment: the header comment of sharedInboxFeed.cadence-7249.test.tsx called the hook "the other candidate" with "no call sites". It now records that the hook was retired and is no longer a candidate. Only the comment changes; no assertion does.
  • Doc-example ledger: scripts/check-doc-example-types.mjs drops the ledger row keyed on the deleted file's @example. If kept, that row reads as STALE and check:doc-examples exits 1 (measured below). This path is outside the claim's declared file surface; see "Surface" below.
  • Changeset .changeset/7389-retire-use-client-notifications.md: minor on @object-ui/react (never major, per AGENTS.md section 9). It is marked BREAKING, and its migration is: use the shell's shared inbox feed.

Consumer census (run before deleting, as the ruling requires)

No mount was found anywhere reachable. Every census had a positive control that had to light up:

Tree Hits for git grep -lw useClientNotifications Control
objectui e6203d756 (branch point), whole tree 6 files: the hook, the barrel, the guide, packages/react/CHANGELOG.md, the cadence pin comment and the doc-example ledger row. None of them mounts it. useSettledSchema over packages/*/src/*, apps/*, examples/*: 25 files
objectui ea9d17fb6 (main, re-read before opening this PR) the same 6 files. None of the touched paths changed since the branch point. same control, present
objectstack 338feda6 (origin/main) 6 files, all CHANGELOGs or release notes SchemaRenderer found in .ts/.tsx code
hotcrm 087b7c5 (shallow clone, read-only) 0 @object-ui/ imports found
cloud NOT MEASURED: not reachable from this session (git ls-remote exit 128 on credentials, REST 403) none

Reverse proof: the removal is real at a consumer's resolution path

The probe sits in packages/components, where @object-ui/react resolves through node_modules to the exports of packages/react/package.json and then to dist/index.d.ts. One probe imports the three removed names plus the live control useSettledSchema. A second probe imports only controls (useSettledSchema, useNotifications). Both compile with tsc --noEmit --strict --ignoreConfig. Both legs ran from committed state under one lock hold, with an EXIT/INT/TERM trap for the restore:

  • Leg B: the base source of the two react paths was restored from e6203d756. On disk: barrel line count 1, hook file present. React was rebuilt, and dist/hooks/index.d.ts then had line count 1. Result: the removed-names probe exits 0, and the control probe exits 0.
  • Restore: git diff HEAD is 0 bytes, porcelain is empty, the barrel blob 979a1a0d0 equals HEAD's, and the hook file is absent. Then dist was wiped and react rebuilt from HEAD: 0 dist files name the hook (132 emitted files, against 134 in leg B), and the control is present.
  • HEAD leg: the removed-names probe exits 2:
    • useClientNotifications gives TS2724, "has no exported member named 'useClientNotifications'. Did you mean 'useNotifications'?". The dispatch predicted TS2305. TS2724 reports the same absence; tsc uses that code when it can offer a spelling suggestion.
    • UseClientNotificationsOptions and UseClientNotificationsResult give TS2305.
    • The control probe exits 0.
  • Runtime: await import('@object-ui/react') under plain Node from packages/components gives 'useClientNotifications' in m === false, and useSettledSchema and useNotifications are functions.

Ledger ablation (why the check-doc-example-types.mjs edit is required): the base row was re-inserted through a unique anchor (on disk, 0 rows went to 1). node scripts/check-doc-example-types.mjs then exits 1 with STALE LEDGER ROW packages/react/src/hooks/useClientNotifications.ts useClientNotifications #1, "no such example in the scan set". After the restore, blob e96381d17 equals HEAD's and git diff HEAD is 0 bytes.

Verification at 6308b6440 (branch head)

Heavy runs went through the shared verify lock. The closure was built first: turbo run build --filter='./packages/*' --concurrency=2 passed 39 of 39 tasks, and @object-ui/example-schema-catalog was also built for apps/site.

  • type-check, downstream direction (@object-ui/react plus its dependents, the consumer side): @object-ui/react, then all 27 dependents that declare type-check (@object-ui/example-hello-world declares none). All report Done with 0 errors:

    • app-shell, cli, components, fields, layout, runner, sdui-parser;
    • plugin-calendar / charts / chatbot / dashboard / designer / detail / form / gantt / grid / kanban / list / map / report / timeline / tree / view;
    • console, site, example-byo-backend-console, example-schema-catalog.

    The first apps/site attempt hit TS2307 on the unbuilt @object-ui/example-schema-catalog. That is a prerequisite failure, not a reading; the re-run after building it exits 0.

  • vitest, from the repo root:

    • pnpm exec vitest run packages/react/ packages/app-shell/src/hooks/: Test Files 140 passed (140), Tests 1703 passed (1703). 140 equals the tracked test-file count of the two paths (94 + 46).
    • pnpm exec vitest run scripts/__tests__/: Test Files 179 passed, 2 skipped (181), Tests 5306 passed, 2 skipped (5308). This covers check-doc-example-types.test.ts, the edited script's own suite.
  • Gates (exit 0 unless noted):

    • check:doc-examples: all 88 ledger rows match;
    • check:doc-snippets: 673 of 673 blocks judged, 0 failed;
    • check:readme-exports: OK, with 0 unbuilt packages;
    • check:new-line-citations: 0 new;
    • check-changeset-presence: 1 changeset declared;
    • check:changeset-claims, also run with this body as --pr-body: nothing flagged;
    • also exit 0: docs:check-links, check:unreferenced-sources, check:doc-types, check:doc-fences, check:doc-example-ids, check:doc-example-readers, check:control-bytes, check:published-dist, check-changeset-no-major, check-changeset-overwrite, check-changeset-fixed.
  • check:node-esm-load (an extra, not in the dispatch list) exits 1. Six entries are NOT MEASURED: its provenance leg refused auth, mobile, permissions, providers, react-runtime and types as shared-turbo-cache replays from sibling worktrees. @object-ui/react was built by this tree and is among the 28 entries loaded.

  • eslint, per-rule counts on the touched files, base against head. The base side was read via git show e6203d756:PATH | eslint --stdin --stdin-filename PATH. Each --format json result held one file, and none was reported as ignored.

    • hooks/index.ts, the cadence test and check-doc-example-types.mjs: {} on both sides.
    • The deleted hook at base: @typescript-eslint/no-explicit-any x4 and react-hooks/set-state-in-effect x1, all warnings. They leave with the file.
    • Invariance: eslint.config.js enables no type-aware linting (no parserOptions.project or projectService), so this diff cannot move a verdict on an untouched file. Repo-wide pnpm lint is left to CI.

Surface

The claim's file surface did not list scripts/check-doc-example-types.mjs. The removal forces its one ledger row out, because the gate goes red on a row whose example is gone (measured above). The script reads the deleted file as text, the kind of reader that item 4 of the dispatch's mechanism list asked to update with the removal. The check is not weakened: the row goes because its subject no longer exists, and the gate's other 88 rows still match.

Acceptance notes

  • Point 4 of triage comment 5548568302 suggested a pin that would let a gate see "a second scheduler over the same ADR-0030 rows". The ruling did not order it, and it is not done here. This PR deletes the only known instance, so a structural guard would be a separate decision. Carrier: none.

Generated by Claude Code

…th zero consumers (objectui#7389)

Removes the published `useClientNotifications` hook (and its
`UseClientNotificationsOptions` / `UseClientNotificationsResult` types)
from `@object-ui/react`, with its barrel export. The hook ran its own
`setInterval` over `client.notifications.list` beside the shell's shared
inbox feed; nothing mounted it.

Follows the removal through its readers:
- content/docs/guide/notifications.md: the "Server-side notifications"
  section now points at the shell's shared inbox feed (`AppHeader`'s
  bell, a `global:notifications` node) instead of teaching the hook.
- sharedInboxFeed.cadence-7249.test.tsx: the header comment that named
  the hook as "the other candidate" records its retirement.
- scripts/check-doc-example-types.mjs: drops the ledger row keyed on
  the deleted file's `@example`, which the gate would report as stale.
- changeset: minor on @object-ui/react, BREAKING, migration = use the
  shell's shared inbox feed.

Claude-Session: https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3044.7 KB 3104.5 KB
Main entry chunk (gzip) 147.8 KB 350 KB
Entry file index-BMvoHMKL.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.68KB 6.20KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.52KB 3.45KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.13KB 7.95KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 544.08KB 129.99KB
core (index.js) 9.22KB 3.71KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 223.86KB 62.25KB
fields (index.js) 256.90KB 65.08KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.40KB 12.91KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 39.28KB 11.09KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.01KB 3.93KB
plugin-calendar (index.js) 51.22KB 14.56KB
plugin-charts (index.js) 74.76KB 20.82KB
plugin-chatbot (index.js) 198.36KB 47.20KB
plugin-dashboard (index.js) 133.59KB 35.39KB
plugin-designer (index.js) 216.12KB 44.37KB
plugin-detail (index.js) 231.66KB 61.23KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 146.34KB 37.47KB
plugin-gantt (index.js) 168.25KB 41.46KB
plugin-grid (index.js) 215.43KB 58.90KB
plugin-kanban (index.js) 49.30KB 15.39KB
plugin-list (index.js) 114.37KB 28.24KB
plugin-map (index.js) 21.83KB 7.07KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.55KB 11.99KB
plugin-timeline (index.js) 30.64KB 8.94KB
plugin-tree (index.js) 10.52KB 3.69KB
plugin-view (index.js) 87.90KB 21.97KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 114.58KB 37.60KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.03KB 1.86KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.78KB 2.09KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.78KB 2.56KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 18.27KB 6.20KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 17.15KB 6.32KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 25, 2026 04:26
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 71a4a53 Sep 25, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-7389-retire-use-client-notifications branch September 25, 2026 04:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

1 participant