Fork me on GitHub
#shadow-cljs
<
2018-12-10
>
skrat05:12:36

I just freshly install shadow-cljs with yarn and tried to use it for the 1st time

skrat06:12:55

It turns out to be a dependency no somewhat newer clojurescript, mine was 1.10.339 and did not contain comp/*source-map-data-gen-col*

pez07:12:39

@thheller: I'm running into two issues with building calva-lib as an npm module. One is that I can't require it when I npm install it, only if I do npm link (which is handy during development). Here's the repo: https://github.com/BetterThanTomorrow/calva-lib

pez07:12:30

Another is that I seem to get a different behaviour when built as an npm module and when built as a node library. I am trying to pinpoint exactly where the difference happens, but wanted to ask if you have heard of such a thing?

achikin12:12:54

@thheller I've managed to integrate funcool/decimal properly.

achikin12:12:14

You said I can donate that back to shadow-cljs. Where should I put it?

achikin15:12:32

I'm a bit concerned. I have quite a huge cljs app. My current cljsbuild+webpack setup generates 871KB app.js + 351KB webpack-bundle.js. While shadow-cljs generates one 3.1MB app.js file. What could possibly be wrong?

wilkerlucio15:12:04

you need to consider the cljs lib overhead (all the imutable data structures), but shadow has a report feature taht you can use to track exactly whats adding up on the bundle

achikin15:12:11

I'm compiling the same code

achikin15:12:42

I have two branches - one with lein cljsbuild and webpack and another one with shadow-cljs

wilkerlucio15:12:36

shadow handles npm differently, there is a chance webpack is doing a better job at DCE on NPM modules, the report can give you more details

achikin16:12:11

I wonder what webpack did to that file...

achikin16:12:53

BTW, does shadow-cljs server serve GZIPed files?

achikin16:12:28

I guess it's not... that's why I spotted so big difference....

achikin16:12:07

Taking gzipped version into account - shadow did much better than my current setup 🙂

pez17:12:00

@thheller: I have a clue to the different behaviour now. In my own code I had to (:require clojure.string) for the :npm-module to work, but not while I was using a :node-library target. And it seems that is what is happening inside a library I am using (`cljfmt`). I get ReferenceError: clojure is not defined.

jstaab22:12:05

Can anyone tell me how to conveniently get the stack trace from shadow-cljs watch test using a node-test autorun build? I tried using the main entry in my shadow-cljs.edn to override the formatter to print a thrown error, but that caused weird watch behavior that I didn't want to figure out. Right now, I'm not using a main module for the build, and I'm getting stuff like:

ERROR in (test-line-item-tax-exempt) (Error:NaN:NaN)
Uncaught exception, not in assertion.
expected: nil
  actual: #object[Error Error: No matching clause: ]

jstaab17:12:44

@thheller any ideas on this?