Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Simplify createPalette #44075

Merged
merged 3 commits into from
Oct 12, 2024

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 core Infrastructure work going on behind the scenes 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants