Skip to content

[code-infra] Fail API docs generation on undocumented props, slots, and classes - #49600

Open
Janpot wants to merge 10 commits into
mui:masterfrom
Janpot:api-docs-require-descriptions
Open

Janpot wants to merge 10 commits into
mui:masterfrom
Janpot:api-docs-require-descriptions

Conversation

@Janpot

@Janpot Janpot commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

The API docs builder now fails when a prop, slot, or CSS class has no description. Before, undocumented props were silently left off the API page and slots and classes were published with an empty description (for example https://mui.com/x/api/date-pickers/pickers-section-list/#slots).

  • Undocumented props that are only declared in dependencies (React's DOM attributes, Material UI types in MUI X) are hidden instead of failing. Props declared in the repo must be documented or marked @ignore.
  • className (as a string), style (as an object), and ref are never listed, so their JSDoc can stay in the types for IntelliSense. A className with another type, like the Data Grid toolbar components that accept a function of the state, is listed.
  • generateProptypes no longer adds @ignore to every prop without JSDoc, otherwise the check would never fire in Material UI.
  • @internal now hides an item like @ignore. It only worked before by accident.

Merge after the MUI X fixes that link here, so the builder bump in MUI X goes through.

Known trade-offs, not fixed here:

  • The class error says "the type of the classes prop" without naming the interface.
  • When classes resolves through several signatures, the description of the last one wins, so an empty one can fail the check. Nothing hits this today.
  • HIDDEN_JSDOC_TAGS, isHiddenFromApiDocs, and IGNORE_HINT are exported from the package through buildApiUtils. It is an internal package.
  • StandardProps.className has no JSDoc, only CommonProps.className does. This only affects IntelliSense.
  • Hidden className, style, and ref skip the @default check, and ChartsText.style loses its description.
  • ButtonBase tabIndex shows @default 0 on components that inherit it but manage it themselves, like Tab. This is the same for every inherited default.
  • A failing pnpm docs:api leaves the API JSON half deleted, because it cleans the folder first. Failures are just more frequent now.
  • The slot and class checks have no unit tests. pnpm docs:api in CI covers them.
  • Prop errors include a redundant Error: in the middle of the message.

Refs mui/mui-public#1059

…nd classes

Props without a description were silently dropped from the API pages, and
slots and classes were published with an empty description. The API docs
builder now reports all of them per component and fails. `@internal` hides
an item like `@ignore`.

Refs mui/mui-public#1059
@code-infra-dashboard

code-infra-dashboard Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-49600--material-ui.netlify.app/
QR code for https://deploy-preview-49600--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

No regressions in 32 benchmarks · ran 4m 20s · details


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

Undocumented DOM event handlers are hidden instead of failing the check.
Slot and class errors come from parseSlotsAndClasses, which knows the slots
interface and where the classes are declared. The hide tags and the @ignore
hint live in one place, and CSS variables and data attributes honor @internal
too. The DOM event handler list is checked against React.DOMAttributes.
An undocumented prop is hidden when it is only declared in dependencies, like
React's DOM attributes, and fails when the project declares it. This replaces
the list of DOM event handler names, which also hid a component's own
callbacks such as onChange.
The API docs builder now hides undocumented props that come from dependencies
and fails on undocumented props declared in the repo, so the generator no
longer adds `@ignore` to every prop without JSDoc. Documents or explicitly
ignores the 26 props this exposed.
@Janpot
Janpot marked this pull request as ready for review October 28, 2026 16:23
@Janpot
Janpot requested review from a team October 28, 2026 16:23
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 29, 2026
A className that also accepts a function of the state, like in the Data Grid
toolbar components, is component-specific API and stays listed.
…-hard-check

# Conflicts:
#	packages-internal/api-docs-builder/src/utils/extractInfoFromEnum.ts
#	packages-internal/api-docs-builder/src/utils/extractInfoFromType.ts
#	packages-internal/api-docs-builder/src/utils/getPropsFromComponentNode.ts
#	packages-internal/api-docs-builder/src/utils/parseSlotsAndClasses.ts
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 29, 2026
@Janpot Janpot added scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). needs cherry-pick The PR should be cherry-picked to master after merge. v9.x labels Oct 30, 2026

This branch has not been deployed

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

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). v9.x

1 participant