This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-01
Channels
- # adventofcode (93)
- # announcements (44)
- # asami (23)
- # aws (1)
- # babashka (48)
- # beginners (112)
- # calva (26)
- # cider (57)
- # clj-kondo (17)
- # cljfx (5)
- # cljs-dev (21)
- # clojure (124)
- # clojure-europe (19)
- # clojure-hungary (40)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (3)
- # clojurescript (3)
- # cursive (81)
- # datalog (11)
- # events (21)
- # exercism (1)
- # fulcro (37)
- # graalvm (1)
- # introduce-yourself (8)
- # jobs (1)
- # lsp (1)
- # malli (5)
- # membrane-term (17)
- # minecraft (3)
- # nextjournal (5)
- # off-topic (14)
- # other-lisps (14)
- # polylith (58)
- # reagent (16)
- # reclojure (3)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (55)
- # spacemacs (15)
- # testing (2)
- # tools-build (7)
- # tools-deps (191)
@quoll ^ discuss here? if its a toy project can you share it on github? I'm sure someone can figure out whats not working correclty. If you added shadow to an existing project, then you likely need to change how your handling deps and building etc...
I'm guessing we need to add a build.
I’ll note that I can run shadow-cljs node-repl
on the command line, and from there I can load toy.m2
and execute the function in there
maybe the paths aren’t set up? When I’m at the repl in cider, I tried this:
shadow.user> (require '[toy.m2])
Execution error (FileNotFoundException) at shadow.user/eval27877 (REPL:45).
Could not locate toy/m2__init.class, toy/m2.clj or toy/m2.cljc on classpath.
meanwhile, at the command line:
cljs.user=> (require '[toy.m2])
nil
cljs.user=> (ns toy.m2)
nil
toy.m2=> f
#object[toy$m2$f]
toy.m2=> (f 2 3)
5
my cider-jack-in-cljs
seems to just hang. Which is a matter of some confusion for me.
going to restart emacs...
oh. i didn't install shadow globally
ok. @quoll i can eval expressions in emacs for your toy project if i
1. npm install
(which is what i was stalled on lol)
2. cider-jack-in-cljs (shadow > browser | node )
isn't there a "browser-repl" or a "node" option?
In the larger sense, what type of application/build are you planing on building?
I believe it makes the most sense for the target to be "browser" then even though you don't plan on actually rendering something a browser, thats the like... plateform.
eh… when running this stuff I’m almost exclusively in node, though I know others will use browsers
You can develop it using the node repl. As long as you don't call any node specific functionality it would be fine.
Or i suppose you can, but then you could use macros to tell which env your in and choose the correct code.
It’s really frustrating…. I am running shadow-cljs at the command line, and the repl there loads the namespace fine. I then try cider-connect to that same process, and it can’t find the namespace. It’s like the nREPL server is completely independent of the process that’s giving me the CLI repl
are you running cider-connect-cljs
?
I wasn’t aware that connect had that option. OK, I’m back to where I was a moment ago… it’s asking me for a build, and so far I have been unsuccessful at guessing what a “build” is
when i use cider-jack-in-cljs
it gives me a couple default "shadow builds" of node and repl. If you start from the command line i'm not sure they are there.
looking at shadow docs
running shadow-cljs browser-repl
Then cider-connect-cljs
-> browser-repl , would likely work except now i need to inject my nrepl deps.
which is why i always use cider-jack-in-cljs
because it injects them for me
huh… choosing a build of “node” didn’t give me an error of “build not found”. Instead I have a failed assertion
Here is a node repl
➜ toy git:(main) ✗ shadow-cljs node-repl
shadow-cljs - config: /home/drewverlee/Personal/toy/shadow-cljs.edn
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.16.6 running at
shadow-cljs - nREPL server started on port 35837
then i would do cider-connect-cljs
> shadow > node-repl
then if i check my repl buffer in emacs illl get
;; Connected to nREPL server -
;; CIDER 1.2.0snapshot (package: 20211123.1732), nREPL 0.8.3
;; Clojure 1.10.3, Java 11.0.11
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;;
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/node-repl))
;;
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
To quit, type: :cljs/quit
[:selected :node-repl]WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 3.2.2 (package: 20211117.1008) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.shadow.user>
cljs.user>
Yea, i think it's a bit confusing bc there is just a "node" option that's not nested under shadow. I'm guessing that works to ... somehow 😖... in a none shadow context.
great. So likely you get the same warning i do in my repl buffer telling you that "cider requires cider-nrepl"?
Yes. I’ve had this warning ever since I first started using Cider (with Clojure) a few years ago. I can’t make it go away. But it has never interfered with Cider on Clojure, so I eventually stopped trying to fix it
I use space emacs, i'm not sure what that command does.
There are a couple ways to have the cider-nrepl dep be added so everything works. docs here https://shadow-cljs.github.io/docs/UsersGuide.html#user-config and here: https://docs.cider.mx/cider/cljs/shadow-cljs.html If your going to use "cider-connect-*" (as opposed to "cider-jack-in-cljs") then this note here is relevent https://docs.cider.mx/cider/cljs/shadow-cljs.html#using-cider-connect-cljs > > If cider-nrepl isn’t in your classpath you should make sure it’s there. You can do this by adding it to :dependencies in the shadow-cljs.edn configuration file residing in the root of your project. Alternatively you can set cider-repl-auto-detect-type to nil, as the auto-detection of REPL types doesn’t work without cider-nrepl.
err. that note is correct, but that would mean you pakage up nrepl-cider with your package when you distribute it.
i would put it in the project root /.shadow-cljs/config.edn or ~/.shadow/config.edn which are merged in but not added in prod builds.
@quoll ^ some more notes. I'll likely need to crash in a minute .You should definitely get cider working properly! I can help tomorrow if you have issues. Your talks on graph databases and rules engines are a joy to watch. I keep wanting to flirt with Asami to!
Turns out that when I moved things into “toy” I left one terminal in the wrong directory (with identical contents). This has been causing me grief 😬 Sorry!!!!
It’s working! Whew! You may not see this until morning, but thank you for your patience!
if this is not current anymore I'd appreciate an update https://shadow-cljs.github.io/docs/UsersGuide.html#cider
Pull request sent 😄 https://github.com/shadow-cljs/shadow-cljs.github.io/pull/73/files
rockin!