Closed piemonkey closed 8 months ago
Thinking about this some more. I don't think this will fix the problem in the frontend-embeddable-notule-editor project, since we also use the AuIcon
component internally with some "hardcoded icons" and those would still look at the symbolset version. Making those configurable would be strange, since the icon is just an implementation detail of the component.
So while I still think accepting component for @icon
is a good improvement (to allow custom icons) it still won't fix the problem you are seeing in the project. 🤔
Another PR in the line of PRs attempting to address the issue of inline SVGs.
This time the approach is to allow passing of arbitrary components to
AuIcon
(and by extension, any component taking an@icon
argument).The advantages of this method are that this is very flexible to the user. Also, by overloading
@icon
it avoids confusion that could be caused by adding a new argument, as only one ofstring
orComponent
can be passed.A minor downside is that the user can potentially pass a component that could cause rendering issues.
A risk is that in order to pass arguments to the component, for example; to pass an
AuIcon
as a custom component, you need an argument to specify which icon to use; you must use thecomponent
helper. In this way it is easy to write code that embroider can't statically analyse.