Skip to content

docs(admin): add LoadingOptions interface and AppNav type sources for app-home docs#4453

Open
MitchLillie wants to merge 3 commits into
2026-07-rcfrom
update-loading-appnav-types
Open

docs(admin): add LoadingOptions interface and AppNav type sources for app-home docs#4453
MitchLillie wants to merge 3 commits into
2026-07-rcfrom
update-loading-appnav-types

Conversation

@MitchLillie
Copy link
Copy Markdown
Contributor

@MitchLillie MitchLillie commented May 12, 2026

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 LoadingOptions interface that renders in the docs as an expandable properties table with an isLoading?: boolean row. The UI Extension equivalent only had LoadingApi = (isLoading?: boolean) => void, which renders as a raw function signature — inconsistent with the App Bridge docs presentation.

The fix is documentation-only: LoadingOptions is added as a standalone @publicDocs interface so the docs can reference it via <TypeDefinition typeName="LoadingOptions" /> and render the properties table. The calling convention is unchangedshopify.loading(true) / shopify.loading(false) stays exactly as-is. LoadingOptions is 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 to components.d.ts — because components.d.ts covers all admin targets, but <s-app-nav> is only available in the admin.app.home.render target.

The problem is that the type harvester (@shopify/generate-docs) only processes .ts files, not .d.ts files. The one exception is components.d.ts, which the build script temporarily copies to components.ts before running the harvester. AppNav.d.ts is never copied, so AppNav is invisible to the harvester and never appears in the generated JSON. Additionally, AppNav.d.ts is auto-generated — adding @publicDocs to it would be wiped on the next sync.

Fix:

  1. AppNavTypes.ts — A hand-written (non-generated) .ts file that exports a documented AppNav interface. Because it's a .ts file with @publicDocs, the type harvester picks it up and writes it into the app_home generated_docs_data_v2.json the next time yarn docs:admin runs. The file uses a local type ComponentChildren = any alias so TypeScript compiles cleanly, while the harvester's getTypeNameFromValueDeclaration() reads the raw source text and records "ComponentChildren" as the type value, preserving the correct name in generated docs.

  2. AppNav.ab.doc.ts — Routes AppNav into the correct pipeline. The .ab.doc.ts suffix means tsconfig.ab.docs.json (app_home pipeline) includes it, and tsconfig.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

  1. Run yarn docs:admin and inspect docs/surfaces/admin/generated/app_home/generated_docs_data_v2.json: a LoadingOptions key should appear with an isLoading?: boolean member.
  2. Confirm LoadingApi is still "value": "(isLoading?: boolean) => void" — the signature is unchanged.
  3. In the paired world PR, the loading-api page should render a properties table under "Inputs" (showing isLoading) rather than a raw function signature.
Screenshot 2026-05-12 at 1 48 34 PM

AppNav in generated docs

  1. Run yarn docs:admin and inspect docs/surfaces/admin/generated/app_home/generated_docs_data_v2.json: an AppNav key should appear with id and children members.
  2. Confirm AppNav does NOT appear in docs/surfaces/admin/generated/admin_extensions/*/generated_docs_data_v2.json.
  3. In the paired world PR, the app-nav page should render correctly at /docs/api/app-home-ui-extension/2026-07-rc/web-components/navigation/app-nav.
Screenshot 2026-05-12 at 2 44 36 PM

Related

… 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)
@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

@MitchLillie MitchLillie force-pushed the update-loading-appnav-types branch from 2ac7fc1 to 835df9d Compare May 12, 2026 20:13
@MitchLillie MitchLillie force-pushed the update-loading-appnav-types branch from 835df9d to 4d31185 Compare May 12, 2026 20:14
…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.
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.

2 participants