-
-
Notifications
You must be signed in to change notification settings - Fork 368
[docs-infra] Migrate to @mui/internal-docs-infra Type Generation #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Too many files changed for review. ( |
There was a problem hiding this 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 newtypes.tsentries. - Added generated
types.mdfiles andtypes.tswiring 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); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
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.
| return parseMarkdown(typesContent).splice(3); | |
| return [...result, ...parseMarkdown(typesContent).slice(3)]; |
| * demoProcessor.mjs - Process demo component directories | ||
| * | ||
| * This module handles loading and converting demo code examples | ||
| * into markdown code blocks for documentation. |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
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.
| * 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. |
| config.module.rules.push({ | ||
| test: /[/\\\\]types\.ts$/, | ||
| use: [ | ||
| defaultLoaders.babel, | ||
| { | ||
| loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes', | ||
| options: { performance: { logging: true } }, | ||
| }, | ||
| ], | ||
| }); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
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.
| <Reference component="Accordion" parts="Root, Item, Header, Trigger, Panel" /> | ||
| import { TypesAccordion } from './types'; | ||
|
|
||
| ### Root |
There was a problem hiding this comment.
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?
Migrates this repo to use
@mui/internal-docs-infrauseTypes(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
pnpm run docs:api, simply runningpnpm run docs:build(orpnpm run docs:devand viewing the page) will update the types. To manually update all the types.md without the cache you can runpnpm docs:validate --types4sto0.3s(93% decrease) with subsequent navigations in0.15sDialog.HandleuseRenderand other hooks)AlertDialog.Trigger.State, orCheckbox.Root.ChangeEventDetailsclassName: string | ((state: AlertDialog.Popup.State) => string | undefined)will haveAlertDialog.Popup.Statelinked tohttps://base-ui.com/react/components/alert-dialog#popup.state