Fork me on GitHub
#shadow-cljs
<
2022-09-19
>
valerauko11:09:42

hey @thheller , i was hoping to give shadow-css a try, but i can't seem to get it to work as expected based on the readme. i use the development watching build described in the readme. it does output the "base" ui.css, but none of the (css) from cljs files seems to make it into the .css file. am i missing something? are there some undocumented expectations about file naming? does it need something extra be put in the index.html or something?

valerauko12:09:43

never mind, figured it out. i didn't notice the * filter in the generate-css function. once i adjusted that it now works as a wonder.

🙌 1
valerauko12:09:01

are there any plans for making the build process smoother (and maybe integrated seamlessly with shadow-cljs)? i'd be happy to help if hands are needed

thheller16:09:46

don't have time to think about making builds smoother or integrated currently

Fredrik Andersson12:09:22

anybody know why I get this

valerauko13:09:34

i suspect something is serving a html 404 page and it doesn't know about your map files

Fredrik Andersson14:09:59

ahh I see now that the mapping is under /app/ but i suspect that it should be above it

Fredrik Andersson14:09:21

I needed to set :asset-path "/app-js"

Fredrik Andersson20:09:17

I must say that I love shadow-cljs! Thanks thheller!

❤️ 3
dehli22:09:01

Hello, I'm trying to reduce a shadow bundle size when using shadow-cljs release with advanced compilation and a browser target. One library that's contributing quite a bit seems to be https://www.npmjs.com/package/@aws-amplify/ui-react. When I remove the library from the codebase, 7M is saved. I was able to slightly reduce its footprint by directly referencing the classes we're using (ex @aws-amplify/ui-react/dist/esm/components/Authenticator) bringing it down to 4.5M, but I'm still seeing much higher than what I get when I bundle it using webpack (700Kb). Any tips to further investigate or different directions I should go? I could permanently use webpack along with shadow if that's the recommended way to go but wanted to check if I can get it working w/ just shadow. Thanks in advance!

thheller04:09:44

if you use many libs that sort of expect webpack (eg. aws-amplify) then you might be better off letting webpack bundle those deps

dehli11:09:32

thanks so much! the build report surfaced that more aws libraries are being pulled in with the shadow build so I'm going to go down the webpack approach. appreciate all your help!