Skip to content

[test] Fix react@18/next nightly workflow#48635

Draft
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-ci-react-matrix-fixes
Draft

[test] Fix react@18/next nightly workflow#48635
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-ci-react-matrix-fixes

Conversation

@Janpot

@Janpot Janpot commented Jun 8, 2026

Copy link
Copy Markdown
Member

Fixes the react@18 and react@next nightly CI matrix, which was red across the unit, browser, and visual-regression jobs on master. Each failure is React-version-specific, so they don't surface on the default (React 19 stable) PR runs.

  • test_regressions (react@17/18/next) — the "A11y results committed?" step ran an unscoped git diff --exit-code, but these jobs pin React via package-overrides, which rewrites package.json/pnpm-lock.yaml and tripped the check. Those two files are now excluded from the check (:(exclude)…), so it still verifies the a11y results on every matrix job instead of being skipped.
  • ListItemslotProps.root was typed as plain HTMLAttributes, so the generated propType was PropTypes.object and rejected the callback form that the conformance slotProps.root test passes (a warning under React 18, which still validates propTypes). Typed it as SlotProps like the other slots and regenerated propTypes + API docs.
  • TabTab must render as a direct child of Tabs, which injects state into its children via cloneElement (fullWidth, indicator, selected, …). The theme conformance tests wrap the element in a ThemeProvider, and the old test render made that provider a direct child of Tabs — so Tabs cloned the provider with Tab-internal props, tripping its exactProp check under React 18. The test render now slots Tabs inside the wrapper (ThemeProvider > Tabs > Tab), matching real-world usage, so the provider is never cloned. This keeps every conformance test (and the documented themeDefaultProps capability) intact rather than skipping them. It's a React-18-only workaround (React 19 dropped runtime exactProp validation) — a TODO marks it for removal once React 18 leaves the matrix.
  • useValueAsRef — the ref-identity test latched its first reference during the initial render, capturing the transient object that React 18 StrictMode discards on its mount/remount. It now compares the ref captured after each render settles.

Verified locally against both React 18.3.1 and React 19.2.6 (node and chromium).

Note: the InitColorSchemeScript react@next failures from the same nightly are already handled by #48604.

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy preview

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

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 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


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot force-pushed the worktree-ci-react-matrix-fixes branch 3 times, most recently from 96aaf43 to b902ae0 Compare June 9, 2026 15:19
@Janpot Janpot changed the title [test] Fix react@18/next nightly CI matrix [test] Fix react@18/next nightly workflow Jun 10, 2026
- test_regressions: the 'A11y results committed?' check ran an unscoped
  git diff, but the react@17/18/next jobs pin React via package-overrides,
  which dirties package.json/pnpm-lock.yaml. Exclude those two files so the
  check still verifies the a11y results on every job.
- ListItem: type slotProps.root as SlotProps so it accepts a callback (matches
  the conformance slotProps-callback test); regenerated propTypes + API docs.
- Tab: the conformance theme tests wrap the element in a provider; slot Tabs
  inside that wrapper so Tabs clones the Tab(s), not the provider. Cloning the
  provider with Tab-internal props (fullWidth, indicator, …) tripped its
  exactProp check under React 18. TODO marks it for removal once React 18 is
  dropped (React 19 has no runtime exactProp validation).
- useValueAsRef: compare the ref captured after each render settles so React 18
  StrictMode's discarded initial-mount object doesn't skew the identity check.
@Janpot Janpot force-pushed the worktree-ci-react-matrix-fixes branch from 063a533 to 7c53929 Compare June 10, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant