Fork me on GitHub

@cancandan I recommend looking at #figwheel-main for hot reloading goodness

Shako Farhad12:08:53

Anyone know a good QR reader and QR creator library for cljs?


@shakof91 it should be easy to use an existing JS library for that too

Shako Farhad15:08:21

I am always star struck when you answer! :D We are using leiningen with lein figwheel. I guess for the best use of js libraries and npm we need to go over to shadow-cljs, right? I wish there was a guide on how to setup a complex shadowcljs (with leinigen perhaps) project.clj file. :x


@shakof91 The simplest way to use JS libraries for leiningen is I see they have two packages when searching for qr. If you want to use any npm package with leiningen, you can use the recently added bundle target Instead of creating the edn files, you should add the build config to project.clj (`:cljsbuild :builds :your-profile :compiler` I think).

Shako Farhad19:08:03

Oh wow! That is very interesting! We are using lein cljsbuild currently. It would be great to be able to integrate javascript libraries like that. :D Do you have to use things like binaryage/oops for the javascript interop so that advanced compilation works, or does webpack take care of all of the issues with foreign libs etc? :o


I haven't tried it myself, but the guide says this > Note the new :target :bundle option. This ensures that the generated code is compatible with popular JavaScript bundlers that can handle Node.js style require. It also sets a bunch of other sensible defaults like externs inference, so that advanced compilation will just work. so it definitely sounds like it!

Shako Farhad19:08:41

That is pretty awesome. I love how clojurescript just keeps getting more and more awesome. :D Thank you sir @U050B88UR!


still kind of cljs newb here. how should i be calling getElementById? via interop or get-element?


I typically use interop


honestly never knew about clojure.browser.dom until you asked lol


Yeah, might as well keep your usage of deps down


makes sense to me. there's a fine line between idiomatic and idiot pedantic.


There’s a goog.dom “namespace” as well