Fork me on GitHub
#announcements
<
2023-10-26
>
cjohansen11:10:47

no.cjohansen/fontawesome-clj is a new library for easily rendering https://fontawesome.com/ icons to hiccup in Clojure and ClojureScript: https://github.com/cjohansen/fontawesome-clj

🎉 17
🔤 2
Lidor Cohen19:10:55

Hi @U9MKYDN4Q, Recently we came to realize that using font-awesome's icons dynamically (using strings) has extremely bloated our bundle size. Looking at your library it seem somewhat dynamic (you can use keyword to render any icon without explicitly requiring it). Do you know if it has any effect on the bundle size?

cjohansen19:10:59

Yes, in ClojureScript you use the icons/icon macro around the icon name, refer to the examples in the Readme. Only the icons you use this way will be included in the bundle.

🆒 1
p-himik06:10:19

The CLJS-related code seems to rely on some fontawesome-icons resource that isn't there, which results in:

Encountered error when macroexpanding fontawesome.icons/icon.
IllegalArgumentException: Cannot open <nil> as a Reader.

p-himik06:10:51

Ah, that's what I get for not reading the whole README. :)

p-himik07:10:37

You have probably spent more time on this than I have, but aren't FA's free icons suitable for inclusion in your own sources? Since they're licensed as "CC BY 4.0". The trade-off, of course, is that doing so would shift the work from the users of your library to you when updating to a newer version of FA.

cjohansen07:10:52

Ah, maybe I can include the free ones then. I'm away for the weekend but will look into it next week! 👍 😊