shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
sova-soars-the-sora 2021-06-30T04:29:48.326400Z

i suspect that is not gonna work unfortunately... but i could be wrong

sova-soars-the-sora 2021-06-30T04:31:27.326600Z

the V8 closure compiler ought to do very furious dead-code elimination, so a release build ought to be fairly minimal. will the compilation step in shadow-cljs work without knowing what [the heck] react is? 自信ない (not confident about that)

sova-soars-the-sora 2021-06-30T04:31:54.326800Z

i'm a newb tho so 😅

awb99 2021-06-30T05:05:52.332500Z

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.

awb99 2021-06-30T05:07:40.334300Z

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.

awb99 2021-06-30T05:09:21.336100Z

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.

awb99 2021-06-30T05:12:03.336200Z

this dependencies bring a lot of other dependencies. but it is not oly that, it is also the fact that graal stuff is not very stable in terms of the library ecosystems, so when clojure world has coflicts, then it is related to the graal libraries.

thheller 2021-06-30T05:18:44.336400Z

I always suggest keeping CLJS dependencies separate from CLJ for that reason. I never had a single problem with dependencies that way. If you choose to combine them it is your problem dealing with the conflicts 😛

thheller 2021-06-30T05:20:46.337900Z

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

thheller 2021-06-30T05:21:47.338900Z

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

thheller 2021-06-30T05:22:16.339600Z

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

thheller 2021-06-30T05:22:50.340100Z

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

awb99 2021-06-30T05:23:00.340200Z

yes, but I am delivering shadow as part of my project, because my users need to be able to compile stuff on the fly.

thheller 2021-06-30T05:23:20.340600Z

like in this report https://code.thheller.com/demos/build-report/ui-report.html

thheller 2021-06-30T05:25:56.341200Z

I said this many times before. shadow-cljs is NOT designed to be embedded in other systems and should NOT be used as such. it is designed as a standalone tool, so embedded concerns don't have a high priority right now

awb99 2021-06-30T05:26:05.341500Z

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

thheller 2021-06-30T05:29:34.341600Z

but I'm not much a fan of the graal stuff either, just had to do it quickly to stay compatible with jdk15+ without loosing features

thheller 2021-06-30T05:29:56.341800Z

but I'm ok with loosing this particular feature at some point. or rebuilding it on top of node

awb99 2021-06-30T05:59:11.342Z

I switched to deps.edn away from lein for thst reason. now with deps.edn it works pretty stable.

murtaza52 2021-06-30T07:10:07.342200Z

thanks guys

1💯
zendevil 2021-06-30T16:43:00.349100Z

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 2021-06-30T16:43:58.349900Z

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

thheller 2021-06-30T19:33:10.351100Z

@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 2021-06-30T20:09:00.353200Z

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

2021-06-30T20:43:14.356Z

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

zendevil 2021-06-30T21:01:38.356300Z

It solved itself automatically

sova-soars-the-sora 2021-06-30T21:56:28.356700Z

Hmmm... very curious