This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-22
Channels
- # bangalore-clj (6)
- # beginners (110)
- # boot (49)
- # cider (13)
- # cljs-dev (35)
- # cljsrn (5)
- # clojure (145)
- # clojure-conj (3)
- # clojure-dev (60)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-russia (3)
- # clojure-serbia (1)
- # clojure-spec (116)
- # clojure-uk (58)
- # clojurescript (235)
- # cursive (14)
- # datascript (7)
- # datomic (31)
- # dirac (144)
- # emacs (1)
- # events (1)
- # hoplon (12)
- # leiningen (11)
- # luminus (60)
- # lumo (19)
- # off-topic (18)
- # om (74)
- # onyx (5)
- # pedestal (13)
- # precept (3)
- # re-frame (3)
- # reagent (15)
- # remote-jobs (7)
- # ring-swagger (25)
- # rum (1)
- # untangled (53)
- # vim (3)
So I'm trying to get a luminus project to run in boot (https://github.com/DonyorM/luminus-boot) and I'm having some issues. It seems that when I run with boot, the VM just shuts down, but it works fine with lein. Does anyone know why that would be?
donyorm: luminus-boot: "To start a web server for the application, run: lein run" wtf?
This is a work in progress, I haven't updated everything, including the documentation
donyorm: np. but if you 're doing boot you might want to remove refs to lein asap just to avoid confusion.
That branch isn't remotely finished. It's mainly there for people who want to help me transfer the template to boot. When I finish it, I'll work through all those little details, but for now I'm getting the main programming down.
@donyorm it smells like the main thread finishes and there are not non-daemon threads to keep it on
For a quick check try to put a @(promise)
line after your call or directly into the -main
Lein is different from boot I guess
But don't take my word...it is just a guess
well that seemed to work. I got luminus running under boot with that last part. Thanks for your help @richiardiandrea. I'm going to try and make some templates to get this to work
No problem! That has always been an issue with web servers that don't block the main thread
Boot doesn't do AOT by default, right? You have to use the task specifically, correct?
You almost never need AOT. Just sayin’
We don’t do any AOT at World Singles. We build uberjars without AOT, then use clojure.main
as the entry point and pass the namespace whose -main
we want to run (e.g., java -jar uberjars/api-1.0.0.jar -m api.main
).
I know. I just wanted to make sure boot wasn't doing it by default, since I'm transferring from lein and want to remove every possible point of difference
Cool. Yeah, we switched from lein to boot about 18 months ago. Very happy with that switch.
We’ve managed to convert a lot more of our build/test/deploy pipeline into boot (from ant and shell scripts) too.
hi, I need some help with boot-cljs. I have a clojurescript macro which generates a css file and writes it to disk. My problem is that the boot-cljs task is not adding the css file to the fileset. Is there a way to tell to boot-cljs that I want to add the css file to the fileset?
if i have a jar that’s not distributed through maven/clojars (i.e. a jar i manually downloaded somewhere), what would be the appropriate way to include it in my project ?
right now i’ve done a mvn install:install-file
, but i was wondering whether i could put this jar in a lib/
directory and have boot automatically add it to the classpath
if I wanted to invoke a deftask from within a task with arguments, how might I do that? is there any example someone can point me to? I want to do something like:
(deftask foo [a arg VAL str "an arg"]
(c/with-pre-wrap [fs]
... do some task-ey stuff
(let [v (another-task/do-task :task-arg arg]
... do something with v
(-> fs commit!))
But this obviously wont workor is it more idiomatic to have 1 task write something to a temp file in the fs, then another task read that data?
@lwhorton v
there is a function that takes a function that returns a fileset as an argument, and returns a function that, when called with a fileset, returns a fileset
so you can call it with a fileset like ((v identity) fs)
and get a fileset back
also lol at the complexity of that first sentence
here’s another example. a task that just calls aot
task with no arguments on a fileset:
(defn aot-wrapper []
(fn [next]
(fn [fs]
(next (((aot) identity) fs)))))
(boot (aot-wrapper))
=~ (boot (aot))
aha, I see .. so refer to the “interceptor” chain instead of using the pre-wrap helpers
which will allow me to get lower level control and use things like (fn [next]) when I actually want to invoke it: thanks @alandipert
when should i use boot over leiningen? if my build process has a certain level of complexity?
I think that’s probably a good starting point to think about that choice.
Boot has a lot of things built-in that would be plugins in Leiningen (lein-ancient, for example, is built-in).
Mostly it’s about extensibility and configuration: Leiningen has project.clj
which is a declarative map of settings; Boot has “Clojure code”.
do you think it'd necessarily be bad to just always use boot? tbh when i use leiningen i tend to spend a lot of time setting it up, and i'm hoping boot has less of those problems
I wrote a bunch of blog posts about our transition from Leiningen to Boot just over 18 months ago: http://seancorfield.github.io/blog/2016/01/29/rebooting-clojure/ http://seancorfield.github.io/blog/2016/01/30/building-on-boot/ http://seancorfield.github.io/blog/2016/01/31/testing-with-boot/ and a few others.
I don’t use Leiningen for anything now, unless I’m playing with someone else’s FOSS project that just happens to rely on Leiningen.
oh, i guess i should mention that i'm trying to work with clojurescript, i initially was interested in boot because of a blog post about using boot with clojurescript
@seancorfield do you think boot has more of the common plugins compared to leiningen since you wrote that post?
I’ve used boot for ~6 mo now primarily for cljs. It’s had everything I’ve needed, and for what wasn’t there it’s relatively easy to add your own tasks.
The pieces I ended up adding were 1) a way to version js files for cache-busting, 2) generating an index.html file with those versions, 3) writing a manifest (git sha, git tag, branch, etc.) to a json file 4) compiling my stylus
As someone who writes a fair bit of web apps, most of these need to be custom for each customer anyways, so its not like you can avoid writing them if you do it in leiningen vs. boot
cool, i guess i'll just use boot! sounds like i would need it for bigger projects at some point anyways