material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs-infra] Inline script in <head>

Open oliviertassinari opened this issue 1 year ago • 3 comments

During the loading of the page, style recalculation is pointed at this logic, so curious to see if we move it to the top, it help with performance (I would expect so).

SCR-20250103-bymn

The logic manipulates document.documentElement which is the <html> element, so already available. It seemed weird that this was in the <body>.

Also, I just checked https://tailwindcss.com does the same, they load this before any CSS, which seems correct.

oliviertassinari avatar Jan 03 '25 00:01 oliviertassinari

Netlify deploy preview

https://deploy-preview-44922--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad) No bundle size changes

Generated by :no_entry_sign: dangerJS against d0e1c20391f798b41a055a7108235d44f5f570ae

mui-bot avatar Jan 03 '25 00:01 mui-bot

Hum, I don't know, hard to see a difference: https://www.webpagetest.org/video/compare.php?tests=250103_AiDcSR_5K,250103_AiDc8N_5M. But maybe it's best anyway?

oliviertassinari avatar Jan 03 '25 00:01 oliviertassinari

https://mantine.dev/guides/next/ looks more correct too.

oliviertassinari avatar Jan 26 '25 22:01 oliviertassinari