Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Inline script in <head> #44922

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Jan 3, 2025

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 oliviertassinari added performance scope: docs-infra Specific to the docs-infra product labels Jan 3, 2025
@mui-bot
Copy link

mui-bot commented Jan 3, 2025

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 🚫 dangerJS against d0e1c20

@oliviertassinari
Copy link
Member Author

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?

@zannager zannager requested a review from siriwatknp January 3, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants