Add "Icon" prefix for better readability & developer experience #104
joeholdcroft
started this conversation in
Ideas
Replies: 4 comments 3 replies
|
This would be really great! I care about having a solution that's a great experience for both Design and Eng. |
0 replies
|
I understand what you're after, but such a naming change at this point is probably too disruptive for a library of this size and adoption. With the recent addition of JSDOC icon previews, I find it hard to believe the developer experience is that painful. Is it possible for you to enforce an import aliasing rule in your org? import { User as UserIcon } from "@phosphor-icons/react"; |
1 reply
|
An Icon library should not take global names such as |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We're evaluating a bunch of icon libraries at the moment. One of the libraries we're evaluating is Phosphor, and we generally like it but we have an issue with how the React library exports the icons.
Having the icons exported with just their name creates some developer experience problems:
Usericon? We very likely have our ownUsercomponent, and it's super easy to accidentally import the wrong one in your IDEUseris an iconWe did see the note in the readme about importing everything, which helps here, but unfortunately in our build environment it would cause every icon to be bundled. It also doesn't fully solve the autocomplete use case, as we'd have to manually add the import before autocomplete would work (but with named exports we can just type the name and autocomplete will add the import for us)
It's a minor nuisance, but considering how widespread icon use tends to be in applications, it's important to us that we get these details right. This is something that we really like about Tabler, for example.
I appreciate this would be a pretty major breaking change. Nonetheless, might it be something you'd take into consideration?
All reactions