This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-17
Channels
- # announcements (4)
- # aws (17)
- # beginners (108)
- # calva (2)
- # clojure (164)
- # clojure-austin (1)
- # clojure-europe (3)
- # clojure-italy (1)
- # clojure-nl (17)
- # clojure-uk (98)
- # clojurescript (31)
- # code-reviews (1)
- # cursive (23)
- # data-science (1)
- # dirac (6)
- # emacs (21)
- # figwheel-main (1)
- # fulcro (53)
- # graphql (2)
- # hoplon (1)
- # lein-figwheel (1)
- # leiningen (2)
- # lumo (21)
- # off-topic (118)
- # onyx (4)
- # pathom (59)
- # pedestal (2)
- # planck (3)
- # reagent (47)
- # reitit (2)
- # shadow-cljs (258)
- # spacemacs (3)
- # sql (10)
- # tools-deps (37)
Is there a way to def
a variable in CLJS as the static result of a variable created in clj? Something like:
#?(:clj
(def instance-types (read-aws-ec2-instance-types-from-file))
:cljs (def instance-types ~instance-types))
This works but seems so painful. Is there a better way?
#?(:clj
(defmacro def-instance-types
[sym]
(let [instance-types (read-aws-ec2-instance-types-from-file)]
`(def ~sym ~instance-types))))
(def-instance-types instance-types)
@kenny Another approach would be to make use of goog-define
, and arrange to have that value set based on the contents of the file at build time. This would limit you to using a primitive value but it also avoids statically baking the value into the JavaScript emitted by the compiler (and thus is compatible with the :aot-cache
feature)
anybody have tips how to enable closure logging conditionally in production? I tried (goog.debug.Console/autoInstall)
which doesn’t seem to suffice. Setting window.goog = {DEBUG: true}
seems to break closure.
@dnolen I want to set it at runtime, not at compile time. To only enable logging when ?debug=1
is in the url.
there’s this autoInstall functionality in closure: https://github.com/google/closure-library/blob/master/closure/goog/debug/console.js#L183
but something else needs to happen for it to become active, trying if goog.debug.LogManager.initialize
does the trick now…
Just setup a project using JUXT Edge but connecting to a repl produces: “Error building classpath. Manifest type not detected when finding deps for juxt.edge/app.logging in coordinate #:local{:root “../edge.app.logging”}”
the error is saying that it can't tell what kind of project this is (not seeing deps.edn or pom.xml - project.clj is not supported)
Thought specifying the name of the app when it was setup would have taken care of all that.
As a lein/project.clj user I find this way more confusing. Not good for inexperienced users.
Honestly getting a default setup to “just work” with 2 major Clojure frameworks today - Luminus and JUXT/Edge has proven futile.
This JUXT config directory structure is so convoluted, I give up. I mean, what chance do new Clojurians have of making sense of all this. With lein there’s one config file - project.clj. Here you have an app structure which has to ../ to 16 folders all of which contain separeate deps.edn config files. I was attracted to Clojure for its simplicity, not this.
i think this relies on a fixed bug relating to locals/root that alex has already fixed
friends don't let friends use nested libspecs