Skip to content

[docs-infra] Migrate more leaf components to mui-docs#48018

Merged
brijeshb42 merged 7 commits intomui:masterfrom
brijeshb42:docs-infra-apipage
Mar 20, 2026
Merged

[docs-infra] Migrate more leaf components to mui-docs#48018
brijeshb42 merged 7 commits intomui:masterfrom
brijeshb42:docs-infra-apipage

Conversation

@brijeshb42
Copy link
Contributor

@brijeshb42 brijeshb42 commented Mar 18, 2026

All these were components inside docs/src/modules/components/ApiPage and have been moved over to packages/mui-docs/src/ApiPage in an effort to migrate the whole of ApiPage component itself.
I am tracking the imports via @mui/docs/ApiPage/private path so in future these imports also can be elimininated once the whole of ApiPage folder is migrated.

Continuation of -

@brijeshb42 brijeshb42 requested a review from a team March 18, 2026 10:12
@brijeshb42 brijeshb42 added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Mar 18, 2026
@brijeshb42 brijeshb42 marked this pull request as ready for review March 18, 2026 10:12
@mui-bot
Copy link

mui-bot commented Mar 18, 2026

Netlify deploy preview

https://deploy-preview-48018--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 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

Generated by 🚫 dangerJS against 8653cb3

"stylis": "catalog:docs"
},
"devDependencies": {
"@mui-internal/api-docs-builder": "workspace:*",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed for types

Copy link
Member

Choose a reason for hiding this comment

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

Does that mean we'll have to start publishing this as canary as well? (and probably rename to @mui/internal-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can wait till the 100% migration PR. Its not needed right now since the types are mostly used internally within the mui-docs package.

I'll get to know in the equivalent migration PR in X.

@brijeshb42 brijeshb42 requested a review from a team March 18, 2026 10:47
@brijeshb42 brijeshb42 force-pushed the docs-infra-apipage branch 2 times, most recently from 2578206 to b435287 Compare March 18, 2026 13:44
@brijeshb42 brijeshb42 requested review from Janpot and mj12albert March 19, 2026 05:51
@Janpot Janpot requested a review from Copilot March 19, 2026 10:06
Copy link
Contributor

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

This PR continues the docs-infra migration by moving additional ApiPage leaf components from docs/ into packages/mui-docs/, then rewiring the docs site to consume them via @mui/docs/ApiPage/private.

Changes:

  • Adds a new @mui/docs/ApiPage surface (types + alert) and a private re-export entrypoint for migrated internals (sections/definitions/lists/tables).
  • Updates docs pages (ApiPage, ComponentsApiContent, HooksApiContent, MarkdownDocsV2) to import API helpers/components from @mui/docs/ApiPage/private.
  • Updates tooling/dependencies (eslint config exception for mui-docs, adds es-toolkit + @mui-internal/api-docs-builder).

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lock entries for new deps used by extracted/migrated code.
packages/mui-docs/package.json Adds es-toolkit + @mui-internal/api-docs-builder to support new ApiPage modules.
eslint.config.mjs Disables import/prefer-default-export for packages/mui-docs/src/**/*.ts(x).
packages/mui-docs/src/utils/index.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/NextNProgressBar/NextNProgressBar.tsx Removes no-longer-needed eslint suppression.
packages/mui-docs/src/Link/SkipLink.tsx Switches to local relative i18n import + removes eslint suppression.
packages/mui-docs/src/Document/getInitialProps.tsx Removes no-longer-needed eslint suppression.
packages/mui-docs/src/Document/Document.tsx Switches imports to local mui-docs sources (branding/fonts).
packages/mui-docs/src/DocsApp/serviceWorker.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/DocsApp/reportWebVitals.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/DocsApp/loadDependencies.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/DocsApp/createGetInitialProps.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/DocsApp/consoleBanner.ts Removes no-longer-needed eslint suppression.
packages/mui-docs/src/ApiPage/index.ts Introduces public ApiPage exports (alert + types).
packages/mui-docs/src/ApiPage/types.ts Adds shared ApiPage types (ToC params + layout storage keys).
packages/mui-docs/src/ApiPage/private.ts Adds private re-export barrel for migrated internals.
packages/mui-docs/src/ApiPage/ApiWarningAlert.tsx Converts default export to named export for re-exporting consistency.
packages/mui-docs/src/ApiPage/definitions/* Migrates/collocates API definition helpers/types into mui-docs.
packages/mui-docs/src/ApiPage/list/* Migrates expandable list UI pieces into mui-docs.
packages/mui-docs/src/ApiPage/table/* Migrates/stabilizes table UI pieces; switches to named StyledTableContainer.
packages/mui-docs/src/ApiPage/sections/* Migrates section components; standardizes on named exports + ApiDisplayLayout type rename.
docs/src/modules/components/MarkdownDocsV2.js Switches to ToC helpers from @mui/docs/ApiPage/private.
docs/src/modules/components/HooksApiContent.tsx Switches to @mui/docs/ApiPage/private for shared sections/helpers.
docs/src/modules/components/ComponentsApiContent.tsx Switches to @mui/docs/ApiPage/private for shared sections/helpers.
docs/src/modules/components/ApiPage.tsx Switches to @mui/docs/ApiPage/private and centralizes shared types.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

You can also share your feedback on Copilot code review. Take the survey.

brijeshb42 and others added 7 commits March 19, 2026 21:14
* Setup eslint to allow named exports from @mui/docs package
`getPropsToC` in `PropertiesSection` and `getPropertiesToc` in
`definitions/properties` were doing the same job. `getPropsToC` took
raw `componentProps` and `componentName` and built ToC entries with
hashes inline, while `getPropertiesToc` expected pre-processed
`PropertyDefinition[]`.

- Extend `getPropertiesToc` to accept either `properties` (pre-processed)
  or `componentProps + componentName` (raw), deriving the entries and
  hashes internally in the latter case.
- Remove `getPropsToC` from `PropertiesSection` along with the now-unused
  `ComponentApiContent`, `kebabCase`, and `Translate` imports.
- Update `MarkdownDocsV2` to call `getPropertiesToc` directly with the
  same params that were previously passed to `getPropsToC`.
- Fix `MuiApi-expend-button` typo → `MuiApi-expand-button` in
  `ExpandableApiItem`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

Should be good

@brijeshb42 brijeshb42 merged commit 9ce5247 into mui:master Mar 20, 2026
23 checks passed
@brijeshb42 brijeshb42 deleted the docs-infra-apipage branch March 20, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants