[internal] Add missing #host-reference#48226
Merged
silviuaavram merged 1 commit intomui:masterfrom Apr 13, 2026
Merged
Conversation
Netlify deploy previewhttps://deploy-preview-48226--material-ui.netlify.app/ Bundle size report
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds #host-reference annotations in a few internal scripts/types/utilities where https://mui.com links are hardcoded, enabling the repository’s host-rewriting tooling (e.g., deploy previews) to reliably identify these references.
Changes:
- Annotate
https://mui.comusage in the color types generator script. - Annotate hardcoded docs links in a ref-related prop-type validator error.
- Annotate JSDoc/API links in system theming and CSS vars warnings.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/buildColorTypes.js | Marks hardcoded HOST and related JSDoc text as host-references. |
| packages/mui-utils/src/elementTypeAcceptingRef/elementTypeAcceptingRef.ts | Marks the hardcoded docs URL in the warning error as a host-reference. |
| packages/mui-system/src/ThemeProvider/ThemeProvider.d.ts | Marks the API docs link in the JSDoc as a host-reference. |
| packages/mui-system/src/cssVars/createCssVarsProvider.js | Marks the hardcoded docs link in the dev-only warning as a host-reference. |
Comments suppressed due to low confidence (1)
packages/mui-utils/src/elementTypeAcceptingRef/elementTypeAcceptingRef.ts:57
- There’s another hardcoded
https://mui.com/r/caveat-with-refs-guidein the closely relatedpackages/mui-utils/src/elementAcceptingRef/elementAcceptingRef.ts(same warning text) that still lacks a#host-referenceannotation. If the goal is to ensure deploy-preview host rewriting (and keep consistency across these validators), it should be annotated too, or the PR scope/name should be adjusted accordingly.
if (warningHint !== undefined) {
// #host-reference
return new Error(
`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` +
`Expected an element type that can hold a ref. ${warningHint} ` +
'For more information see https://mui.com/r/caveat-with-refs-guide',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mj12albert
approved these changes
Apr 12, 2026
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.
Uh oh!
There was an error while loading. Please reload this page.