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

Lazy load default icon set #263

Open
chggib opened this issue Aug 26, 2024 · 1 comment
Open

Lazy load default icon set #263

chggib opened this issue Aug 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@chggib
Copy link

chggib commented Aug 26, 2024

Is your feature request related to a problem? Please describe.

I really like mui-tiptap. It is easy to use and worked well to sync tiptap with mui. We are undergoing a redesign and using a custom icon set with MUI. Now we don't use material icons. Including the @mui/icons-material bloats the package for me. Material icons are not consistent with the rest of our design. We still use mui for components, theming, and styling.

Describe the solution you'd like

It seems that we can customize extensions by passing custom icons to them. However, looking at the implementation, material icons are being loaded, regardless of whether custom icons have been set.

Instead of directly calling the material icons, you can lazy load them as defaults for non-mapped icons to reduce the bundle size. Thanks!

@sjdemartini sjdemartini added the enhancement New feature or request label Aug 27, 2024
@sjdemartini
Copy link
Owner

Interesting point and idea. I'd have to see what downsides this presents (if any) for the more common default use-case of using icons-material, but the general idea makes sense to me! Open to a PR if you'd like to make one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants