Fork me on GitHub
#shadow-cljs
<
2022-12-18
>
hifumi12305:12:55

What's the standard way people include svg assets with shadow-cljs? It seems that :asset-path is mostly intended for loading JS modules rather than other assets. My project separates cljs source and svg assets in separate folders (src and assets), respectively. Is there some shadow-cljs command to symlink the folder to my asset-path or is there a much better way to do this? EDIT: For additional context, I am using the default server provided by shadow-cljs. I suppose it wont hurt to finally have a proper server in the front-end

thheller06:12:34

nothing is provided to handle any kind of assets. usually you just put them in the public folder and access them by path

thheller06:12:53

so public/img/foo.svg and [:img {:src "/img/foo.svg"}]

hifumi12306:12:36

Right. I wanted to avoid that since public typically contained compiled cljs artifacts. But I suppose I can also restructure my project so that I always have a public folder with my assets, then I can simply add public/js to my .gitignore

thheller06:12:34

yes, thats what I do

thheller06:12:11

public/js is gitignored as well as public/css. the rest is tracked in git

Joshua Smock15:12:33

Is there a way I denote that a namespace should require every Google source, regardless of if it imported it or not? I’d like to make sure that when a specific namespace is compiled that cljs_env.js has all the Google classes and sources

thheller15:12:25

all? why would you want that? that is a lot. but the answer is no

Joshua Smock15:12:32

I guess the alternative is to just manually add all of the possible Google namespaces as imports?

thheller15:12:44

the question is again for why you'd want to do that? what are you trying to do? some namespaces are goog.module's they only work in the namespace they were required in

Joshua Smock15:12:06

It’s mainly to simplify some compilation step I need to perform for a project I’m working on. I’ll keep brainstorming ways to approach it, thanks!

thheller15:12:10

quick check gives me 1587 google closure source files

thheller15:12:28

so, thats a lot

thheller15:12:05

i doubt anyone has used 1400 of those ever ;)