This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-18
Channels
- # aleph (12)
- # beginners (31)
- # boot (67)
- # cider (17)
- # cljs-dev (14)
- # clojure (111)
- # clojure-dev (1)
- # clojure-france (4)
- # clojure-gamedev (1)
- # clojure-italy (49)
- # clojure-nl (3)
- # clojure-poland (2)
- # clojure-russia (18)
- # clojure-spec (15)
- # clojure-uk (68)
- # clojurescript (33)
- # core-typed (1)
- # datomic (15)
- # emacs (3)
- # graphql (4)
- # hoplon (36)
- # leiningen (3)
- # lumo (44)
- # mount (2)
- # off-topic (46)
- # om (21)
- # onyx (47)
- # parinfer (22)
- # pedestal (21)
- # protorepl (4)
- # quil (4)
- # re-frame (15)
- # reagent (4)
- # ring-swagger (9)
- # rum (27)
- # spacemacs (11)
- # vim (7)
- # yada (8)
@xiongtx java
task will compile whatever java sourcefiles it finds in the fileset with the input roles - namely files in :source-paths
and :resource-paths
dm3: Does the java
task need to be invoked explicitly? Or is this sufficent? https://github.com/alandipert/boot-java-task-example/blob/master/build.boot#L1
@xiongtx check out the readme, i’m invoking explicitly from CLI
javac
that is
@freakinruben you need to commit!
the fileset after changing it and then return from a with-pre-wrap
handler so that the following tasks can work with a changed fileset. sift
is the task that does exactly that if you compose it properly, e.g.:
(comp (do-something) (sift ...) (do-with-moved-files))
@dm3 I saw that (target)
(which is called after sift
) commits, is it still required to commit!
in my own task too? Because the task thats called after moving (compile clj) needs the original inputfiles and not the moved fileset..
(deftask move ...)
(deftask a (comp (cljs) (move)))
(deftask b (comp (system) (repl)))
(deftask c (comp (a) (b)))
@freakinruben not sure if you’ve read this part of the wiki: https://github.com/boot-clj/boot/wiki/Filesets#the-task-model. The fileset is a snapshot of your files that every task receives from the task before it and returns to the next task in the chain. It’s effectively an immutable value.
if you want to “modify” a fileset, you need to commit, otherwise your changes will not be seen by the other tasks
Hello All - I’ve tried a quick Google, but to no avail… I have an nrepl running on 127.0.0.1:5601 - how would I use boot to launch a command line REPL to connect to that nrepl..?
boot repl -c -p $PORT
I think… In general boot has good help for every task with boot $TASK -h
the only thing i could see potentially being an issue with that is that if the script you're loading has (set-env! :dependencies '[[ .... ]])
, it might have some weird effect on the dependencies
what's the idiomatic way to ensure that a dependency added only for when $DEV=true
, so the lib is not added to the production CLJS bundle ?
I can't just leave it there and hope that cljs compiler's dead-code elimination would remove it and won't bundle for prod, since the check happens at runtime
@ag which check happens at run time?
so I'm struggling to find a way to have different cljs dependencies for dev and prod builds
for example if I have a dependency let's say [binaryage/devtools "0.9.4"]
, and I want this thing only be included to dev build (e.g. for when $DEV=true
. How do I do that?
I can probably use a task like this:
(deftask dev-env []
(merge-env! :dependencies '[[binaryage/devtools "0.9.4"]])
(environ :env ,,, ; etc
but then how do I make sure the Clojurescript code that requires devtools.core
doesn't throw exceptions when running on prod?I guess the only viable way to solve this is by using different edn files and different cljs ids, amright?
(def deps
(case (.toLowerCase (System/getenv "DEPLOY_ENV"))
"prod" prod-deps
"dev" dev-deps
dev-deps))
(set-env! :dependencies deps)
is one waythen to ensure your prod build doesn’t throw exceptions… test locally 😄
can someone point to an example with multiple "profiles"/edn files? I think I almost got it. Having trouble with the correct naming of things
one thing I can't figure out when using (cljs :ids #{"js/dev"})
with js/dev.cljs.edn
, how to ensure that it ends up compiling to main.js
and not dev.js
?
also I feel that compiler-options
not being picked up when put in .edn file. seems :verbose true
for example is being ignored (when it's in edn), but works when passed into the cljs
task directly
@ag An easy way to do it is to have env/dev/src/main.cljs.edn
and env/prod/src/main.cljs.edn
, and include the former in your dev
task and the latter in your build
task
but then cljs puts it in target/env/dev/main.js
. can I force it to put it in target/js/main.js
?
I'm hitting an exception: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol
Sorry, no example readily available - if you show me yours though, I might be able to help
it's not an open-source project. Let me play with things here, If I fail to make it work I will try to replicate in a sample project
sigh... multiple builds with boot-cljs seems not straightforward to get. so is :output-to and :output-dir of compiler-options are ignored and precise path+filename is fully determined by the edn file?
goddamit... can't make it work. so there's no way to force compiled cljs files to be in the right place, i.e. force it to respect :output-dir or/and :output-to ?
If you are serving resources from the classpath, your HTML should be able to include a <script src="main.js"></script>
and it will just work
So what I was telling you above is, you would not have any src/main.cljs.edn
, but instead would put different ones in env/dev/src/main.cljs.edn
and env/prod/src/main.cljs.edn
, for example, and make sure the right source-paths are included for each task
The env/dev/...
one could point to a namespace like myapp.core-dev
, which would call your myapp.core/init
, but also bring in things like binaryage/cljs-devtools, additional logging, etc
It was painful but I think I made it work... I had to put logic to pick up specific js file in my index page (based on the build)