Skip to content

[system] Refactor getThemeValue to streamline propToStyleFunction mapping#48640

Open
sai6855 wants to merge 2 commits into
mui:masterfrom
sai6855:size-system
Open

[system] Refactor getThemeValue to streamline propToStyleFunction mapping#48640
sai6855 wants to merge 2 commits into
mui:masterfrom
sai6855:size-system

Conversation

@sai6855

@sai6855 sai6855 commented Jun 9, 2026

Copy link
Copy Markdown
Member

This PR refactors the way style function mappings are handled in getThemeValue.js by removing the redundant filterPropsMapping object and directly utilizing the styleFunctionMapping object

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48640--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 ▼-224B(-0.32%) ▼-44B(-0.18%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


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

@sai6855 sai6855 changed the title Refactor gap-related style functions [system] Refactor getThemeValue to streamline propToStyleFunction mapping Jun 9, 2026
@sai6855 sai6855 added scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Jun 9, 2026
@sai6855 sai6855 marked this pull request as ready for review June 9, 2026 09:27
Copilot AI review requested due to automatic review settings June 9, 2026 09:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 simplifies how getThemeValue builds the propToStyleFunction lookup by removing the redundant filterPropsMapping intermediate object and deriving everything directly from the existing styleFunctionMapping. This keeps the mapping source-of-truth in one place while preserving the same runtime behavior.

Changes:

  • Remove the local filterPropsMapping object that duplicated styleFunctionMapping data.
  • Build propToStyleFunction by iterating styleFunctionMapping and reading each style function’s filterProps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI 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.

2 participants