Skip to content

[docs-infra] Migrate to @mui/internal-docs-infra Demos#47821

Open
dav-is wants to merge 173 commits into
mui:masterfrom
dav-is:docs-infra/migrate-demos
Open

[docs-infra] Migrate to @mui/internal-docs-infra Demos#47821
dav-is wants to merge 173 commits into
mui:masterfrom
dav-is:docs-infra/migrate-demos

Conversation

@dav-is

@dav-is dav-is commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This helps with #41117

Improvements:

  • roughly 200ms -> 150ms (-25%) hydration time (react-button page)
  • roughly 325ms -> 155ms (-52%) navigation time (react-button page to react-autocomplete page)
  • roughly 605ms -> 305ms (-52%) largest contentful paint after navgiation (react-button page to react-autocomplete page)
  • roughly 53ms -> 19ms (-64%) live editing keyboard input delay (react-autocomplete playground)
  • lazy loads entire demo component except DemoContainer
  • 70% decrease in demo source code line count (~65,000 lines to ~20,000 lines), will help keep diffs smaller
  • Adds collpase / expand animation
  • Maintains code state when expanding and collapsing
  • Code reset button can be undone with Ctrl+Z
  • Multi-file demos have their "Open in Github" link go to the selected file instead of the first file
  • holding backspace doesn't waste CPU re-rendering the demo
  • browser-native cursor changes color since we use content-editable instead of <textarea> overlay
  • using inspect element on highlighted code works instead of selecting the <textarea> overlay
  • TS/JS button won't appear if the .ts file has no inline types (the file is exactly the same)
  • fix keyboard navigation on code toolbar
  • fix bug highlighting type X =
  • support for // @highlight
  • fix padding between Edit in Chat and TS/JS switcher
  • removed continous animation on Edit in Chat button, animates on hover
  • pause demo animations while off screen
  • should improve SEO by including each demo's root file in the HTML (in plaintext)
  • allows Ctrl+Click on demo links to open demo (using file:// URLs)

Preview: https://deploy-preview-47821--material-ui.netlify.app/material-ui/react-button/#basic-button

Migrates to @mui/internal-docs-infra:

Screenshots

image
Screencast.From.2026-06-05.01-06-43.webm
Screencast.From.2026-06-05.01-27-09.webm
Screencast.From.2026-05-26.23-11-09.webm

TODO in this PR:

  • Fix theme reset for demos
  • Fix "Edit in Chat"
  • Tweak expand/collapse animation
  • Add links to dropdown to open in github, copy link, etc
  • Fix fully-hidden code style of demo
  • js to ts link handling
  • fix button animation
  • fix github links when deployed from a fork (is this even possible for Netlify?)

Upstream TODO List (all completed)

@dav-is dav-is 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 Feb 20, 2026
@mui-bot

mui-bot commented Feb 20, 2026

Copy link
Copy Markdown

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against b2866a2

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 23, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 23, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 24, 2026
@brijeshb42

Copy link
Copy Markdown
Contributor

Removed the syntax error cursor position altogether from the tooltip since its misleading, in both collapsed and expanded states since the error points to the transpiled code.
Can be revisited as a separate fix.

@brijeshb42 brijeshb42 force-pushed the docs-infra/migrate-demos branch from 53c1dd2 to b223f69 Compare July 9, 2026 07:55
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 10, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 10, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 13, 2026
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Jul 14, 2026
@Janpot

Janpot commented Jul 14, 2026

Copy link
Copy Markdown
Member

Some unexpected animation when selecting all preview content and typing a new word. Also, all indentation is lost.

Screen.Recording.2026-07-14.at.09.31.39.mov

Entering a new block doesn't add indentation

Screen.Recording.2026-07-14.at.09.34.19.mov

But that doesn't seem a new thing

@brijeshb42

brijeshb42 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
  1. In prod, expanding code always resets the edited preview code, regardless if it was empty or edited. Current behaviour is better compared to that since it retains the edited preview code.
  2. As for indentation, I can check if it can be fixed for first case, but as you already checked, the code editor doesn't indent on prod as well. We can revisit this separately. I suppose this will be in the direction of integrating a full blown editor :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR: out-of-date The pull request has merge conflicts and can't be merged. 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.

5 participants