Skip to content

refactor(react,fields)!: retire 26 zero-consumer entry exports - #30650

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-r79zcv
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-r79zcv

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #25921. The umbrella stays open; this is barrel batch 4, claim 6667585132 (seat domain:ui#6, batch amendment from the seat after the census). Earlier batches: #30541, #30576, #30629.

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

维护者速读

  • 改了什么:@object-ui/react 的包入口不再导出 20 个名字,其中 7 个连同代码一起删掉(两个无人使用的动效 hook 模块 useReducedMotion / useViewTransition 及其两个类型、useHasPageVariables、getShortcutDescriptions、AnimationTriggerType),其余 13 个只离开入口、模块照旧;@object-ui/fields 的包入口不再导出 6 个名字(四个文件值辅助、筛选条件的额外运算符清单、表格列求和),模块全部保留。
  • 为什么改:这 26 个名字在仓内(包外,含测试与文档)与 hotcrm 均零引用,README 未教,也不被保留导出的签名用到;被删的 7 个在包内也零读者,是死代码。本卡逐包收窄无人使用的公开导出。
  • 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台与所有 @object-ui/* 包不受影响。入口的 export * 改成了具名列表,反向探针证明其余 516 个名字一个不少。回滚即 revert 本 PR。
  • 先看:ui/packages/react/src/context/index.ts 与 ui/packages/react/src/index.ts(export * 改具名列表,漏列即丢活名)、ui/packages/fields/src/index.tsx(三处同类改写)、两份 .changeset/25921-*-zero-consumer-exports.md(迁移说明)。
  • 两分钟验证:git grep -l -w -e useViewTransition -e useHasPageVariables -e NoDataSourcePanel -e sumColumn -- ':!ui/packages/react' ':!ui/packages/fields' ':!**/CHANGELOG.md' 应只命中本 PR 的两份 changeset。
  • 需要你做的:无,席位落地。

What changes

  • @object-ui/react, deleted (nothing inside the package read them either): the modules src/hooks/useReducedMotion.ts (useReducedMotion) and src/hooks/useViewTransition.ts (useViewTransition, ViewTransitionConfig, ViewTransitionResult); the function useHasPageVariables from hooks/usePageVariables.tsx; the function getShortcutDescriptions from hooks/useKeyboardShortcuts.ts; the type AnimationTriggerType from hooks/useAnimation.ts. Each was re-grepped on the new head: the only hits left are this PR's changeset.
  • @object-ui/react, off the entry only (the module keeps its readers): formatUnresolvableVisibilityMessage, evaluateConfigBagInScope, SUPPORTED_TRANSITION_PRESETS, SUPPORTED_EASING_FUNCTIONS, useOptionalTheme, resolveNotificationPresentation, SUPPORTED_NOTIFICATION_DISPLAY_TYPES, SUPPORTED_NOTIFICATION_POSITIONS, SUPPORTED_NOTIFICATION_ACTION_VARIANTS, HostMapStyleContext, RecordPagePreferencesContext, PrintPageContext, NoDataSourcePanel. The entry reached them through export *, so src/index.ts (SchemaRenderer.js, ElementDataSourceGate.js), src/hooks/index.ts (useAnimation.js) and src/context/index.ts (ThemeContext.js, NotificationContext.js, HostMapStyleContext.js, RecordPagePreferencesContext.js, PrintPageContext.js) now name every kept export of those modules, listed from the TypeScript checker's export list; the visibilityDiagnostic named list drops one line.
  • @object-ui/fields, off the entry only: isImageValue, uploadResultView, withRecentUploads, FILE_STORAGE_BASE_PATH (widgets/file-value.ts), FILTER_CONDITION_EXTRA_OPERATORS (widgets/FilterConditionField.tsx), sumColumn (widgets/GridField.tsx). The three export * lines for those modules in src/index.tsx become named lists of their kept exports.
  • Two new changesets, .changeset/25921-react-zero-consumer-exports.md and .changeset/25921-fields-zero-consumer-exports.md: patch level, ! title, BREAKING paragraph that says which names are gone from the package and which only left the entry, FROM/TO lines for every retired name, ADR-0087 marker not-required (runtime-export-retired …) naming every operand.
  • No test moves: no in-package test imports a retired name from the entry, and the deleted code had no test.

