Skip to content

[internal] Simplify createPalette#44075

Merged
oliviertassinari merged 3 commits intomui:masterfrom
oliviertassinari:clean-up-create-palette
Oct 12, 2024
Merged

[internal] Simplify createPalette#44075
oliviertassinari merged 3 commits intomui:masterfrom
oliviertassinari:clean-up-create-palette

Conversation

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Oct 11, 2024

Seen in #44059 (comment). The goal is to reduce the memory pressure.

@oliviertassinari oliviertassinari added the internal Behind-the-scenes enhancement. Formerly called “core”. label Oct 11, 2024
@mui-bot
Copy link

mui-bot commented Oct 12, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 6a0ad84

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

Great catch. Alternatively

const getDefault = { dark: getDark, light: getLight };

// ...

  ...getDefault[mode](),

could result in less code 🙂

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Oct 12, 2024

Yeah ok, hoisting this could be even simpler and have better performance.

Soon or later, we will need to get a lot more serious with performance monitoring. Maybe mui/mui-x#14804 (comment) is the solution.

This reverts commit 7859020
@oliviertassinari oliviertassinari merged commit a49333c into mui:master Oct 12, 2024
@oliviertassinari oliviertassinari deleted the clean-up-create-palette branch October 12, 2024 12:34
@oliviertassinari oliviertassinari changed the title [core] Simplify createPalette [internal] Simplify createPalette Feb 6, 2026
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”. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants