8 ms·
Migrating a Leiningen Project to Boot
- kossmoboleat 11y agoWas one faster than the other? Are there things that can only be done with one of them? Recently I tried to get a figwheel configuration with Cursive working and in the ended up letting figwheel run the server and perform the Clojurescript compilation in one JVM. There's a great Leiningen template to get this working with reagent here: https://github.com/reagent-project/reagent-template https://github.com/reagent-project/reagent-template
- estsauver 11y agoThe experience I had was that, while it was theoretically possible to make cljx+figwheel/weasel/piggieback+cljs all run happily together, in practice it didn't work for me. With boot, everything is both pretty easy to understand and conceptually very familiar. It's a middleware based build system, and that maps really well to a lot of the other things I've learned building clojure web apps.
- DAddYE 11y agoThank you for sharing this. I always felt that Leinin is too much. I'm not a clojure dev in my day to day so setting things right on it was cucumbersome (especially with cljs).
- wink 11y agoThat's interesting to hear, because back when I tried leiningen for the first time (2011 maybe?) I was shocked how easy and non-painful a build tool can be (compared to those of other languages, and maven in particular) and I've been a fan ever since. Then again I never tried anything with cljs, which seems to be the main point.
- asimjalis 11y agoIs there a way to use drip with boot to get around Clojure’s slow startup time?
- noisesmith 11y agoDrip doesn't typically help because the slow part is the Clojure compiler itself. Even if you preload your favorite clj version, it will be slow to load your project and libs.
- asimjalis 11y agoMy favorite thing about Boot is that it makes it so easy to write simple Clojure scripts.
- jjmojojjmojo 11y agoI agree 100%. I see this as the real advantage of boot over leiningen, beyond just generally being less "magical". Scripting has fundamentally changed the way I approach clojure projects.
- elwell 11y agoWhat's wrong with Leiningen?
- technomancy 11y agoThe Leiningen tooling around Clojurescript is not very good.
- Borkdude 11y agoActually I've found working with cljsbuild and figwheel pretty good. What do you think is lacking? The point of my post was not that Leiningen is bad and Boot is good. I simply wanted to learn more about Boot and the pros and cons.
- technomancy 11y agoOh, I didn't take the post that way; don't worry. But reading about the bits where you have to keep two separate lein instances running at once just made me cringe. It's not that hard to write lein plugins that work together composably, but it seems to me that in the Clojurescript realm, not much effort has been made in this direction. In addition, the need to clean (other than when changing branches) is almost always caused by buggy plugins; normal lein operation should never require it. The idea of having a watcher task strikes me as pretty tacky; it's so much smoother to simply have recompilation triggered by an after-save-hook in your editor. But I've never used ClojureScript, so there may be other reasons this isn't done.
- johnwalker 11y agoDid you come up with a solution for recompiling the clojurescript files only when cljs and cljc files were changed? The watch task fires whenever a file in the resources or src directories changes.
- Borkdude 11y agoNo I haven't. Is this a big issue? I guess it would be nice if watch could take a filter. Since cljs uses incremental compilation it shouldn't do anything if non-cljs files changed.
- jjmojojjmojo 11y agoYou can put a sift task before the watch.
- michaniskin 11y agoTasks in Boot cache their own products, so while the watcher task fires the rest of the pipeline whenever a source file of any kind changes, each task is smart enough to use its own cached compiled files. This is because only the tasks themselves can ever really know the relationship between source files and the compiled artifacts they produce. So in practice things are only recompiled when they need to be recompiled. Even though the watcher task is firing, no real work is done unless it needs to be done.
- modarts 11y agoWhy Boot over Leiningen?
- mej10 11y agoLeiningen is fine for libraries -- but when you need a more complex build (really, anything with more than one step), Boot gives you better tools for doing it. Boot has other cool things as well, like being able to write standalone Clojure scripts that can pull down their dependencies.