[docs-infra] ApiPage component migration to mui-docs#48016
Draft
brijeshb42 wants to merge 53 commits intomui:masterfrom
Draft
[docs-infra] ApiPage component migration to mui-docs#48016brijeshb42 wants to merge 53 commits intomui:masterfrom
brijeshb42 wants to merge 53 commits intomui:masterfrom
Conversation
Contributor
brijeshb42
commented
Mar 18, 2026
- I have followed (at least) the PR section of the contributing guide.
Create a configurable <DocsApp> component in @mui/docs/DocsApp that
encapsulates the common provider tree and boilerplate previously
duplicated between material-ui and mui-x _app files.
New module: packages/mui-docs/src/DocsApp/
- DocsApp.tsx: Configurable component rendering the full provider tree
(DocsProvider → CodeCopyProvider → CodeStylingProvider →
CodeVariantProvider → PageContext → DemoContext → ThemeWrapper →
StyledEngineProvider → AnalyticsProvider → children + GoogleAnalytics).
Accepts props for config, serviceWorkerPath, pageContextValue,
demoContextValue, adConfig, ThemeWrapper, and onInit.
- createGetInitialProps.ts: Factory for MyApp.getInitialProps,
parameterized by translationsContext (webpack require.context).
Follows the same pattern as @mui/docs/Document's createGetInitialProps.
- reportWebVitals.ts: Shared reportWebVitals function.
- printConsoleBanner.ts: Exported function for the MUI ASCII banner.
- serviceWorker.ts: registerServiceWorker(swPath) parameterized by path.
- loadDependencies.ts: Material Icons CSS font loading via fg-loadcss.
Moved into DocsApp/ (only used by DocsApp, no external consumers):
- AnalyticsProvider.tsx (from src/AnalyticsProvider/)
- GoogleAnalytics.tsx (from src/GoogleAnalytics/)
- StyledEngineProvider.tsx (from src/StyledEngineProvider/)
Converted _app.js → _app.tsx and _document.js → _document.tsx in both
material-ui and mui-x docs, adding proper TypeScript annotations.
Type fixes in PageContext:
- Added productCategoryId to MuiPageContext interface (was passed at
runtime but missing from the type).
- Relaxed ProductVersion to { text; current?; href? } to match actual
usage (versions are either current or have an href link, not both
required).
Added docs/types/webpack.d.ts declaring require.context() on
NodeJS.Require to support the TypeScript conversion.
…import from @mui/docs directly
…Name, populate AppLayoutDocs index
…refer-default-export for @mui/docs
…, SvgBaseUiLogo to @mui/docs (7.1-7.4)
Netlify deploy previewhttps://deploy-preview-48016--material-ui.netlify.app/ Bundle size report
|
872ef7b to
88a593e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.