Fork me on GitHub

I found an artice on modules with react. Are there any other explainations available? I would like to use something similar, but I dont want to go to react level, but stay on reagent. Is there a way how to interact with the shadow module loader? Can I trigger module load myself and get a callback when it is loaded? Also, I am not totally sure how to move enough code to the modules. I guess that I have to make sure that there are not too many entry calls to each module, as otherwise I dont know when to load it? does this work only with ui functions or all functions? I guess I have to make sure that each module does only have calls of its own functions, a otherwise all namespaces would be grouped together into the main module? what happens with common utility functions? they all would always go to main module.


A second related question is, if I can post-process the bundle-size report of shadow someway? To me the logicall grouping many times does not represent to what I consider a common cost factor. So I would like to consolidate multiple such namspaces to one line.


And a last question: I have many goog namespaces on internationalization and date/time and calendars. Can I find out how they end up in my bundel? I cannot exactly tell how big they are, but inspecting the bundel visually, this is a lot of static data.


there is only like 2 lines react specific code so I don't see a problem with that


the bundle report is not customizable no. it is meant to show overall size and easily identifiable "outliers" size-wise (eg. cljs.pprint)


but all the data it collects is available so if you want to dig into it feel free to write your own output format and visualizations


if you are on a new enough shadow-cljs version you can just mouse over the namespaces to see what required them


thanks @thheller I just looked at the new report - I LOVE IT!!!!!!!!!!!!!!!!!! AMAZING! so useful!! thaaaankkkks


I started the shadow repl with cider-jack-in and also started the watch with (shadow/watch :app), however, I’m getting this in the browser: Stale Output! Your loaded JS was not produced by the running shadow-cljs instance. Is the watch for this build running?


Although when I save something, the js does get compiled, according to the message in the shadow repl


@ps this is commonly caused by either having 2 instances of shadow-cljs for the same project running. or just changing paths but not updating them in the HTML and thus loading old files.


@thheller It occurs even after restarting my machine and rerunning the shadow REPL, and I have also changed no paths.


It solved itself automatically

Mitul Shah20:06:14

hi has anyone here set up tailwind JIT for their repo? i’m having some trouble i have this weird bug which is best explained through this video: If I open port 8080, the updated styles don’t seem to apply on hot reload If I open port 8081, the styles work fine and then if I go back to 8080, it also works fine. worth noting, we have a local firebase http server running on 8080 hence why we have 2 ports


Hmmm... very curious


I think we need more info about your build environment... shadowcljs is hosting a server on 8080 presumably... what is hosting the server on 8081? You mention Firebase is also hosting something on 8080...

Mitul Shah03:07:21

8081 is just shadowcljs without firebase connection


seeing the config would help a lot


@U023KKYKZNE I can't see your build config anywhere but if you are NOT using :dev-http then you need to configure :devtools {:watch-dir "foo/bar"}


the built-in :dev-http logs all requests and automatically figures out which css files to watch. so when it knows about the paths once (by visiting 8080) it'll then also work for 8081. :watch-dir should fix it so it works without visiting 8080 first

Mitul Shah20:07:39

no luck with this sadly 😞 but thank u

Mitul Shah20:07:30

not 100% sure what my build config is but i assume this – nothing there


your build config is the config you have in shadow-cljs.edn :builds

Mitul Shah20:07:15

i added the watch-dir even tired targeting actual file but nothing


because your :watch-dir likely needs to be "resources/public"

😮 2
🐝 2
Mitul Shah21:07:53

looks like it works!!!! thank you so much why didn’t /css work?


Oh, so if the :`watch-dir` is set to resources/public/css the browser location localhost:8080/css/hax.css will actually ask for public/css/css/hax.css is that right?


yes, should be resources/public. always the "root" + the full path used in the browser