[docs-infra] Migrate more leaf components to mui-docs#48018
[docs-infra] Migrate more leaf components to mui-docs#48018brijeshb42 merged 7 commits intomui:masterfrom
Conversation
3dceec7 to
a4c264d
Compare
Netlify deploy previewhttps://deploy-preview-48018--material-ui.netlify.app/ Bundle size report
|
| "stylis": "catalog:docs" | ||
| }, | ||
| "devDependencies": { | ||
| "@mui-internal/api-docs-builder": "workspace:*", |
There was a problem hiding this comment.
Needed for types
There was a problem hiding this comment.
Does that mean we'll have to start publishing this as canary as well? (and probably rename to @mui/internal-)
There was a problem hiding this comment.
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.
2578206 to
b435287
Compare
b435287 to
7994089
Compare
There was a problem hiding this comment.
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/ApiPagesurface (types + alert) and aprivatere-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, addses-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.
5f4aed1 to
8e3c6fd
Compare
* 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>
8e3c6fd to
8653cb3
Compare
All these were components inside
docs/src/modules/components/ApiPageand have been moved over topackages/mui-docs/src/ApiPagein an effort to migrate the whole ofApiPagecomponent itself.I am tracking the imports via
@mui/docs/ApiPage/privatepath so in future these imports also can be elimininated once the whole ofApiPagefolder is migrated.Continuation of -
[docs-infra] Migrate simpler modules from docs to mui-docs #47897
[docs-infra] Extract shared App component from _app into @mui/docs #47933
I have followed (at least) the PR section of the contributing guide.