-
Notifications
You must be signed in to change notification settings - Fork 11
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
Appuniversum icon improvements #482
Comments
In fact, while the svgxuse workaround does work if you're hosting the ember app that is embedded in another domain (for example in an iframe), as svgxuse is still able to request the symbolset. If the app is designed to be bundled within another project, then the symbolset is no longer available and this approach fails. This is the case for the embeddable-say-editor project which can now be installed through npm and in order to work requires overriding |
@Windvis do you have an idea of when this could land/how much work it would be? Just to get an idea for our planning. @piemonkey what is your intuition on how much work this would be to do ourselves? |
@abeforgit The first part could be done fairly quickly, if I can't get time for it this sprint I can probably get time for it in the next one. @piemonkey did the groundwork for the component based icons, and I have a WIP PR that generates icon components from the .svg files. Once both are merged we can use these components internally. I think we should release this as an experimental feature that apps can opt-into though. I don't feel confident enough about this setup to consider it stable, and I might want to change some things which might be breaking, without having to cut a major just for that. The icon inconsistencies are not super high prio, so that can be done later since there is quite a bit of grunt work involved. So current plan:
The embeddable could then update to v3+ and test it out. I'll try to test it in one of the projects I work on as well. If all the kinks are resolved we can release it as a stable feature and deprecate the string setup. |
@piemonkey @abeforgit The icon component setup is released as an experimental feature in 3.4.0. I don't foresee any huge breaking changes in the future. I think the API itself is fine. There might be some breaking changes once we sync the shipped icons with those from Webuniversum, but that will most likely be limited to the removal (in case of duplicates) / renaming of some icons, so should be easy to fix. |
First issue when trying some of the icon components: Some icons have a The symbolset version doesn't have the same issue because the library we use strips out all the We should probably just fix the icons here, and maybe lint them in some way? I'm not the biggest fan of stripping them magically since it just hides the issue and there must be a reason why the attribute was added. As a workaround you can inline the icon in a new component in your project, remove the fill and use that until the issue is resolved in the Appuniversum version. This is something we have to keep in mind when we sync the new icons. |
Ha, funny, I found one of these ( I definitely think stripping the fill from the svg is the way to go. Not sure how best to go about linting them though. |
I think stripping it from the source is the way to go, but I don't like the 'let's do it during the build step' method, at least for now. I don't know enough about svg or why design programs output this attribute when exporting the svg to be sure we can simply strip it in all cases 😄. On the other hand, that's how we were already using the icons before, so it probably would be fine (for the icons we already have). I still think updating the .svg is better though. Maybe we should just check the presence of |
@piemonkey Should be fixed by #488. It solved the issue I noticed at least 👍. |
Small update, I'm not 100% convinced that our current "icons as components" implementation is the best way forward. Ideally we would still output a svg map which can be loaded separately and referenced so we don't bloat the js bundle with icons. I'll need to investigate this some more. |
Wouldn't only the used svgs get pulled in in a (bright future) embroider setup? |
alternative to the symbolset setup [Released as experimental]
Read more
At the moment Appuniversum bundles a list of icons into a svg-symbols file which is also stored in the public folder and which is then referenced in
AuIcon
component.This works, but has some downsides:
A potential solution for these issues is to use icon components, instead of the string based setup we have now. Each .svg file could be converted to a .gts file at build time, and imported like any other component.
The benefits:
For this to work, each component that now accepts a string for the
@icon
argument, would also need to support a component (POC in #481 ).We would also need to refactor our internal usage of the
AuIcon
component, and pass the components instead of the string.TODO:
@icon
arguments ([Experimental] Add support for using components as icons #481)Open questions:
Webuniversum icon inconsistencies
Webuniversum has a lot of icons. Not all of them were added here, and we might also be using some of the legacy ones.
We should compare all the icons we bundle here with the Webuniversum list and document if it is a custom component, or a legacy one.
TODO:
Custom icons
If an icon is not part of the Webuniversum list, we should check were it is being used. If it isn't used, or if a Webuniversum equivalent with a different name exists, we should deprecate it (or otherwise override it).
Legacy icons
We should deprecate the legacy icons and suggest the new equivalent.
Sync all the icons
We should also add all the icons that Webuniversum currently has so they can easily be used without new PRs. Assuming we only support the new icons in the component setup this shouldn't have an impact.
The text was updated successfully, but these errors were encountered: