Fork me on GitHub

What's the recommended way of manually printing a testsummary after calling test-vars ? I now have:

(defn print-summary []
  (t/report (assoc (:report-counters (t/get-current-env)) :type :summary)))


Is it possible to build an Android (without UI, just a background process that reads some files and sends data to the cloud) in Clojurescript + React Native? If so, which approach do you recommend?


@asier.galdos that's probably possible - using V8 directly is also an option

🙏 1

I asked in #beginners but it looks like it may be a little specific to cljs.. I'm getting an error trying to pass a namespace to public-ns at runtime:

(defn test1 [v] (ns-publics v))
Encountered error when macroexpanding cljs.core/ns-publics.
AssertionError: Assert failed: Argument to ns-publics must be a quoted symbol
It works in a clj repl but not cljs.. any clues?


And I know the fn does nothing, I just trimmed the actual fn to the part thats giving me fits 🙂


ns-publics is a macro, so it can't be used at run time. And it also makes sure that you don't pass any run time data in there by requiring you to provide a quoted symbol, like 'a. You can use ns-publics only during compilation.


So is there a runtime way to get a list of functions from a namespace?


Let's make a step back - what is the problem you're trying to solve?


Ok, I'm storing some hiccup with some keywords that map to custom react components, replaced at runtime by clojure.walk and rendered. The replacement map is e.g. [:question-long dq/question-long]


I want to dynamically generate that replacement map from function metadata. I've annotated the functions and have the function worked out to generate the map correctly with the namespace hardcoded into the function


was trying to make the hardcoded part more dynamic


other challenge is to resolve the symbol at some spot, because the hard coded map does that just fine


trying to prevent forgetting to keep the replacement map up to date as that namespace grows with additional components


You can definitely do that in compile time - create that map with a macro. But note that you'll have to put all the imports manually. Namespace aliasing will help here.


@rdonahue I'll just note at a high level that you should in general avoid var metaprogramming in ClojureScript for production code


if you are going to do it, then I would probably run a few experiments to verify that tree shaking is not impacted by such patterns


And here I was thinking once I ditched angular my tree shaking problems would be over 😉 I spent the day fighting react's need for every seq to have a meta :key and thought I should make these annotations work for me for a change! But advice heeded!