Skip to content

Regenerate Admin component definitions and docs - #4689

Open
davejcameron wants to merge 1 commit into
2026-10-rcfrom
cx-regenerate-admin-ui-docs
Open

Regenerate Admin component definitions and docs#4689
davejcameron wants to merge 1 commit into
2026-10-rcfrom
cx-regenerate-admin-ui-docs

Conversation

@davejcameron

Copy link
Copy Markdown
Contributor

Background

The Admin components.d.ts aggregate had been generated for a subset of components and then patched by hand, so it had drifted from the components as shipped: AppNav, EmptyState, Number, PressButton and ScrollBox were missing entirely, and internal generator scaffolding had leaked in.

Solution

Regenerated the definitions for the full component set, with no component filter, and rebuilt the 2026-10-rc docs payload. Definitions move from Polaris 2.23.0 to 2.26.0: shared.d.ts gains ProgressProps and generalises the field documentation inherited by Checkbox, Choice, ChoiceList, Option and Switch; Section documents an Icon in its graphic slot and Tooltip among its accessories.

Everything here is generated output.

🎩

  • yarn lint and yarn type-check pass.

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@davejcameron
davejcameron requested a review from a team as a code owner September 11, 2026 20:27
The components.d.ts aggregate had been generated for a subset of
components and then patched by hand, so it had drifted from the
components as shipped: AppNav, EmptyState, Number, PressButton and
ScrollBox were absent entirely, and internal generator scaffolding
(AddedContext, BaseClass, ContextRequestEvent) had leaked in where the
shared PolarisCustomElement base class belongs.

Regenerated for the full component set, then rebuilt the 2026-10-rc docs
payload. Definitions move from Polaris 2.23.0 to 2.26.0: shared.d.ts
picks up ProgressProps and generalises the field documentation inherited
by Checkbox, Choice, ChoiceList, Option and Switch, and Section
documents an Icon in its graphic slot and Tooltip among its accessories.

yarn lint and yarn type-check pass.
@davejcameron
davejcameron force-pushed the cx-regenerate-admin-ui-docs branch from 763912e to e54c7cc Compare September 11, 2026 20:28

@kyledurand kyledurand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like nothing changed except for some wording and the addition of progress component 👍

@jas7457

jas7457 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Heads up before this merges — the three generated_docs_data_v2.json files aren't just picking up wording + the Progress component. Each one grows from ~1.48 MB to ~10.5 MB (≈7×), and that's what the +183,699 / −12,043 diff mostly is.

The cause: every Admin component's members list in the docs payload now includes the entire native DOM prototype surface (HTMLElement/Element/Node), flattened in and marked public. So <s-avatar> etc. now "document" props like accessKey, className, style, innerHTML, onclick, querySelectorAll, ELEMENT_NODE, every aria* reflector and every on* handler — ~320 bogus members per component, across 66 components.

In the base file these didn't exist (Avatar had 4 real members: initials, src, size, alt; now it has 325). This looks like the base-class DOM-flatten guard drifting during regeneration, not intended output — the shopify.dev API reference would render hundreds of native DOM members on every component.

The .d.ts changes themselves look fine (they use class extends, so DOM members stay inherited, not flattened), and the intended additions (Number, EmptyState, AppNav, Progress, the field-wording generalizations, Section's Icon/Tooltip) are all present. It's just the docs JSON that needs a clean regen.

Technical detail for a fix (AI-friendly)

Symptom

  • packages/ui-extensions/docs/surfaces/admin/generated/{admin_extensions/2026-10-rc,app_home,app_home_ui_extension/2026-10-rc}/generated_docs_data_v2.json each go 1,480,849 → 10,522,689 bytes. All three are byte-identical to each other on both sides (same blob SHA), so it's one logical payload mirrored 3×.
  • Structure is data[ComponentName]["src/surfaces/admin/components.ts"].members (a list). Per-component member counts jump ~4–24 → ~325–345.

Root cause

  • The generator walked the class heritage (Avatar extends PolarisCustomElement extends PreactCustomElement extends HTMLElement) and flattened the full HTMLElement/Element/Node member set into each component's members array, instead of stopping at the PolarisCustomElement base. This is the "base-class DOM-flatten guard drift" gotcha.
  • The leaked members are emitted with filePath: "src/surfaces/admin/components.ts" and, critically, without isPrivate: true, so they count as public docs. Net-new public members per component ≈ 321, e.g. accessKey, accessKeyLabel, ariaLabel+all aria*, attachShadow, className, classList, dataset, id, innerHTML, outerHTML, style, tabIndex, title, slot, role, part, popover, querySelector(All), getBoundingClientRect, scroll*, append/prepend/remove/replaceWith, all on* handlers, and the Node constants (ELEMENT_NODE, DOCUMENT_POSITION_*, etc.).
  • Some inherited lifecycle/internal members did get isPrivate: true (setAttribute, updateComplete, click, and symbol members like __@shadowRootSymbol@1816, __@flushRenderSymbol@1817), so the private filter partly fired — but the bulk of the DOM surface slipped through as public.

Fix direction

  • Regenerate with the base-class DOM-flatten guard in place so member collection stops at PolarisCustomElement and does not descend into HTMLElement/Element/Node. Also ensure hidden/private lifecycle + symbol members are excluded.

How to verify the corrected payload

  • data["Avatar"]["src/surfaces/admin/components.ts"].members back down to its real props (~4).
  • Grep the payload for "ELEMENT_NODE", "onwebkitanimationend", "accessKey", "querySelectorAll" → should return nothing.
  • File size back in the ~1.5 MB range; the diff should be small (new components + Progress + wording only), not 7×.
  • No net-new public members whose filePath is src/surfaces/admin/components.ts beyond the actual component props/slots.

posted by an AI agent on Jason's behalf

@jas7457 jas7457 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes — the regenerated generated_docs_data_v2.json payloads have an unintended regression: each Admin component's members list now includes the full native DOM surface (HTMLElement/Element/Node) as public members (~320 bogus members × 66 components), ballooning each file from ~1.48 MB to ~10.5 MB. This looks like base-class DOM-flatten guard drift during regeneration, not intended output. Details and a fix/verification path in my inline comment: #4689 (comment)

The .d.ts changes and the intended additions (Number, EmptyState, AppNav, Progress, wording, Section Icon/Tooltip) look good — just the docs JSON needs a clean regen.

posted by an AI agent on Jason's behalf

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants