-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: change remaining mui-icons to path imports #155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on your first open-source PR @cwierzbicki00! Glad to have you contributing to mui-tiptap! 🎉
Overall this is looking great! It seems there are a few other icon paths that still also need updating:
- src/controls/MenuButtonBold.tsx:
import { FormatBold } from "@mui/icons-material";
- src/controls/MenuButtonCode.tsx:
import { Code } from "@mui/icons-material";
- src/controls/MenuButtonIndent.tsx:
import { FormatIndentIncrease } from "@mui/icons-material";
- src/controls/MenuButtonOrderedList.tsx:
import { FormatListNumbered } from "@mui/icons-material";
- src/controls/MenuButtonSubscript.tsx:
import { Subscript } from "@mui/icons-material";
Would you be able to handle those in this PR as well? Thanks for documenting the issue and for making the PR!
@sjdemartini Sorry, don't know how my search missed those. Thanks for the kind and thorough feedback. I've corrected the remaining icon paths you've listed from
These are now resolved in my most recent commit in this PR. I also double checked on Github search and my VSCode global search. Hopefully that's all of them now. |
@cwierzbicki00 Thanks for updating this! Looks good to me! I noticed that on this branch, running
and reports One interesting side note: it seems this change to use the icon-specific default exports rather than the top-level named exports actually increases the bundle size very slightly, at least when using rollup (per the bundle visualizer mentioned above). Before (12.04 KB from icons-material)After (19.04 KB from icons-material)I guess there's some slight benefit when it uses the top-level named exports via ESM, vs default exports (via CJS presumably). I don't have much familiarity with why that size-difference would happen or if there's anything we can do about it, and I think your change here is the right way to go regardless to improve compatibility with deployments like Nextjs on Vercel. But per the issue you linked with Vercel, and what I've seen in briefly glancing at other open-source projects that use Thanks again! |
@sjdemartini Thank you very much for the detailed response. I learned quite a bit through this issue and change. I really appreciate mui-tiptap, your diligence, and expertise. You have made my first contribution (although small) quite a valuable experience! I agree 100% with your breakdown. I'll also be adding the lint rule to my projects. Good luck and looking forward to continued use and collaboration! |
Changed the import paths to ensure all mui/icons-material follow a direct import path.
Related is an issue which I just opened #154 .
This should solve the issue. I verified that the affected controls still work as intended.
Please let me know of any changes required. Thanks for your patience as this is my first open source PR. I did my best to follow the contribution guidelines and ran all checks.