figwheel-main

alpheus 2023-12-28T16:53:57.091089Z

If you're using https://github.com/bhauman/figwheel-main-template, #emacs, and #cider this .dir-locals.el adds a tiny bit of convenience. Since it may be off-topic I'll put it in a thread.

1
alpheus 2023-12-28T16:55:09.708129Z

In figwheel-main's https://github.com/bhauman/figwheel-main/blob/master/docs/docs/emacs.md?plain=1#L137 it says

If you are using Clojure CLI tools all the libraries you need to
compile and start your Figwheel build should be in the *top level*
`:deps` map, don't place your `com.bhauman/figwheel-main` and other
libraries in an alias.

alpheus 2023-12-28T16:57:03.060719Z

EDIT: buggy, don't use I found a .dir-locals.el that lets you keep the generated deps.edn with the aliases:

((clojurescript-mode . ((cider-clojure-cli-global-options . "-A:fig:build")
                        (cider-default-cljs-repl . figwheel-main)
                        (cider-clojure-cli-parameters . "dev"))))

alpheus 2023-12-28T16:59:22.145249Z

The docs for figwheel-main are a work of love, thanks Bruce!

practicalli-johnny 2023-12-28T17:41:51.988649Z

Some of those config options are deprecated and the -A Clojure CLI execution option is not required (it's actually removed by Cider code) This is what I have been using for Cider jack-in

((clojure-mode . ((cider-preferred-build-tool          . clojure-cli)
                 (cider-clojure-cli-aliases           . ":fig:dev")
                  (cider-default-cljs-repl             . figwheel-main)
                  (cider-figwheel-main-default-options . "dev")
                  (cider-repl-display-help-banner      . nil))))
https://practical.li/spacemacs/clojure-development/project-configuration/

practicalli-johnny 2023-12-28T17:45:53.718299Z

When figwheel-main template is used to create the project, relevant aliases are created in the deps.edn file e.g. https://practical.li/clojurescript/figwheel-workflow/project-configuration/

alpheus 2023-12-28T17:49:00.369899Z

Thank you! I haven't used ClojureScript in 6 years and figuring out the new (to me) tooling is a challenge

vemv 2023-12-29T06:29:48.979049Z

Kudos for sharing :) If you find any behavior or documentation issue, big or small in the cider<->fig integration, don't hesitate to report it cider side - very good timing these days!