Fork me on GitHub

Hi, on I see None-code resources. Should this be Non-code resources? Wondering if this is a typo.


@davewo the cache includes the last-modified timestamps of the source files so if those change it will invalidate the cache. they probably change between CI builds right?


Most likely. So file content does not factor into cache invalidation, then?


currently only timestamp


@hindol.adhya not actually sure. I am German. maybe?


Think that's a typo then. "Non-code resources" is correct English for "resources that are not code".

Ben Hammond10:03:51

Is the DOM available to code that is called using :after-load hook? it is unreasonable to expect

(.getElementById js/document "app")
to be mountable?

Ben Hammond10:03:49

ah I see my misconception; DOM gets built upon page refresh :after-load gets called upon recompilation


no, your conception is wrong


:after-load gets called AFTER the recompiled code has been loaded


YOU trigger the DOM refresh you want to do in after load


shadow-cljs does nothing to the DOM, only your code does


and yes the "app" element is available unless you removed it from the dom yourself

Ben Hammond10:03:31

my restated question is: I configure schema-cljs.edn with my app module thus

        {:main {:entries []}}
and I have to fire up the app from with index.html like this
<div id="app"></div>
    <script src="js/main.js"></script>
and I'm complaining about having to repeat the classname of my app in two places: index.html and schema-cljs.edn but I supppose this is necessary because schema-cljs.edn goes away at release time but the app's main function will still have to get called

Ben Hammond10:03:55

is that right? or is there a smarter way to do things?


:entries is for the google closure compiler and the tree shaking that it does. You probably want to add :init-fn


@ben.hammond instead of entries use {:init-fn }. then you can remove the second script tag that calls the main

👍 4
Chris McCormick12:03:02

am i going crazy or was there a way to slurp a text file into a variable at compile time at some point using shadow-cljs?

Chris McCormick12:03:19

looking through the user guide but i can't figure out what to search on

Chris McCormick12:03:01

thank you so much 🙏


In the shadow-cljs repo, why are there both project.clj and deps.edn? Was just nosing around after dnolen mentioned that CLJS 1.10.597 has a regression that leads to an increased bundle size and noticed that project.cljs has 1.10.597 while deps.edn has 1.10.520, which doesn't have the regression.


@p-himik I tested deps.edn but it is not used and not compatible

👍 4

there are .java sources that need to be compiled


Hi! After adding {:mvn/version "v0.2.0"} to our project, it started failing on release builds with:

IllegalStateException: Could not find where to put constant cljs$cst$keyword$method. Used by [ajax.simple.js, ajax.xhrio.js, ajax.easy.js, sablono.core.js, ajax.interceptors.js,, ajax.xml_http_request.js], selected common dep
There's a reference to a similar issue on, but we don't use :modules. What'd be the next thing to investigate?


The build config is pretty straightforward:

{:target :npm-module
 :output-dir "build/cljs"
 :compiler-options {:infer-externs :auto
                    :source-map true}}


Using an aliased require appears to have fixed it (e.g. [ajax.edn :as edn] instead of just [ajax.edn]) :man-shrugging:


:npm-module basically creates on :module per namespace. so you are definitely using :modules. I can't really remember the details from this previously. If you have something reproducible I can look at I can investigate further

👌 4

I tried coming up with a repro repo, but the commit that failed yesterday works today 😞. The parallel build order might be affecting it


Observed on two different projects, (running shadow .68 and .93)


@thheller Hi, I daily use shadow-cljs ❤️ and it seems to have a minor security issue due to its dependencies to minimist :


please open a github issue. don't have time to look into that right now and it'll get lost in slack void


i think that might have to do with mocha


being the one that eventually pulls in minimist


nm, nice path there :)