This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-28
Channels
- # beginners (79)
- # boot (24)
- # cider (5)
- # clara (5)
- # cljs-experience (5)
- # clojure (126)
- # clojure-greece (5)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-russia (1)
- # clojure-spec (21)
- # clojure-uk (31)
- # clojurescript (151)
- # community-development (20)
- # cursive (25)
- # datomic (24)
- # flambo (1)
- # fulcro (312)
- # graphql (10)
- # hoplon (20)
- # juxt (2)
- # keechma (6)
- # leiningen (7)
- # luminus (4)
- # om (4)
- # onyx (7)
- # parinfer (24)
- # protorepl (1)
- # re-frame (7)
- # reagent (13)
- # shadow-cljs (19)
- # spacemacs (14)
- # specter (14)
- # uncomplicate (22)
- # unrepl (1)
Hi! I’m having trouble importing a class in .java file. I have source-paths set to #{“src/java”}, and when I run boot javac it shows that it compiles 1 java source file. But when I try to import it doesnt seem to be on the classpath
hswick this might interest you, experimental "live java reload" task https://github.com/RadicalZephyr/boot-javac-star
hey all! I’m working on a cljs chrome extension and it prevent inline script eval. Thus i need to create a files that replicate the currently inline document.write’s output by the file produced by cljs.edn files in boot-cljs
current problem is that there’s a nonce appended to the require for the main ns goog.require(“boot.cljs.main33328”)
or similar. is there a way to either prevent this nonce? or to get the name of the ns in a task the post-wraps cljs?
@pleasetrythisathome Latter is possible by searching for the file in fileset, (by-re [#"^boot\/cljs\/main.*"])
or something, and looking at the found file names.
hmm trying
the following is giving me a weird downstream error
`
the following is giving me a weird downstream error about not being able to convert map
No implementation of method: :as-file of protocol: #' found for class: clojure.lang.MapEntry
(with-post-wrap fileset
(let [cljs-file (some->> fileset
(by-re [#"^boot\/cljs\/main.*"])
first
.getPath)]
(util/info (str "*********" cljs-file))
fileset))
you need to call output-files
before by-re
, the filtering fn works on list of tmp-files, which is different than fileset object
and tmp-path
instead of .getPath
, because these are tmp-files, not File
Should boot-cljs produce an output that will call the init-fns function?
yea it create a new namespace with the init fns that is then required
Hmm, I think my main.cljs.edn file isn't being used then. I'm trying a different name now.
Yeah, that works now. Hmm
@pleasetrythisathome Is main.cljs.edn not used when not specifying :ids?
not sure
Alright, thanks :thumbsup:
It appears to now. I'm not sure what I did wrong to being with.
awesome got it to work
so i’m not seeing the files output in target…see anythign wrong? i’m using the target task
(defn goog-require
[ns]
(format "goog.require(\"%s\");" ns))
(deftask chrome-extension
[d devtools? bool "require devtools and dirac?"]
(with-post-wrap fileset
(let [tmp (tmp-dir!)
cljs-files (some->> fileset
(output-files)
(by-re [#"boot\/cljs\/main\d*.js$"])
(map tmp-path))]
(doseq [file cljs-files]
(let [[_ build nonce] (re-find #"js\/(.*)\.out\/boot\/cljs\/main(\d*).js" file)
out-path (format "js/require-%s.js" build)
out-file (io/file tmp out-path)
out (doto out-file
io/make-parents)
requires [(when devtools?
"devtools.preload")
(when devtools?
"dirac.runtime.preload")
(format "boot.cljs.main%s.js" nonce)]]
(util/info (format "writing %s.cljs requires to %s\n" build out-path))
(->> requires
(remove nil?)
(map goog-require)
(interpose "\n")
(apply str)
(spit out))))
(-> fileset
(add-resource tmp)
commit!))))