Fork me on GitHub
#cljsjs
<
2017-03-03
>
joy11:03:24

Hi! I’m using cljsjs for the first time (specifically, the Dragula library: https://github.com/cljsjs/packages/tree/master/dragula). When I compile with :whitespace optimization, everything works as expected. But when I compile with advance compilation, I get the JS error dragula(…).Xb is not a function My cljs setup is minimal in my project.clj:

:cljsbuild
  {:builds
    [{:source-paths ["src-cljs"]
      :jar true
      :compiler {:output-to "resources/public/js/main.js"
                 :optimizations :advanced}}]}
I assume that I am missing some option somewhere. If someone can spot the error quickly, can you let me know?

joy11:03:36

I think it is actually the click event .on which is translated to Xb

joy12:03:53

is there a way to override the extern locally? I think it is missing the ‘on’ function, but I would like to test it out. If so, I could do a pull request.

juhoteperi12:03:20

yes, you can create local externs

juhoteperi12:03:36

and either include them with deps.cljs or compiler options :externs

juhoteperi12:03:50

or, you can clone packages repo, fix the extern there and install jar to local mvn repo