This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-06
Channels
- # announcements (3)
- # babashka (1)
- # beginners (26)
- # calva (1)
- # cider (17)
- # clj-commons (16)
- # clj-kondo (11)
- # clojure (21)
- # clojure-europe (9)
- # clojure-norway (1)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (4)
- # clojurescript (35)
- # datomic (5)
- # emacs (9)
- # figwheel-main (15)
- # fulcro (26)
- # honeysql (1)
- # lsp (5)
- # off-topic (2)
- # polylith (1)
- # rdf (6)
- # re-frame (4)
- # reagent (15)
- # reitit (9)
- # releases (2)
- # shadow-cljs (4)
- # sql (25)
- # squint (2)
- # xtdb (7)
hello, I am new to Clojure and figwheel and having trouble using my own server with figwheel-main and cider. Cider-jack-in-cljs works OK. But if I cider-jack-in-clj&cljs I can't get the cljs repl to connect
I've followed the 'your own server' guide in the docs but I am missing a step on how to integrate that with cider, as it recommends starting with the CLI and -i <your clj script to start server>
I've also tried modifying my dev.cljs.edn to add :connect-url of my server, but the connection doesn't work...in the browser console I see that it keeps trying to connect and failing
Also the 'your own server' page of the docs is confusing to me as well. When I run that example with the CLI, I do get a figwheel session on port 9500, and my jetty server starts on port 4000, but they're not connected, i.e. (js/alert "hi") evals in the port 9500 address, and I can't browse to a route served by jetty via port 9500
aha, I think I'm not understanding how this all works at a basic level...https://stackoverflow.com/questions/56782751/how-to-setup-figwheel-main-to-reload-code-served-by-clojure-backend
I think you'll end up with three servers running on different ports: Jetty (web server) which you can view in a browser to see your application, a Clojure nREPL server that your editor will connect to (for eval'ing .clj
code) and a ClojureScript REPL server that your editor will connect to (for eval'ing .cljs
code)?
I use Calva (and CIDER) and when it jacks into a Figwheel-Main project, it starts all three of those up, and then when I eval code in the editor, it figures out which REPL to send it to for evaluation, so I can dev against the live backend and the live frontend.
(disclaimer: I'm very new to cljs stuff so this is just how it seems to me so far)
I believe that the CLJ and CLJS repl actually are both using the same nREPL server instance typically. They are just different client-connections to it, where the CLJS one has the cljs-repl wrapper stuff applied.
So you have: 1) Your webserver process (if it’s separate) 2) nREPL server used for all the clj/cljs repl connections (this can also be where you start the webserver in (1)) 3) figwheel’s own server for doing the hot reloading (with browser etc) things
@seancorfield thank you, that's helpful. Also watching your London stream about repl dev was very useful
this was the critical piece, https://clojurians-log.clojureverse.org/figwheel-main/2020-08-04