Fork me on GitHub
#shadow-cljs
<
2018-04-02
>
denik03:04:49

@thheller I’m wondering what might be going with the compilation time of my project. Here’s the case. I’m using reagent with semantic-ui-react. Just requiring (not using) the file containing the wrapped semantic-ui-components (all defonces) at least triples the compilation time for the first as well as subsequent compilations. I can see that the file count is going up but I hope that wouldn’t slow it down so much. Could you shed some light?

[:app] Compiling ...
[:app] Build completed. (207 files, 1 compiled, 0 warnings, 0.46s)
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 1.82s)
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 2.27s)
[:app] Compiling ...
[:app] Build completed. (911 files, 1 compiled, 0 warnings, 1.67s)

thheller09:04:12

@denik compile with --verbose or :verbose true in your config. should make it clearer.

thheller09:04:58

might be that the writing to disk part is actually the slow part since 700 extra files needs to be written

denik14:04:51

Will do. @thheller since the files don’t change can they not be rewritten?

bolasblack14:04:14

Hi thheller, is there posible to create multiple :node-test builds? My shadow-cljs.edn:

{:deps {:aliases [:dev :test]}
 :cache-root ".shadow-cljs"
 :builds {:main {:target :npm-module
                 :output-dir "lib"
                 :compiler-options {:source-map true}}
          :main-test {:target :node-test
                      :output-to "lib/main-test.js"
                      :autorun true
                      :compiler-options {:source-map true}}
          :delay-test {:target :node-test
                       :output-to "lib/delay-test.js"
                       :ns-regexp "-test-delay$"
                       :compiler-options {:source-map true}}}}
Because of some job in namespace *-test-delay will cost lots time, so I hope I can start the test manually.

thheller15:04:02

@bolasblack sure, no problem.

bolasblack15:04:39

I got a warning:

[:main-test] Build completed. (72 files, 0 compiled, 0 warnings, 6.19s)
[:main] Build completed. (174 files, 1 compiled, 0 warnings, 6.25s)
[:delay-test] Compiling ...
[:delay-test] Build failure:
The required namespace "utils.airtable-test-delay" is not available.

thheller15:04:14

do you include that somewhere?

thheller15:04:09

ah is the file named incorrectly perhaps?

thheller15:04:18

with - instead of _?

bolasblack15:04:53

😂😂😂😂 oh sorry

bolasblack15:04:01

I forgot rename the file

bolasblack15:04:31

It's so embarrassing 😣 😂

thheller15:04:06

not really. I would make this mistake constantly if Cursive wouldn't warn me about it.

thheller15:04:52

there should probably be a better error for this. you shouldn't have to guess whats wrong. it should tell you.

bolasblack15:04:55

Thanks for your comfort:laughing:, if the error be better, I think it will save lots my life (I make this mistake many times)

thheller17:04:55

@denik I did some tests and it appears the resolve performance is terrible with so many files. didn't optimize any of that since I didn't expect an issue with it. I'll see if I can tweak that a bit. https://github.com/thheller/shadow-cljs/issues/235

🙏 4
denik17:04:19

Thanks @thheller that’s crucial for DX

denik17:04:28

would yarn over npm bring any benefit?

genRaiy17:04:06

any ideas?

thheller17:04:34

very odd. is maven or clojars blocked maybe?

genRaiy17:04:07

yeah - weird, I’ll check

genRaiy17:04:29

I’m using an AWS CodeBuild CI image

genRaiy17:04:09

I don’t have lein installed but I don’t think Shadow needs that - yes?

thheller17:04:36

not required yes

thheller17:04:25

but pretty much all this code does is maven interop via pomegranate. which is exactly what lein or boot use

genRaiy18:04:42

can I enable any further debug / diagnostics?

thheller18:04:28

unfortunately no. never had issues with this before.

thheller18:04:14

could try shadow-cljs pom and then use mvn directly to resolve the deps. maybe that prints more useful info

genRaiy18:04:55

thanks - i’ll let you know what fixes it

thheller18:04:17

> When you use Maven with an AWS CodeBuild provided Java build environment, Maven pulls build and plugin dependencies from the secure central Maven repository at https://repo1.maven.org/maven2. This happens even if your build project's pom.xml file explicitly declares other locations to use instead.

thheller18:04:28

don't actually know if the settings.xml is used at all but that might be the reason it can't find shadow-cljs since thats on clojars not http://maven.org

genRaiy18:04:54

AWS is quite annoying sometimes 🙂

genRaiy18:04:05

ahem, Maven is not installed

thheller18:04:02

doh. maybe try a temporary project.clj and lein?

genRaiy18:04:39

installing maven now … might just all start to work … one min

thheller18:04:23

maven isn't required by shadow-cljs so that shouldn't affect anything really

genRaiy18:04:35

made no difference so you are right!

genRaiy18:04:49

will try with lein

thheller18:04:57

but does maven tell you anything when using the pom file?

thheller18:04:12

shadow-cljs pom && mvn dependency:tree or so

genRaiy18:04:42

I will give that a try

genRaiy18:04:13

so I think there is something off with the JDK install

thheller18:04:37

very weird indeed. no idea what would cause something like that.

genRaiy18:04:02

seems like a bug in ubuntu

genRaiy18:04:59

the recommended fixes there do the job

genRaiy18:04:28

blimey - we so often find that we are sitting on top of sand