Skip to content

Commit 2001f6a

Browse files
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/docs
1 parent f0d90c6 commit 2001f6a

File tree

6 files changed

+261
-470
lines changed

6 files changed

+261
-470
lines changed

docs/docs-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@mui/docs/webpack';

0 commit comments

Comments
 (0)