Fork me on GitHub
#figwheel-main
<
2023-12-28
>
alpheus16:12:57

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.

cider 1
alpheus16:12:09

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.

alpheus16:12:03

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"))))

alpheus16:12:22

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

practicalli-johnny17:12:51

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-johnny17:12:53

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/

alpheus17:12:00

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

vemv06:12:48

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!