Fork me on GitHub
#shadow-cljs
<
2021-06-30
>
awb9905:06:52

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.

awb9905:06:40

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.

awb9905:06:21

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.

thheller05:06:46

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

thheller05:06:47

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

thheller05:06:16

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

thheller05:06:50

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

awb9905:06:05

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

zendevil.eth16:06:00

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?

zendevil.eth16:06:58

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

thheller19:06:10

@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.

zendevil.eth20:06:00

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

zendevil.eth21:06:38

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: https://www.loom.com/share/31e47c4cd28f487d8340dc99b952a62b 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

sova-soars-the-sora21:06:28

Hmmm... very curious

sova-soars-the-sora03:07:10

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

Aron03:07:50

seeing the config would help a lot

thheller06:07:57

@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"}

thheller06:07:05

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

thheller20:07:18

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

thheller21:07:05

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

😮 2
2
🐝 2
Mitul Shah21:07:53

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

sova-soars-the-sora23:07:08

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?

thheller05:07:47

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