This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-22
Channels
- # announcements (7)
- # babashka (17)
- # beginners (45)
- # biff (2)
- # cider (16)
- # clj-on-windows (3)
- # cljs-dev (12)
- # clojure (27)
- # clojure-austin (1)
- # clojure-europe (18)
- # clojure-norway (5)
- # clojurescript (36)
- # conjure (35)
- # core-async (2)
- # datascript (4)
- # datomic (4)
- # emacs (15)
- # fulcro (23)
- # holy-lambda (12)
- # hyperfiddle (1)
- # introduce-yourself (5)
- # nbb (11)
- # off-topic (37)
- # pathom (34)
- # pedestal (9)
- # reitit (4)
- # releases (1)
- # remote-jobs (1)
- # sci (5)
- # scittle (3)
- # shadow-cljs (88)
- # tools-build (4)
I’d like to connect Conjure to a shadow-cljs node REPL
Did you get to the bottom of this? I hope this helps if not! https://github.com/Olical/conjure/wiki/Quick-start:-ClojureScript-(shadow-cljs)
I knew how to make it work with a browser. My question was related to node.js. It was not clear to me that I had to run node manually. Now that I think about it, it makes sense.
Here is what I tried
;; shadow-cljs.edn
{:source-paths
["src"]
:dependencies
[[cider/cider-nrepl "0.24.0"]]
:builds
{:app {:target :node-script
:main screenshot-demo.core/main
:output-to "out/app/script.js"}}}
shadow-cljs node-repl app
shadow-cljs - config: /Users/viebel/prj/screenshot-demo-cljs/shadow-cljs.edn
shadow-cljs - server version: 2.19.6 running at
shadow-cljs - nREPL server started on port 57235
cljs.user=>
And in another terminal
shadow-cljs watch app
shadow-cljs - config: /Users/viebel/prj/screenshot-demo-cljs/shadow-cljs.edn
[2022-07-22 09:42:04.331 - WARNING] TCP Port 9630 in use.
shadow-cljs - server version: 2.19.6 running at
shadow-cljs - nREPL server started on port 58699
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (81 files, 0 compiled, 0 warnings, 2.09s)
In nvim
:ConjureConnect 58699
:ConjureShadowSelect app
And it shows
; shadow-cljs (select): app
; (out) To quit, type: :cljs/quit
[:selected :app]
But when I am trying to eval js code in nvim (e.g (js/console.log "aaa")
), I am getting this error:
; eval (current-form): (js/console.log "aaa")
; (err) No available JS runtime.
; (err) See
Please Help
@huxley Why do I need shadow-cljs node-repl app
then?
You mean that it’s not required?
Is there a way to connect a command line CLJS REPL to the app ?
The potential problem I see is that the shadow-cljs node-repl app
is creating a different nrepl port number than what you are connecting to with shadow-cljs watch app
(e.g. port 57235 vs 58699). Now I don't know how to resolve that issue for what you are looking to do but just thought I would point it out in case you hadn't noticed.
@viebel We have a couple of AWS Lambdas at work that use shadow-cljs
on Node. Here are the steps I do with NeoVim/Conjure:
• in one terminal window (tmux panefor me): shadow-cljs server
• in another terminal window: shadow-cljs watch dev
(or app
in your case)
• in another terminal window: node target/dev/dev.js
(where the path is the path to your compiled app JS file)
• in Neovim: :ConjureShadowSelect dev
The next time I touch that project there is going to be a Makefile targets so we can use the same commands across all microservice projects, then with that it is just set that up in a tmuxinator
profile that does that dance across all the various Tmux windows and panes
Thank you @steven.proctor and @chase-lambert
@steven.proctor I was able to make it work as @huxley suggested, without shadow-cljs server.
Why do you need shadow-cljs server
for?
I don’t need it, but it get shadow running once, then every shadow command after goes faster