boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
neilyio 2020-09-24T14:29:57.002600Z

My first day in boot, I love it so far! I'm going through https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-02.md, which recommends boot-reload, boot-cljs-repl, and boot-http. Are these still the recommended options? They don't seem very active. Is anyone using anything like Figwheel-main with boot?

1
borkdude 2020-09-24T15:03:48.003900Z

@neil.hansen.31 If you are just starting out with CLJS #shadow-cljs might be a nice tool to get started with as well

borkdude 2020-09-24T15:04:30.004600Z

Also #figwheel-main is cool, I'm using that a lot. I've never used it with boot though, only with #tools-deps

borkdude 2020-09-24T15:04:46.004800Z

Shadow-cljs does work with boot, I've been told here before

neilyio 2020-09-24T15:08:22.008500Z

Thanks @borkdude, I've been using shadow-cljs for a few months, and it was a great way to get started. I'm trying to write some CLJS integrations for the tools that my team uses (Next.js for static sites, StorybookJS for a component library), and I'm having a hard time getting a ClojureScript configuration. I was wondering if boot (or tools-deps) might provide me with a little more control over the CLJS output.

borkdude 2020-09-24T15:09:33.010200Z

I personally prefer using cljs.main for maximum control. If you have issues they are going to ask you to repro with that anyway

borkdude 2020-09-24T15:11:37.012200Z

figwheel main is really close to cljs.main anyway. this is the config I'm using for a big app I'm working on right now:

:cljs/dev {:extra-deps
                      {com.bhauman/figwheel-main {:mvn/version "0.2.11"}
                       devcards {:mvn/version "0.2.6"
                                 :exclusions [sablono cljs-react-reload]}
                       org.clojars.borkdude/cljs-react-reload {:mvn/version "0.1.2-SNAPSHOT"}
                       sablono {:mvn/version "0.8.6"}
                       re-frisk {:mvn/version "0.5.4.1"}}
                      :extra-paths ["src-cljs-dev" "frontend"]
                      :main-opts ["-m" "figwheel.main" "-co" "docsearch.cljs.edn"
                                  "-d" "frontend/public/js/app.out"
                                  "-o frontend/public/js/app.js"
                                  "-c" "<http://dre.app|dre.app>"
                                  "-r"]}
           :cljs/prod {:extra-paths ["src-cljs-prod"]
                       :main-opts ["-m" "cljs.main" "-co" "docsearch.cljs.edn:docsearch-prod.cljs.edn"
                                   "-O" "advanced"
                                   "-o frontend/public/js/app.js"
                                   "-d" "frontend/public/js/app.out" "-c" "<http://dre.app|dre.app>"]}

neilyio 2020-09-24T15:11:47.012300Z

Thanks for the tip. Do you think what I'm looking for is possible? For example, Next.js requires a .js file (containing module.exports=my_render_func) in a specific pages folder for each html page that it generates. Think that's doable with boot/cljs.main?

neilyio 2020-09-24T15:11:51.012500Z

Thanks for posting the config.

borkdude 2020-09-24T15:12:38.013200Z

yeah, you'd have to use optimizations advanced (or simple) to get a single file and use ^:export on the function you'd like to expose

borkdude 2020-09-24T15:13:16.013800Z

then that function will be in foo.bar.yourfunction in the JS if foo.bar is the surrounding namespace

neilyio 2020-09-24T15:13:48.014200Z

Is that effectively a "default" export? I think that's what Next.js is looking for.

borkdude 2020-09-24T15:14:13.014700Z

oh gosh, I don't know about that, you'd have to ask in #clojurescript

neilyio 2020-09-24T15:14:52.015300Z

Will do. I'll read up on cljs.main now. Are you kicking it off with the clj tool?

borkdude 2020-09-24T15:14:57.015500Z

yes

neilyio 2020-09-24T15:15:03.015700Z

Thanks so much for your help.

borkdude 2020-09-24T15:16:27.016500Z

we are using cljs.main for the front-end now, it used to be all boot for front and back, our backend is still using boot, but probably we'll migrate everything over eventually to clj

borkdude 2020-09-24T15:17:21.017100Z

not that we didn't like boot (it's amazing), but there were certain issues on Java 11 that we never got fixed with the current cljs tools

neilyio 2020-09-24T15:18:39.018200Z

I've loved what I've seen of boot. It seems like clj is becoming standard, but it doesn't seem as intuitive.