Fork me on GitHub

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


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*


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


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?


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


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


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?


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


I'm compiling the same code


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


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


I wonder what webpack did to that file...


BTW, does shadow-cljs server serve GZIPed files?


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


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


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


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: ]


@thheller any ideas on this?