Skip to content

[internal] Add missing #host-reference#48226

Merged
silviuaavram merged 1 commit intomui:masterfrom
silviuaavram:dev/add-missing-host-references
Apr 13, 2026
Merged

[internal] Add missing #host-reference#48226
silviuaavram merged 1 commit intomui:masterfrom
silviuaavram:dev/add-missing-host-references

Conversation

@silviuaavram
Copy link
Copy Markdown
Member

@silviuaavram silviuaavram commented Apr 8, 2026

@silviuaavram silviuaavram self-assigned this Apr 8, 2026
@silviuaavram silviuaavram added the internal Behind-the-scenes enhancement. Formerly called “core”. label Apr 8, 2026
Copilot AI review requested due to automatic review settings April 8, 2026 06:56
@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 8, 2026

Netlify deploy preview

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

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 17bc334

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.com usage 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-guide in the closely related packages/mui-utils/src/elementAcceptingRef/elementAcceptingRef.ts (same warning text) that still lacks a #host-reference annotation. 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.

@silviuaavram silviuaavram merged commit 8938717 into mui:master Apr 13, 2026
24 checks passed
@silviuaavram silviuaavram deleted the dev/add-missing-host-references branch April 13, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants