Skip to content

spec(i18n): the one authority for TranslateFn — the narrowed-t shape — lands in @object-ui/i18n; app-shell and fields re-export it #8261

Description

@os-zhuang

Sub-card of objectui#8165, filed by the director seat on the maintainer's ruling (decision batch #72, 2026-09-07 — option A). Blocks #8165.

The ruling this card executes

(key: string, options?: Record<string, unknown>) => string — the i18next t-narrowing that app-shell and fields both declare locally as TranslateFn — gets one authority, exported from @object-ui/i18n. The two remaining local declarations become type re-exports of it.

Why @object-ui/i18n and not @object-ui/types (B, also dependency-legal): semantic fit — this is a translation-function shape, not a schema type. ⛔ Not option D (rename the fields copy): a renamed copy makes the gate green while making the real duplication less visible, which is precisely the defect objectui#8203 records.

What has to happen

  1. Declare and export TranslateFn from @object-ui/i18n's public face (measure the entry file rather than assume its path — finding(app-shell,fields): TranslateFn is declared three times, character-for-character identical — the cheapest available shrink of the one-authority KNOWN_COLLISIONS baseline #8165's dispatch named a stale index.ts once already).
  2. packages/app-shell/src/providers/writeWarningToast.ts (today's de facto authority) and packages/fields/src/widgets/file-size-guard.ts re-export it: export type { TranslateFn } from '@object-ui/i18n'. saveAdvisoryToast.ts already re-exports from writeWarningToast (PR fix(app-shell): re-point saveAdvisoryToast's TranslateFn at its one authority #8205) and can keep doing so or point at the new home.
  3. The KNOWN_COLLISIONS entry for TranslateFn in scripts/__tests__/one-authority-per-exported-name-6273.test.ts shrinks to zero sites / is removed — the gate itself will tell you which, as it did in fix(app-shell): re-point saveAdvisoryToast's TranslateFn at its one authority #8205's ablation leg B ("lists collisions that no longer exist").
  4. ⚠️ Re-measure that the two remaining declarations are still byte-identical before re-pointing (they were: sha256 29f2f334…, 86 bytes, on 158d75bb3). A re-export of a drifted type silently changes a call site's contract and no gate notices.

Clause-② — YES

This publishes a new name from a shared package (@object-ui/i18n). ⇒ the landing PR carries needs:contract-review. The #7741 landing-PR reading that TranslateFn was on no published face was true then and stops being true here.

Not in this card

Verification the dispatch will expect

Gate before/after; ablation putting a local declaration back and showing the gate reddens; the published .d.ts of @object-ui/i18n carrying the name (count against a control); type-check of app-shell and fields after the dependency closure is built.

Refs: objectui#8165 (parent) · PR #8205 (the landed half) · objectui#8203 (the shape population) · objectui#6172 (the one-authority ruling) · ruling comment on #8165, batch #72.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:queuepriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions