This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-22
Channels
- # adventofcode (35)
- # beginners (137)
- # braveandtrue (1)
- # calva (33)
- # cider (40)
- # cljsrn (4)
- # clojure (10)
- # clojure-spec (26)
- # clojure-uk (29)
- # clojurescript (18)
- # core-async (6)
- # cursive (1)
- # emacs (2)
- # figwheel-main (17)
- # fulcro (28)
- # jobs-discuss (4)
- # leiningen (1)
- # lumo (19)
- # off-topic (2)
- # om-next (1)
- # reitit (2)
- # rum (8)
- # spacemacs (19)
- # tools-deps (9)
- # yada (3)
Is there a reason why :preloads only works with none and not simple? I want to move a require out of my code, so people can control what specs they loads using cljs.main
if somebody wants to manage what specs they load they should just use the normal require mechanisms
@dnolen sure, that’s fine. just asking. if this would be supported, then people wouldn’t have to make another project for it
@borkdude the way I have been told to do this is by using different entry namespaces - loading spec instrumentation as you see fit. You could also use a dynamic var initialized by a goog.define...i don't know iyou can get very creative 😃
@borkdude what about something like:
;; some clj impl namespace
(defn if-env [[if-str? then? else?]]
(if (-> env/*compiler* deref :options :closure-defines (get if-str?))
then?
else?))
@richiardiandrea beat me to it 😉
Lol not by much and your has an example so you win 😅
Then, in your cljs namespace, just do something like:
(ns my.core
#my/if ["ensure.load/pp"
(:require [cljs.pprint :as pp]
[cljs.reader :as reader])
(:require [cljs.reader :as reader])])
the problem is more like: I make a lib. this lib does something with specs. the user can provide those specs. which specs are provided, I don’t care.