Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Ports mui/material-ui#47347 and mui/material-ui#47351 to eliminate render-blocking Google Fonts resources and improve Lighthouse performance scores.

Changes

  • docs/pages/_app.js: Migrate Inter and Roboto to next/font/google, export fontClasses
  • docs/babel.config.js: Delete (next/font requires SWC instead of Babel)
  • package.json: Update @mui/monorepo to latest version (d5e68b88) that includes the next/font changes from PR #47347

The _document.js file imports from the monorepo package, which now applies fontClasses to the body tag and removes old Google Fonts link tags. Fonts are now optimized and self-hosted by Next.js instead of loaded from external CDN.


Original prompt

port mui/material-ui#47347 to this repo


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Janpot <2109932+Janpot@users.noreply.github.com>
@mui-bot
Copy link

mui-bot commented Nov 20, 2025

Deploy preview: https://deploy-preview-20407--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 2f1a4bd

Copilot AI changed the title [WIP] Port MUI pull request #47347 to this repository [docs] Migrate to next/font for Google Fonts Nov 20, 2025
Copilot AI requested a review from Janpot November 20, 2025 07:44
Copilot finished work on behalf of Janpot November 20, 2025 07:44
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.

@copilot next/font requires swc, so no babel config

Copy link
Member

Choose a reason for hiding this comment

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

@copilot don't cover this file,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted - removed _document.tsx and restored original _document.js in 66c7655

Co-authored-by: Janpot <2109932+Janpot@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot next/font requires swc, so no babel config

Removed docs/babel.config.js in 66c7655

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Janpot November 20, 2025 08:04
Copilot finished work on behalf of Janpot November 20, 2025 08:04
@Janpot
Copy link
Member

Janpot commented Nov 20, 2025

@copilot for this to work, you'll need to update the @mui/monorepo depednency to latest, such that the last version of _document is used, the one that doesn't contain the font loading anymore

@Janpot Janpot added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Nov 20, 2025
Co-authored-by: Janpot <2109932+Janpot@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot for this to work, you'll need to update the @mui/monorepo depednency to latest, such that the last version of _document is used, the one that doesn't contain the font loading anymore

Updated @mui/monorepo to d5e68b88 (latest master) which includes the next/font changes in e8d66fc

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of Janpot November 20, 2025 08:58
@Janpot Janpot changed the title [docs] Migrate to next/font for Google Fonts [docs] Migrate to next/font for fonts loading Nov 20, 2025
@Janpot Janpot marked this pull request as ready for review November 20, 2025 11:46
subsets: ['latin'],
});

export const fontClasses = `${inter.className} ${roboto.className}`;
Copy link
Member

Choose a reason for hiding this comment

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

technically not being used, but I'm just replicating core _app.js for now

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). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants