This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-22
Channels
- # babashka (106)
- # beginners (29)
- # biff (29)
- # calva (9)
- # cider (6)
- # clj-kondo (24)
- # clojure (40)
- # clojure-europe (94)
- # clojure-japan (1)
- # clojure-nl (1)
- # clojure-norway (45)
- # clojure-uk (13)
- # clojuredesign-podcast (5)
- # clojurescript (12)
- # clr (4)
- # community-development (2)
- # conjure (13)
- # cryogen (4)
- # cursive (4)
- # deps-new (1)
- # fulcro (18)
- # hugsql (2)
- # hyperfiddle (67)
- # jobs (1)
- # malli (47)
- # meander (2)
- # missionary (34)
- # off-topic (1)
- # podcasts-discuss (1)
- # polylith (24)
- # reagent (19)
- # reitit (9)
- # sci (7)
- # shadow-cljs (3)
- # testing (28)
- # tools-deps (1)
- # xtdb (9)
Are there any articles / resources / example setups / tips that anyone can recommend for using Conjure in a Clojure+ClojureScript (w/ shadow-cljs) combined repo?
I can get it to work by manually creating a new session with ,sf
, switching into it with ,ss
and running :ConjureShadowSelect
from within that session. This works but it feels pretty clunky.
When using the workflow described https://github.com/Olical/conjure/wiki/Multiple-connections-with-ConjureClientState I find that in whatever 'state' my client is in, after I run :ConjureShadowSelect
all evaluations are in ClojureScript regardless of which state is active. I'm actually not sure how to undo this step so I have start over here if I want to evaluate normal Clojure.
Any advice would be greatly appreciated š
I'm not sure about the workflow that you described, but my workflow looks like this:
1. Start shadow-cljs in a separate terminal (`npx shadow-cljs watch app`)
2. Connect to the clojure repl it started
3. ,sf
to create a new session
4. :ConjureShadowSelect
(I have a keybinding that searches for shadow sessions ,sS
found https://github.com/Akeboshiwind/dotfiles/blob/master/nvim/.config/nvim/lua/plugins/lang/conjure.lua#L41)
At this point you have two sessions: a clojure one and a clojurescript one.
They can be listed with ,sl
and I switch between them using ,sn
and ,sp
Once you switch to a session evaluations will go to that session.
I'm not sure this is the most optimal setup (particularly using the same clojure process for both shadow-clj & my own app) but it works for me š¤·
I do this! š I use :ConjureClientState default
for the CLJ REPL and :ConjureClientState cljs
for the CLJS REPL. (and bind those to keys, of course)
it gives a very nice ability to switch between them at any time.
I use the .nrepl-port
for CLJ so in default
state it just works the first time I try to eval something. in contrast, I have shadow-cljs hard-coding the nrepl port (eg. {:nrepl {:port 50655}}
in shadow-cljs.edn
)
so to connect to CLJS:
ā¢ ,tj
does :ConjureClientState cljs<CR>
ā¢ :ConjureConnect 50655
ā¢ :ConjureShadowSelect dev
or whatever your build is called
then you can switch freely with the :ConjureClientState
key bindings.
as a nice bonus, the Conjure output always begins
; --------------------------------------
State: default
...
so you get a little nudge for which state you're in on each eval.I have autocommands defined for vim startup and on the basis of the directory I am in (i.e. _/clj/_
or _/cljs/_
, they switch the sessions.
Interesting idea
It's a bit hacky but works: https://github.com/Samy-33/configs/blob/master/nvim/fnl/config/oliv.fnl
hello ā this probably has been asked before but I was just thinking... is there a way to direct tap>
results into a vim buffer?
I assume any Clojure function that can write to a vim buffer and takes a single argument can be added as a tap>, using add-tap I assume the trick is then to do something useful with the values sent to the vim buffer. I assume this would be to help navigating more interesting evaluation results, like Portal or Cider inspector (but within vim/Neovim)