Fork me on GitHub
Mikko Harju07:09:32

I’m trying to locally bump and test a CLJSJS package version. I updated the version number and MD5-checksum in build.boot and run

maharj:react-leaflet git:(master*) $ boot package install target
Extracting 133 files
Sifting output files...
Sifting output files...
Writing pom.xml and
Writing react-leaflet-1.6.5.jar...
Installing react-leaflet-1.6.5.jar...
Writing target dir(s)...
However, the package is not being installed to my local MVN repo (`~/.m2/repository`) and thus when I added the new version as a dependency to a project I get an error. What am I missing here? I’m completely new to boot since I’ve managed to use leiningen until now. Any ideas how to debug what is not working?

Mikko Harju07:09:55

Ah, nevermind. I was missing cljsjs/ from my prfefix in the dependency.

Mikko Harju07:09:01

I guess Leiningen adds the empty ~/.m2/repository/react-leaflet -directory when I declared it as a dependency. It misguided me.


I have a lib available on js/react-google-maps and I would like to import an object which is in a nested folder places. In javascript that would be: import { SearchBox } from "react-google-maps/places"; but although I have access to the first level objects such as js/react-google-maps.GoogleMap, I can't access js/react-google-maps.places.SearchBox. Do you know what the interop method in that case?


i believe it's ["react-google-maps/places" :refer [SearchBox]]


It doesn't find the namespace, I wonder if it might be due to the way I require Javascript library: through a Javascript file doing the require


the npm support is rather unfinished, you could try asking in #cljs-dev


Can people throw out some names for some very lightweight cljs frameworks please?


frameworks for doing what?


the most general one I can think of is


Hi, quick Q: is it possible to compile some CLJS code into a CommonsJS module for use in a JS project?


I've spent the last hour searching Google and seen many articles talking about including JS modules in a CLJS project but nothing the other way round...

Roman Liutikov15:09:21

Do you want to pass compiled CLJS namespaces directly into something like Webpack?

Roman Liutikov15:09:05

Because ClojureScript compiler emits a lot of code you’d need an optimizing compiler with decent DCE to remove what is not needed, non of JS tools can do it well


@sleepyfox not directly, there’s a different build tool called shadow-cljs that can do that


we might support that in the future but it’s not really a priority


OK, thanks David, I'll take a look


@sleepyfox if you go down that path you still need to understand how Closure Compiler works as @roman01la suggested


if this for client side stuff, you will want advanced compilation and that means you need to understand externs


@dnolen is there any easy way to use the master version of clojure script in a project? I'd like to get the npm-deps fixes?


How do I begin debugging a case where the app doesn't show up under :advanced optimizations, but there's no error in the console?


@urbank trying a different browser, and doing lein clean


@pesterhazy Hm... same on chrome edge and firefox. Did notice that I'm getting


ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: file:/C:/Users/urban/.m2/repository/cljsjs/react/15.3.1-0/react-15.3.1-0.jar!/cljsjs/react/common/react.ext.js at (unknown source) line (unknown line) : (unknown column)


if there’s an error during build then there will be nothing to see


that means nothing got built


Oh... hm though the next line says successfully compiled and it outputs the file.


well that line is wrong 🙂


if Closure emits a hard error, game over


Ok, good to have that cleared up, thanks 🙂


as to that specific error message, you are somehow passing React externs twice


hm... yes. Perhpas I have to add :exclusions somewhere in the deps?


that's an ancient cljsjs/react version too


Which is weird. Isn't it true that if dependencies share a dependency the one at the bottom of the deps will be used? Or is that figment of my imagination?


No longer getting this error after adding enough :exclusions. Now I'm getting a ton of required "some.my_namespace" namespace never provided.


ERROR - required "some.my_namespace" namespace never provided goog.require('some.my_namespace');


all of them seems to have underscores... hmmm


replacing - with _ in the folder names fixed that.


Oooh… :parallel-build true from @mfikes recommendation is awesome! My builds went from 71 seconds to 53 seconds (2012 MacBook Pro w/16 GB memory). Thx @dnolen ! 🙂


@genekim yes for cold builds it’s nice


@genekim If you are curious, the most I've been able to gain is about a speedup of 7 🙂 Here is the repo which has some ridiculous namespaces in it


(To me, this means 8-core boxes are a sweet spot for this kind of work.)


Ha! @mfikes — that’s so great! Looking at your system configuration is making me wonder whether I ordered the wrong system yesterday. 2017 MacBook Pro. 😞 Hahaha.


Oh, a 2017 MacBook Pro is actually faster than a 2012 Mac Pro, I'd bet 🙂


(and your amazing build times… I did a double-take when I saw 20 seconds…)


@genekim Another thing worth trying is fixing the heap at something like -Xmx8g. (Give it a decent amount of RAM, but it also appears to be important that this is limited to a fixed amount. If you don't have such a setting, some builds can actually be slower as the JVM seems to allocate too much RAM, or in some way inefficiently manage things.)


If you are using lein, put something like this in your project.clj:

:jvm-opts ["-Xmx8g"]


Wow, @mfikes… That’s so awesome! 31.451 seconds. THANK YOU! You made my week!!! (and I’ve had a pretty great week already!)


Cool! Presuming you are using the latest compiler as well. It has had something like a speedup of 2 over the past several months (depending on your codebase, of course).


What's the reason cljs doesn't improves js types? ex: (+ "5" 5)


@lockdown- that stuff supported in JS - well defined behavior - in ClojureScript undefined behavior


we issue a warning, and we may do other things in the future - the main reason we don’t bother at the moment is for performance