This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-14
Channels
- # aws (1)
- # bangalore-clj (1)
- # beginners (48)
- # boot (65)
- # braveandtrue (1)
- # cider (1)
- # clara (15)
- # cljs-dev (7)
- # clojure (179)
- # clojure-austin (1)
- # clojure-denmark (2)
- # clojure-greece (68)
- # clojure-italy (7)
- # clojure-russia (41)
- # clojure-serbia (9)
- # clojure-spec (44)
- # clojure-uk (27)
- # clojured (15)
- # clojureremote (20)
- # clojurescript (70)
- # community-development (2)
- # core-async (10)
- # cursive (14)
- # datomic (36)
- # defnpodcast (3)
- # emacs (13)
- # events (13)
- # hoplon (33)
- # immutant (18)
- # instaparse (2)
- # jobs (29)
- # jobs-discuss (71)
- # klipse (38)
- # lein-figwheel (4)
- # leiningen (1)
- # mount (34)
- # off-topic (36)
- # om (3)
- # onyx (51)
- # pedestal (5)
- # perun (8)
- # proton (2)
- # rdf (8)
- # re-frame (33)
- # reagent (24)
- # remote-jobs (1)
- # rum (6)
- # spacemacs (2)
- # specter (14)
- # sql (5)
- # testing (6)
- # untangled (1)
- # vim (10)
- # yada (3)
How come a downgrade is recommended in this case?
pair@fox /p/tmp> boot -d philoskim/debux:0.2.1 show -u
Retrieving maven-metadata.xml from (1k)
[philoskim/debux "0.2.0"]
also
> boot -d environ:1.1.0 show -u
Classpath conflict: org.clojure/clojure version 1.9.0-alpha14 already loaded, NOT loading version 1.5.1
Retrieving maven-metadata.xml from (1k)
[environ "1.0.2"]
ah, sorry, i see here is already a https://github.com/boot-clj/boot/issues/577
wow, i found significant boot-up time contributor:
boot.user=> (time (require 'buddy.auth.middleware :reload-all))
"Elapsed time: 856.008374 msecs"
what if you run it again?
boot.user=> (dotimes [_ 10] (time (require 'buddy.auth.middleware :reload-all)))
"Elapsed time: 1734.089318 msecs"
"Elapsed time: 1428.841853 msecs"
"Elapsed time: 1645.468317 msecs"
"Elapsed time: 1390.314959 msecs"
"Elapsed time: 1302.180635 msecs"
"Elapsed time: 1256.454168 msecs"
"Elapsed time: 1184.596769 msecs"
"Elapsed time: 1134.395214 msecs"
"Elapsed time: 1159.823145 msecs"
"Elapsed time: 1113.830371 msecs"
(dotimes [_ 10] (time (require 'buddy.auth.middleware :reload-all)))
"Elapsed time: 784.197751 msecs"
"Elapsed time: 748.213749 msecs"
"Elapsed time: 701.835304 msecs"
"Elapsed time: 709.553609 msecs"
"Elapsed time: 715.873056 msecs"
"Elapsed time: 729.215705 msecs"
"Elapsed time: 723.07217 msecs"
"Elapsed time: 743.959333 msecs"
"Elapsed time: 765.506379 msecs"
"Elapsed time: 738.188335 msecs"
Let's say I have two separate tasks, one for building a project and one for serving the compiled resources:
(deftask build
...)
(deftask serve
...)
Is there a way to combine both these tasks to run in parallell within a single task, like:
(deftask build-and-serve
...)
... so that one doesn't have to run them in separate shell instances?@looveh what is the result of "building a project"?
i suspect you are using the target
task to output some files at the end, right?
@onetom It is, in this case the serve
task is a task that wraps a cli command, without any regards to the fileset concept
i see... that goes a bit against the boot fileset concept, so im not sure how to handle that case easily.
@looveh The first thing I would try is something like (comp (serve) (watch) (build) (target))
That would start your server once, and then rerun your build process on file changes, while your original server keeps running.
Hi. I wonder if there is an approved or built-in way for creating an output file based upon an input file with some templating applied (replace variables in the input file with build-time values). Like the filtering in Maven.
i made a task like this recently,
(require '[boot.core :as core]
'[boot.util :as util]
'[ :as io])
(core/deftask string-template
"Does the thing"
[f template-file VALUE str "Name of the template file to use"
t target-file VALUE str "Name of the output file to produce"
p placeholder VALUE str "The placeholder to recognize and replace"
c content VALUE str "Content to replace placeholder with"]
(core/with-pre-wrap [fs]
(let [tmpd (core/tmp-dir!)]
(if-let [template-file (some->> (core/input-files fs)
(core/by-name [template-file])
first
core/tmp-file)]
(let [template-content (slurp template-file)
output-file (doto (io/file tmpd target-file) io/make-parents)
quoted-placeholder (java.util.regex.Pattern/quote placeholder)]
(spit output-file (.replaceAll template-content quoted-placeholder content))
(-> fs
(core/add-resource tmpd)
commit!))
(throw (ex-info "No template file found" {:opts *opts*}))))))
used like
(string-template :template-file (or template-file "template.html")
:target-file (str (name route) ".html")
:placeholder "{{CONTENT}}"
:content (route-content route))
@ska I haven't tried but -> https://github.com/adzerk-oss/boot-template
oh yeah, i need to disavow that thing
Ah OK lol
stringtemplate, way more complicated than necessary
the snippet also creates new tmp-dir each call, as it is inside with-pre-wrap
Hello how can I make this task
(deftask dev []
(comp
(environ :env {:http-port "3000"
:db-uri "datomic:"})
(watch)
(notify :visual true :title "CLJS")
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload :ids #{"js/app"})
(cljs-repl :ids #{"js/app"})
(cljs :source-map true
:ids #{"js/app"}
:compiler-options {:parallel-build true
:compiler-stats true})))
work the same as in terminal command, the terminal command works fine but when I do boot repl and run the (dev) fn it just returns an object[clojure.core$comp...I think it does have something to do with the comp fn but I don't know how to make it keep watching files and running
not sure how you’re calling it from the repl, but my guess is you’re just doing (dev)
you just need to wrap it in a call to the boot
function like this: (boot (dev))
ohhhhh
@geoffs I'm so sorry lol
tho that’s the second time that’s come up in a few days 🙂 maybe the README needs to mention it more prominently or in more places :thinking_face:
there's this part
You can start a REPL in the context of the boot script (compiled as the boot.user namespace), and build interactively too:
boot.user=> (boot (pom) (jar) (install))
that explains, I was not paying attentionthat remains a question, why it says repl when there's no repl task in the boot command?
have you guys ever encountered:
java.lang.Exception: Multiple jar entries match: .*/pom.xml
clojure.lang.ExceptionInfo: Multiple jar entries match: .*/pom.xml
when installing an uberjar?
hmm, installing or creating @richiardiandrea? I’ve seen something like it when building an uberjar recently. I forget if it was that exact error
If I dump it to target no problem, when I use install
this happens
@vinnyataide I think the implication there is that you start a repl from the command line with boot repl
and then run whatever boot commands you want
I see there is a --pom
param
my META-INF/
indeed contains more than one pom.xml
so I might need to specify that, or sift them away
I am just having doubts, should the uberjar contain the META-INF
info of your project only?
it looks like there is services
folder that is necessary for jackson for instance
indeed using --pom
succeeds
I know how to use (doc ...); I know how to configure existing boot tasks. I sorta get how boot works. However, I really need to read a "boot from the ground up" or "design and implementation of boot"
The boot cognicast was pretty interesting, albeit from a broad perspective
are there transcripts / slides somewhere? I like randoma ccess / ability to skim, whereas audiocast forces me to get info linearly, in the order / rate interviewer decides
cognicast does have transcription, but it doesn't appear caught up to that episode yet.
is anyone here using boot for auto completion? I have a problem where (1) I need ot parse some clj code, (2) I don't want to parse the code in elisp -- so my ideal solution is -- when a file gets recompiledby boot (due to watc), it also runs my persona "tag extractor" which then outputs a file emacs picks up for auto completion
sounds like a good idea and not too complicated too achieve, either shalling out or using some kind of tag generator for clojure (does it exist?)
@qqq separate boot task to analyze the compiled code? https://clojuredocs.org/clojure.repl/source-fn
@richiardiandrea @mobileink : so the ideal use case is: I put my mouse over a spec -- and another window displays the definition of that spec
I use ctags in emacs for that kind of go to but it is not always reliable
source
in the repl works better for me
i have a similar situation (i think) where i need to examine fn definitions and reject those that do not fit the profile, and i cannot use a macro.
@richiardiandrea : i use global. i have tried several times to figger out the pros and cons of various "tags" tools and always ended up with a headache.
@mobileink I copied a function from prelude
for emacs that uses imenu
but I don't know where it takes tags from 😞