Repository navigation
[docs-infra] Migrate demos to docs-infra - #23851
Open
brijeshb42 wants to merge 47 commits into
Open
brijeshb42 wants to merge 47 commits into
brijeshb42 wants to merge 47 commits into
Conversation
Deploy previewBundle size
PerformanceNo regressions in 38 benchmarks · precise to ±9.9% (±68.7% at worst) · ran 7m 08s · details Check out the code infra dashboard for more information about this PR. |
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
brijeshb42
marked this pull request as ready for review
October 13, 2026 14:36
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 13, 2026 15:56
a6a72a0 to
89ab5cd
Compare
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 14, 2026 11:57
3c0186d to
4e6d7d2
Compare
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 15, 2026 08:42
4e6d7d2 to
8c1a33c
Compare
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 15, 2026 09:02
8c1a33c to
2b2947d
Compare
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 16, 2026 07:49
59ca5c4 to
2476ac6
Compare
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 16, 2026 13:21
2476ac6 to
d0d9cd7
Compare
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Member
|
Why is this even more files to review? Wouldn't it make sense for most of these to come from build time instead? 🤔 |
brijeshb42
force-pushed
the
docs-infra/migrate-demos
branch
from
October 29, 2026 10:17
d0d9cd7 to
7ae34b7
Compare
Use stable Material 9.5 and the tested core-docs preview. Keep Picker focus behavior while avoiding unused menu and snackbar initialization.
Replace the five internal package previews with published canaries. Remove preview peer overrides and restore the exotic dependency policy. Align CI and Netlify with the packages' Node requirement. Declare the sandbox decoder dependency used by the docs tests.
Pick up mui/mui-public#2125 after its rebase and mui/material-ui#49910, which mounts the live source editor on interaction instead of after load.
Pick up mui/mui-public#2125 and mui/material-ui#49910: the editor now mounts on the first interaction, with the caret at the clicked point, instead of replacing the static source after load. Update the website specs to that contract.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate all MUI X docs demos to
@mui/internal-docs-infra: Data Grid, Charts, Date Pickers, Tree View, Scheduler and Chat. Keep previews, live editing, source controls and sandbox exports while generating JavaScript and highlighting from TypeScript.Demos have one authored source. Replace generated JavaScript and preview files with a demo directory. The audit finds 1,522 entries, 1,547 Markdown references, no legacy demo directives and no missing targets. Helper JavaScript, datasets and workers remain.
CONTRIBUTING.mddocuments demo creation.Markdown loads the new entry. Update imports, regression routes and LLM docs generation alongside the move.
Source controls preserve the running demo. Changing chart type, showing/hiding code and activating the editor keeps the same preview DOM and state. Edits survive collapse/reopen; Reset restores the bundled demo. Pristine focus snippets remain visible; edited full files and selected helpers hide on collapse.
First clicks keep the caret. Full source and contiguous focus snippets use the server-rendered input from mui-public#2125 and material-ui#49910. Hydration binds editing to that input. No idle editor/runner initialization runs. Parser readiness preserves selection and undo; changing source scope or language starts a new history so undo cannot replace a full file with a snippet or JS with TS.
Cold edits retain every file. Root, helper and CSS edits made while the source module loads apply in order. Reset cancels earlier pending edits; focus metadata survives sequential line edits.
Source styles load lazily. The app imports the public syntax stylesheet after mount. Turbopack and Webpack retain colored tokens before editor activation. Long lines scroll; short snippets have no forced scrollbar. material-ui#49874 keeps scrollbar space stable.
Keyboard chart tooltips stay anchored. Removing the frame's layout containment in material-ui#49891 corrects the reported 360px offset. The browser test checks alignment with the focused chart item.
Deferred source avoids the startup chunk map. Content-hashed JSON assets from mui-public#2105 load source metadata when needed. Server rendering and Turbopack retain their existing transport.
Review:
bfe6da876a.Charts review example: KeyboardNavigation.
demos/<slug>is a source directory, not a published docs page.Packages:
3a6cdd04, from mui-public#2125.a4289a759b, from material-ui#49910.The override keeps one SDK runtime across X and core-docs. Scoped overrides retain npm extractor
0.1.1-canary.3, Material UI 9.6.0 and the existing markdown release. Replace previews and remove their temporary overrides after release.blockExoticSubdepsis temporarily disabled for nested preview URLs; restore it with npm packages. No preview patches, core-docs source aliases or local archives remain.Performance at
dffa8c8dbfagainst master (buildEajnNa0G5hdhbm9DZdK11). Lighthouse 13.4.1 with the default simulated throttling, performance category only, headless Chromium, a fresh browser per run, and alternating order within each pair. The PR side used its pinned deploy URL; build IDs stayed the same for every run, and no run failed.Values are medians, master → PR.
Verdict: no regression. The pass bar was a median score no more than 3 points lower and median TBT no more than 50 ms higher; both pages pass. Paired sign tests find no metric that is significantly worse. Mobile TBT is lower (worse in 3 of 15 pairs,
p=0.035), and desktop main-thread work is lower (worse in 0 of 7 pairs,p=0.016). On mobile, the score ranges from 64 to 89 on master and from 68 to 90 on the PR across runs of the same build, so a single DevTools run cannot tell the two apart. The PR loads four more scripts on the mobile page while sending less JavaScript.Tests:
demo-docs.spec.ts: Data Grid editing/reset, errors, languages, keyboard controls, source links and sandbox submissions.tree-view-docs.spec.ts: JavaScript-disabled preview/toolbar/source, accessible readonly input, hydration input identity, hidden focus markers, deep links and shared-module editing/export.demo-variants.spec.ts: source visibility, language/helper switches, computed syntax colors, iframe demos, responsive controls, chart/grid state and keyboard-tooltip coordinates.docs-demo-exports.spec.ts: sandbox peer dependencies and shared helpers.docs-fonts.spec.ts: branded typography across hydration.Validation: native TypeScript, lint, dedupe and frozen install pass with both published preview packages. The SDK passes 6,503 unit/106 browser tests; core-docs passes 348 browser checks across Chromium, Firefox and WebKit. Local production exports cover 734 pages and 112,689 links with zero broken links. Source-variant checks pass 65/65 over five repetitions; fresh-server SSR/hydration, first-click caret, chart DOM/state and scroll checks pass with the final SDK. All 41 final deployed demo website tests pass. The deployed SDK fingerprint matches the published package; first-click caret, chart DOM/state and source/page scroll remain intact. CI is green. The final Material comparison is recorded in material-ui#49910.
Known gaps:
demos/<slug>and return 404; the dashboard fix remains separate. See the review.