Commit 2001f6a
committed
[docs-infra] Use shared DocsApp from @mui/docs, convert _app and _document to TypeScript
Migrate _app.js → _app.tsx and _document.js → _document.tsx, using the
new <DocsApp> component and createGetInitialProps factory from
@mui/docs/DocsApp. This removes ~170 lines of duplicated boilerplate
(service worker, loadDependencies, console banner, emotion cache,
provider tree, reportWebVitals, getInitialProps) that are now shared
with material-ui via @mui/docs.
Project-specific code retained in _app.tsx:
- Font loading (Inter, Roboto, General Sans, IBM Plex Sans)
- X telemetry initialization
- productId ad-hoc overrides for /x/api/ URLs
- X product identifiers with version env vars
- X demo context with sandbox config (getVersions, includePeerDependencies, postProcessImport)
- Conditional ThemeWrapper for /playground routes
Added docs-env.d.ts importing '@mui/docs/webpack' for require.context()
type declarations.
Updated @mui/monorepo dependency to pick up:
- Shared DocsApp component and utilities
- Optional ProductInfo.logo/logoSvg/wordmarkSvg (not used by MUI X)
- Optional SandboxConfig.getRootIndex (not used by MUI X)
- TypeScript conversions of codeStyling, codeVariant, constants in @mui/docs1 parent f0d90c6 commit 2001f6a
File tree
6 files changed
+261
-470
lines changed- docs
- pages
6 files changed
+261
-470
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments