Fork me on GitHub

If I would like to make an npm library via clojurescript (built into a single index.js let's say), what would be the best way to do it? The guide on clojurescript using deps.edn and no lein doesn't make it clear how to integrate emacs cider via piggyback and the cljsbuild lein template fails for me, it says it can't find files. Figwheel template seems more front end oriented


I am familiar with npm/node and clojure, just new to clojurescript


What's the best way, without heavy lib dependence, to have clojurescript (nodejs) halt until an atom is set? Is there a Thread/sleep equivalent? I'd hate to run in a loop with no pause until I find it was set


I have an async call to load a protocol buffer schema using protobufjs ( and I don't want to leave a timing issue in there hoping a user loads it before I try to reference it


@m131 you can't block in JS in any way as there is only one thread. nothing else will be happening while you block so it would never unblock. need to go async for pretty much everything in node


I want to use something to do sprintf/format like functionality. I’ve seen reports that goog.string/format has DCE issues, but I’m not sure if that’s resolved and what’s the current best way to deal with this.


@cfleming: is there a clojure / IntelliJ Open API function I can call that does the same as "close all OTHER buffers' ?


are :closure-defines visible at macro expansion time?


@fbielejec yes, though you shouldn't act on them at compile (macro) time in a library unless you want to break global caching


in an app, less problematic


actually now I found [this](, which says:

The AOT cache logic cannot handle the case where shipping JARs employ macros that consult the ambient environment in order to affect the code generated for the source shipped in those JARs.
and then:
it is recommended that libraries and tooling employ goog.define instead, perhaps with the help of :closure-defines, as this makes JARs cache-friendly.


but from what you're saying I could get old results (cached) js as a result?


I think he wanted to say if app A use module X and you use in app B module X with different closure-defines for macro in module X, compiler will use cached A code with different closure-define for this macro, than you want in app B.

👍 4

that is why we can’t use macros for environment settings, only clojure-defines.


@dnolen gotcha, thank you


Minimal repro of what @lilactown posted yesterday


@madstap and that doesn't apply to regular fns yes?

madstap16:12:12> (defn bar [& args])
#'> (apply bar (range 100))


k, please open a JIRA ticket with this info if you have a chance, and the contents can just be what you posted above and note that this specific to multimethods in the title


something like "invalid arity exception when applying multimethod with rest args"?


mulitmethod apply with >20 args fails is fine

👍 4

and major priority is good for this one