Why

Card #25921 narrows ui/packages barrels to names someone imports. The checker export list after this PR is exactly the census list minus these 26 (react 324 to 304, fields 218 to 212), nothing added, and every kept name resolves to the same declaring module as before.

Tests

Census on origin/main b90a6f7 with the method of batches 1 to 3: entry export names from the TypeScript checker; per name git grep -l -w -F outside the package, minus **/CHANGELOG.md, pnpm-lock.yaml and .changeset/** (test files count); the package *.md (glob, top-level README included) and demo/; keep rule 3 (reached from a kept export's declared signature, walked through non-exported local declarations too, which is what keeps DropZoneConfig); hotcrm 6961ab1. Full table: project file issue-25921-seat6/census-b4.md.

Package Entry names Zero outside hits Kept (README, rule 3, or seat ruling) Retired
@object-ui/react 324 104 84 (79 rule 3, 5 by seat ruling) 20
@object-ui/fields 218 31 25 (2 README, 19 rule 3, 4 by seat ruling) 6

Kept by seat ruling, zero hits notwithstanding: react UNRESOLVABLE_ENABLEMENT_PREFIX (the entry comment names a host contract, and its sibling UNRESOLVABLE_VISIBILITY_PREFIX has readers), createLazyPlugin / preloadPlugin / LazyPluginOptions (content/docs/frontend/architecture-overview.mdx teaches the module), RELATED_CHANGED_EVENT (plugin-detail spells its literal); fields UploadIncompleteError (thrown by the kept fileValueForSubmit), deriveHexBadgePalette / HexBadgePalette / UrlCellRenderer (declared in index.tsx, a module move).

Controls (outside hits): SchemaRenderer 1104, ElementDataSourceGate 102, useTheme 13, usePageVariables 10, useNotifications 9, usePrintPage 7, HostMapStyleProvider 5, reportUnresolvableVisibilityPredicate 3, useRecordPagePreferences 3, useConfigBagEvaluator 3, useAnimation 1, useKeyboardShortcuts 1; isMatchAllCriteria 10, fileValueForSubmit 2, readFileValue 2, lookupAutofillPatch 2; hotcrm imports @object-ui/react in 3 files.

Readings at c5c2149:

  • Build: turbo run build --filter=@object-ui/console... --filter='./packages/**' --filter='@objectstack/dogfood^...' 113 of 113, VERDICT command-exit 0; then turbo run build --force --filter=@object-ui/react --filter=@object-ui/fields (50 of 50) and type-check for both (tsc --noEmit && tsc -p tsconfig.test.json), VERDICT command-exit 0.
  • pnpm --filter @object-ui/react test: Test Files 137 passed (137), Tests 1568 passed (1568), exit 0. pnpm --filter @object-ui/fields test: Test Files 298 passed, 1 skipped (299), Tests 4467 passed, 7 skipped (4474), exit 0.
  • Reverse check on the rebuilt .d.ts, covering every kept name and not only the retired ones: two temporary app-shell probes re-exporting ALL 324 base entry names of @object-ui/react and all 218 of @object-ui/fields, tsc --noEmit -p tsconfig.json in ui/packages/app-shell: exactly 26 errors (TS2305 / TS2724 … has no exported member), all in the probes, and the set of names they name is identical (diff) to the 26 retired names; the other 516 resolved. Probes deleted; git status clean.
  • vitest run scripts/ (ui): Test Files 170 passed, 2 skipped (172); Tests 4970 passed, 2 skipped (4972); VERDICT command-exit 0.
  • Derived gate families (dispatch-gates --commands): 29 derived, 29 run, each exit 0 captured before any pipe; --ran reconciliation: 29 run, 0 NOT-MEASURED (a derived zero: all 29 recorded an exit code, none is 3). check-platform-checklist --changed-from origin/main: exit 0, 0 anchored files.
  • Dogfood battery (closure above plus pnpm --filter @objectstack/dogfood test under the lock): Test Files 420 passed, 3 skipped (423); Tests 3504 passed, 36 skipped (3540); VERDICT command-exit 0 (20m45s, shared box).
  • No ablation: export lines and dead declarations removed, no tested behaviour changed.
  • Consumer type-check (Type Check UI) is CI's: no consumer imports a retired name (census), and the reverse probe reads the same rebuilt .d.ts the consumers read.

Acceptance notes

  • Branch name is the platform-assigned claude/project-thread-r79zcv, not claude/issue-25921-*.
  • content/docs/frontend/architecture-overview.mdx:143 says plugins are wrapped by LazyPluginLoader, but createLazyPlugin / preloadPlugin have no reader anywhere outside their own jsdoc test; deleting the module and correcting that paragraph is a separate decision (kept here by seat ruling).
  • plugin-detail RelatedList.tsx and two of its tests write the objectui:related-changed literal instead of importing RELATED_CHANGED_EVENT.
  • A contract-review-tier review is owed before the queue (narrowing batch); the seat runs it.
  • Left for later batches: components (about 65 zero-hit shadcn sub-parts), core (about 47), layout / plugin-editor / permissions (1 each); fields names declared in index.tsx need a module move first.

Generated by Claude Code

Barrel batch 4 of the zero-consumer sweep: react 20 names (two dead
hook modules, two dead helpers and one dead type deleted), fields 6.

Claude-Session: https://claude.ai/code/session_01L6bhgU8CeF9ECf7uDwJLVA
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2

维护者速读

席位核对 — ACCEPT · head c5c2149

  • 形态:11 文件 +121/−243(两包入口与 react 的 hooks/index.ts、context/index.ts,删除两个 hook 模块与两个函数、一个类型,两份 changeset)。check-governed-merges --pr 30650:NOT governed,364 行 ≤ 3000。Part of #25921,draft,目标 main,merge-tree 对 main 干净。批次与认领 6667585132 及其批次修订一致;31 个 open PR 都没碰这些入口与两个 hook 模块。
  • 契约(收窄,契约复核档):Clause-② no (narrowing),Metadata-protocol none。席位在 head 上独立复核:26 个退役名在各自包目录之外(排除 CHANGELOG 与 .changeset)全部 0 处;删掉的 5 个名字(两个 hook、useHasPageVariables、getShortcutDescriptions、AnimationTriggerType)在分支 ui/ 下除 changeset 外 0 处。export * 改成的具名列表:dev 的反向探针覆盖全部 542 个旧入口名,恰好 26 个报错,名单与退役名一致,其余 516 个都解析得到,所以没有活名掉出入口。保留项各有理由:UNRESOLVABLE_ENABLEMENT_PREFIX(入口注释教宿主按它过滤)、createLazyPlugin / preloadPlugin / LazyPluginOptions(docs 在教)、RELATED_CHANGED_EVENT、UploadIncompleteError(保留导出 fileValueForSubmit 会抛出)、定义在 index.tsx 内的三项(需搬模块)。两份 changeset 各有 ! 标题、BREAKING 段、FROM/TO 与 runtime-export-retired 的 ADR-0087 标记。收窄无未述的使用方,席位接受。
  • 前提实测:dev 报告 6668839680,读数都在 c5c2149 上:两包强制重建 + type-check 通过;react 137 文件 1568 例、fields 298 文件 4467 例绿;派生门禁 29/29 exit 0;dogfood 420 文件 3504 例,VERDICT 0。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped,0 红。
  • 接受的偏差:① 本批删了死代码(认领修订允许,限包内连测试都零读者的),不只是离开入口。② 具名列表让这些模块以后新增的导出不再自动出现在入口,属于有意收紧。③ PR 归属块链接卡线程,与前几批一致。
  • 范围外去向:core(约 47 个)、components(约 65 个 shadcn 子部件)以及 fields 里定义在 index.tsx 内的三项,留在 retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921。子路径入口等 check-adr-0087(runtime-export-retired): the operand names only a package's root entry, so a retired SUBPATH export (./locales/zh → ./locales/zh-Hans) can only be held as no-migration-prescription #30598。落地时写进 Release,卡回 pm:queue。
  • 落地条款:中继 pr_ready + automerge_enable。合并后卡不关(Part of),席位同一笔摘掉 pm:dispatched、换回 pm:queue、取消指派,留 Release 评论。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 21:01
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 21:01
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 8fefefd Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-r79zcv branch November 5, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant