Skip to content

Conversation

@dav-is
Copy link
Member

@dav-is dav-is commented Oct 7, 2025

Migrates this repo to use @mui/internal-docs-infra useTypes (added in mui/mui-public#489). Maintains the existing design and theme.

Preview: https://deploy-preview-2932--base-ui.netlify.app/react/components/accordion#api-reference

New Features

  • Fixes cache key issue with existing type metadata pipeline
  • Removes the need to remember to run pnpm run docs:api, simply running pnpm run docs:build (or pnpm run docs:dev and viewing the page) will update the types. To manually update all the types.md without the cache you can run pnpm docs:validate --types
  • Supports Hot Reloading Type Meta
  • Build time caching for type meta and highlighting per entrypoint
  • Using Typescript Language Service API, reduces single page typedoc generation from 4s to 0.3s (93% decrease) with subsequent navigations in 0.15s
  • Improved Developer Experience for (Cmd/Ctrl)+Clicking imports in VS Code
  • Cleaner diffs for generated files using markdown
  • CI checks for Markdown content (e.g. Vale) now run on the typedocs
  • Committed files are copied 1:1 into llms.txt markdown version
  • Types can be viewed directly in GitHub, which may improve Github Copilot's understanding of the repo
  • Adds support for class exports like Dialog.Handle
  • All hardcoded type tables replaced with automated pipeline (e.g. useRender and other hooks)
  • Add namespaced types like AlertDialog.Trigger.State, or Checkbox.Root.ChangeEventDetails
  • Known types within the page can link to other types, like className: string | ((state: AlertDialog.Popup.State) => string | undefined) will have AlertDialog.Popup.State linked to https://base-ui.com/react/components/alert-dialog#popup.state

@dav-is dav-is added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Oct 7, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 7, 2025

commit: 980d954

@mui-bot
Copy link

mui-bot commented Oct 7, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+11B(0.00%) 🔺+6B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link

netlify bot commented Oct 9, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 980d954
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/698b3356296f4e0008b20c34
😎 Deploy Preview https://deploy-preview-2932--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 13, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 14, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 16, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 2, 2026
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Feb 2, 2026
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@dav-is dav-is marked this pull request as ready for review February 9, 2026 22:50
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 9, 2026

Too many files changed for review. (402 files found, 100 file limit)

@dav-is dav-is requested a review from Copilot February 9, 2026 23:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the docs API reference/type metadata pipeline to @mui/internal-docs-infra type generation and updates the docs + llms.txt generation flow to consume the new precomputed types output.

Changes:

  • Replaced <Reference /> usage in component docs pages with per-part <Types*.X /> type blocks backed by new types.ts entries.
  • Added generated types.md files and types.ts wiring for multiple components.
  • Updated docs build tooling (Next config + llms.txt generator) to load and inline precomputed types, and removed the old reference processor.

Reviewed changes

Copilot reviewed 69 out of 402 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.circleci/config.yml Removes the standalone docs:api generation/dirty-check step in CI.
docs/next.config.mjs Adds webpack/turbopack loaders to load precomputed types from types.ts; removes rehypeReference.
docs/package.json Switches @mui/internal-docs-infra dependency to a URL-pinned build.
docs/scripts/generateLlmTxt/mdxToMarkdown.mjs Replaces <Reference /> processing with typedoc/types.md inlining; removes Type* nodes/headings in the markdown output.
docs/scripts/generateLlmTxt/typedocProcessor.mjs New processor that reads types.md and returns AST nodes for llms.txt generation.
docs/scripts/generateLlmTxt/referenceProcessor.mjs Deletes the old Reference JSON-to-table processor.
docs/scripts/generateLlmTxt/resolver.mjs Hardens markdown link resolution when urlPath/urlsWithMdVersion are missing.
docs/scripts/generateLlmTxt/snapshots/mdxToMarkdown.test.mjs.snap Updates snapshots to reflect new type inlining output.
docs/src/app/(docs)/react/components/accordion/page.mdx Replaces <Reference /> with <TypesAccordion.* /> blocks.
docs/src/app/(docs)/react/components/accordion/types.ts Adds precomputed types wiring for Accordion.
docs/src/app/(docs)/react/components/accordion/types.md Adds generated Accordion API/types markdown.
docs/src/app/(docs)/react/components/alert-dialog/page.mdx Replaces <Reference /> with <TypesAlertDialog.* /> blocks.
docs/src/app/(docs)/react/components/alert-dialog/types.ts Adds precomputed types wiring for AlertDialog.
docs/src/app/(docs)/react/components/alert-dialog/types.md Adds generated AlertDialog API/types markdown.
docs/src/app/(docs)/react/components/autocomplete/page.mdx Replaces <Reference /> with <TypesAutocomplete.* /> blocks (incl hooks).
docs/src/app/(docs)/react/components/autocomplete/types.ts Adds precomputed types wiring for Autocomplete.
docs/src/app/(docs)/react/components/avatar/page.mdx Replaces <Reference /> with <TypesAvatar.* /> blocks.
docs/src/app/(docs)/react/components/avatar/types.ts Adds precomputed types wiring for Avatar.
docs/src/app/(docs)/react/components/avatar/types.md Adds generated Avatar API/types markdown.
docs/src/app/(docs)/react/components/button/page.mdx Replaces <Reference /> with <TypesButton />.
docs/src/app/(docs)/react/components/button/types.ts Adds precomputed types wiring for Button.
docs/src/app/(docs)/react/components/button/types.md Adds generated Button API/types markdown.
docs/src/app/(docs)/react/components/checkbox/page.mdx Replaces <Reference /> with <TypesCheckbox.* /> blocks.
docs/src/app/(docs)/react/components/checkbox/types.ts Adds precomputed types wiring for Checkbox.
docs/src/app/(docs)/react/components/checkbox/types.md Adds generated Checkbox API/types markdown.
docs/src/app/(docs)/react/components/checkbox-group/page.mdx Replaces <Reference /> with <TypesCheckboxGroup />.
docs/src/app/(docs)/react/components/checkbox-group/types.ts Adds precomputed types wiring for CheckboxGroup.
docs/src/app/(docs)/react/components/checkbox-group/types.md Adds generated CheckboxGroup API/types markdown.
docs/src/app/(docs)/react/components/collapsible/page.mdx Replaces <Reference /> with <TypesCollapsible.* /> blocks.
docs/src/app/(docs)/react/components/collapsible/types.ts Adds precomputed types wiring for Collapsible.
docs/src/app/(docs)/react/components/collapsible/types.md Adds generated Collapsible API/types markdown.
docs/src/app/(docs)/react/components/combobox/page.mdx Replaces <Reference /> and hardcoded hook tables with <TypesCombobox.* /> blocks.
docs/src/app/(docs)/react/components/combobox/types.ts Adds precomputed types wiring for Combobox.
docs/src/app/(docs)/react/components/context-menu/page.mdx Replaces <Reference /> blocks with <TypesContextMenu.* /> blocks.
docs/src/app/(docs)/react/components/context-menu/types.ts Adds precomputed types wiring for ContextMenu.
docs/src/app/(docs)/react/components/dialog/page.mdx Replaces <Reference /> with <TypesDialog.* /> blocks (incl handle).
docs/src/app/(docs)/react/components/dialog/types.ts Adds precomputed types wiring for Dialog.
docs/src/app/(docs)/react/components/dialog/types.md Adds generated Dialog API/types markdown.
docs/src/app/(docs)/react/components/field/page.mdx Replaces <Reference /> with <TypesField.* /> blocks.
docs/src/app/(docs)/react/components/field/types.ts Adds precomputed types wiring for Field.
docs/src/app/(docs)/react/components/field/types.md Adds generated Field API/types markdown.
docs/src/app/(docs)/react/components/fieldset/page.mdx Replaces <Reference /> with <TypesFieldset.* /> blocks.
docs/src/app/(docs)/react/components/fieldset/types.ts Adds precomputed types wiring for Fieldset.
docs/src/app/(docs)/react/components/fieldset/types.md Adds generated Fieldset API/types markdown.
docs/src/app/(docs)/react/components/form/page.mdx Replaces <Reference /> with <TypesForm />.
docs/src/app/(docs)/react/components/form/types.ts Adds precomputed types wiring for Form.
docs/src/app/(docs)/react/components/form/types.md Adds generated Form API/types markdown.
docs/src/app/(docs)/react/components/input/page.mdx Replaces <Reference /> with <TypesInput />.
docs/src/app/(docs)/react/components/input/types.ts Adds precomputed types wiring for Input.
docs/src/app/(docs)/react/components/input/types.md Adds generated Input API/types markdown.
docs/src/app/(docs)/react/components/menu/page.mdx Replaces <Reference /> with <TypesMenu.* /> blocks (incl handle).
docs/src/app/(docs)/react/components/menu/types.ts Adds precomputed types wiring for Menu.
docs/src/app/(docs)/react/components/menubar/page.mdx Replaces <Reference /> with <TypesMenubar />.
docs/src/app/(docs)/react/components/menubar/types.ts Adds precomputed types wiring for Menubar.
docs/src/app/(docs)/react/components/menubar/types.md Adds generated Menubar API/types markdown.
docs/src/app/(docs)/react/components/meter/page.mdx Replaces <Reference /> with <TypesMeter.* /> blocks.
docs/src/app/(docs)/react/components/meter/types.ts Adds precomputed types wiring for Meter.
docs/src/app/(docs)/react/components/meter/types.md Adds generated Meter API/types markdown.
docs/src/app/(docs)/react/components/navigation-menu/page.mdx Replaces <Reference /> with <TypesNavigationMenu.* /> blocks.
docs/src/app/(docs)/react/components/navigation-menu/types.ts Adds precomputed types wiring for NavigationMenu.
docs/src/app/(docs)/react/components/navigation-menu/types.md Adds generated NavigationMenu API/types markdown.
docs/src/app/(docs)/react/components/number-field/page.mdx Replaces <Reference /> with <TypesNumberField.* /> blocks.
docs/src/app/(docs)/react/components/number-field/types.ts Adds precomputed types wiring for NumberField.
docs/src/app/(docs)/react/components/number-field/types.md Adds generated NumberField API/types markdown.
docs/src/app/(docs)/react/components/popover/page.mdx Replaces <Reference /> with <TypesPopover.* /> blocks (incl handle).
docs/src/app/(docs)/react/components/popover/types.ts Adds precomputed types wiring for Popover.
docs/src/app/(docs)/react/components/popover/types.md Adds generated Popover API/types markdown.
docs/src/app/(docs)/react/components/preview-card/page.mdx Replaces <Reference /> with <TypesPreviewCard.* /> blocks (incl handle).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// Parse the markdown content and add it to the result
// Removing the leading title and description
return parseMarkdown(typesContent).splice(3);
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

resultis never returned, so the intended "## Types" heading is dropped. Additionally, usingsplice(3)mutates the parsed AST array and returns only the tail; this makes the output dependent on a fixed node count and currently discards the heading you just constructed. Consider returning a concatenated array (e.g.,return [...result, ...parseMarkdown(typesContent).slice(3)]`) so the heading is preserved and the parse output isn’t mutated.

Suggested change
return parseMarkdown(typesContent).splice(3);
return [...result, ...parseMarkdown(typesContent).slice(3)];

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +5
* demoProcessor.mjs - Process demo component directories
*
* This module handles loading and converting demo code examples
* into markdown code blocks for documentation.
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The file header comment appears copy/pasted from the demo processor and does not match this module’s purpose (it processes typedoc/types markdown). Update the header to reflect what this file does so future maintenance is less error-prone.

Suggested change
* demoProcessor.mjs - Process demo component directories
*
* This module handles loading and converting demo code examples
* into markdown code blocks for documentation.
* typedocProcessor.mjs - Process Typedoc types markdown
*
* This module resolves Typedoc components in MDX files to their generated
* types markdown, parses that markdown, and returns AST nodes to be
* inserted into the documentation.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +104
config.module.rules.push({
test: /[/\\\\]types\.ts$/,
use: [
defaultLoaders.babel,
{
loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes',
options: { performance: { logging: true } },
},
],
});
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

This webpack rule matches any file path ending in `types.ts`, which is very broad and can unintentionally apply the precomputed-types loader to unrelated `types.ts` modules. It would be safer to scope the rule to the intended directory/pattern (e.g., only under `docs/src/app/**/types.ts`) to prevent accidental loader application as the codebase grows.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 11, 2026
<Reference component="Accordion" parts="Root, Item, Header, Trigger, Panel" />
import { TypesAccordion } from './types';

### Root
Copy link
Member

Choose a reason for hiding this comment

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

I see that the types.md file already has full content. Why do we need to add each section separately here?

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

Labels

PR: out-of-date The pull request has merge conflicts and can't be merged. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants