Skip to content

refactor(emerald): extend v0 prop interfaces across the library - #802

Open
johnleider wants to merge 14 commits into
devfrom
refactor/emerald-extends-sweep
Open

refactor(emerald): extend v0 prop interfaces across the library#802
johnleider wants to merge 14 commits into
devfrom
refactor/emerald-extends-sweep

Conversation

@johnleider

Copy link
Copy Markdown
Member

The extends-sweep: 56 of Emerald's 74 hand-written Em*Props interfaces now extend v0's exported prop types — Omit<XRootProps, 'as' | 'renderless'> for the 27 full mirrors (tracking v0), explicit Pick<> key lists for the curated subsets (frozen surface), own-fields for DS-specific props. The 18 without a v0 counterpart (EmCalendar family, EmKanban, and the seven Atom-based presentational components) are unchanged.

Consumer-facing fixes (the drift this closes)

  • rules on EmTextField/EmTextarea accepts rule aliases and Standard Schema validators (inherits InputRootProps['rules']).
  • disabled/readonly/indeterminate accept refs and getters (MaybeRefOrGetter) wherever v0 declares them — and the seven data-disabled/data-readonly truthy-test sites now resolve through toValue(), fixing styling that would have latched permanently on a ref input.
  • Hand-typed unions replaced with v0's exports (EmTabsOrientation = TabsOrientation; EmSliderOrientation = NonNullable<SliderRootProps['orientation']>).

Surface proof

Runtime prop surface diffed from the built bundle across all 90 components at every phase: identical — zero props added, removed, or renamed. The seven toValue wraps are the only non-declaration lines in the 57-file diff. Emerald + dev-app typecheck, emerald build, lint, and the full non-browser suite (4869) all green.

Notes for review

  • as/renderless are deliberately excluded from every mirror: Emerald never forwards them, and inheriting them would have added lying props to 27 surfaces (the SFC compiler treats unresolved extends members as fallthrough attrs — discovered the hard way: Omit<X, keyof AtomProps> typechecks but breaks the build; literal key unions resolve).
  • Emerald-specific JSDoc that inheritance erased is restored via indexed-access own-fields (label?: InputRootProps['label']), keeping the drift pin.
  • A11y gap documented, not fixed (out of scope for a type sweep): EmSnackbar withholds v0's urgent, so every snackbar — including variant="error" — announces as role="status"/polite. Follow-up issue filed.
  • Process note: typecheck alone is insufficient for this class of change — the SFC build and the runtime-props diff each caught a failure typecheck passed.

@johnleider johnleider added this to the v1.1.0 milestone Aug 10, 2026
@johnleider johnleider added the enhancement New feature or request label Aug 10, 2026
@johnleider johnleider self-assigned this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant