docs(admin): add LoadingOptions interface and AppNav type sources for app-home docs#4453
docs(admin): add LoadingOptions interface and AppNav type sources for app-home docs#4453MitchLillie wants to merge 3 commits into
Conversation
… app-home docs - Adds LoadingOptions interface to loading.ts so LoadingApi's parameter is typed via the interface rather than an inline boolean - Adds AppNavTypes.ts as a hand-written .ts source for AppNav so the type harvester can pick it up and write it to generated_docs_data_v2.json - Adds AppNav.ab.doc.ts to route AppNav docs into the app_home pipeline only (excluded from admin_extensions via tsconfig.ext.docs.json)
🚨🚨🚨 Docs migration in progress 🚨🚨🚨We are actively migrating UI extension reference docs to MDX in the
During this migration, please be aware of the following:
Doc comments in Examples that previously lived in this repo are being moved to the What should I do?
Thanks for your patience while we complete the migration! 🙏 |
2ac7fc1 to
835df9d
Compare
…), not loading(options)
835df9d to
4d31185
Compare
…m components.ts The type harvester found both the generated AppNav class (from components.ts) and our interface (from AppNavTypes.ts) under the same name, picking the class. Renaming to AppNavAttributes gives it a unique name that won't collide.
Summary
Fixes two issues in the app-home-ui-extension docs pipeline.
Issue #2537 — LoadingOptions interface for docs consistency
Context: Tim (docs) noticed that the App Bridge (iframe) loading API has a
LoadingOptionsinterface that renders in the docs as an expandable properties table with anisLoading?: booleanrow. The UI Extension equivalent only hadLoadingApi = (isLoading?: boolean) => void, which renders as a raw function signature — inconsistent with the App Bridge docs presentation.The fix is documentation-only:
LoadingOptionsis added as a standalone@publicDocsinterface so the docs can reference it via<TypeDefinition typeName="LoadingOptions" />and render the properties table. The calling convention is unchanged —shopify.loading(true)/shopify.loading(false)stays exactly as-is.LoadingOptionsis a parallel type for docs presentation, not a change to the function signature.Issue #2539 — s-app-nav not appearing in generated docs
Root cause: Henry added
AppNav.d.ts(a generated declaration file synced from admin-web/polaris) and deliberately did not add AppNav tocomponents.d.ts— becausecomponents.d.tscovers all admin targets, but<s-app-nav>is only available in theadmin.app.home.rendertarget.The problem is that the type harvester (
@shopify/generate-docs) only processes.tsfiles, not.d.tsfiles. The one exception iscomponents.d.ts, which the build script temporarily copies tocomponents.tsbefore running the harvester.AppNav.d.tsis never copied, soAppNavis invisible to the harvester and never appears in the generated JSON. Additionally,AppNav.d.tsis auto-generated — adding@publicDocsto it would be wiped on the next sync.Fix:
AppNavTypes.ts— A hand-written (non-generated).tsfile that exports a documentedAppNavinterface. Because it's a.tsfile with@publicDocs, the type harvester picks it up and writes it into the app_homegenerated_docs_data_v2.jsonthe next timeyarn docs:adminruns. The file uses a localtype ComponentChildren = anyalias so TypeScript compiles cleanly, while the harvester'sgetTypeNameFromValueDeclaration()reads the raw source text and records"ComponentChildren"as the type value, preserving the correct name in generated docs.AppNav.ab.doc.ts— Routes AppNav into the correct pipeline. The.ab.doc.tssuffix meanstsconfig.ab.docs.json(app_home pipeline) includes it, andtsconfig.ext.docs.json(admin_extensions pipeline) excludes it. AppNav only appears in app-home-ui-extension docs, not in regular admin extension docs.How to test
LoadingOptions
yarn docs:adminand inspectdocs/surfaces/admin/generated/app_home/generated_docs_data_v2.json: aLoadingOptionskey should appear with anisLoading?: booleanmember.LoadingApiis still"value": "(isLoading?: boolean) => void"— the signature is unchanged.isLoading) rather than a raw function signature.AppNav in generated docs
yarn docs:adminand inspectdocs/surfaces/admin/generated/app_home/generated_docs_data_v2.json: anAppNavkey should appear withidandchildrenmembers.AppNavdoes NOT appear indocs/surfaces/admin/generated/admin_extensions/*/generated_docs_data_v2.json./docs/api/app-home-ui-extension/2026-07-rc/web-components/navigation/app-nav.Related