This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-26
Channels
- # announcements (9)
- # babashka (98)
- # beginners (52)
- # boot (2)
- # calva (19)
- # cider (58)
- # clj-kondo (4)
- # cljdoc (11)
- # clojure (49)
- # clojure-dev (12)
- # clojure-nl (3)
- # clojure-uk (4)
- # clojurescript (42)
- # core-async (6)
- # cursive (9)
- # data-science (1)
- # fulcro (23)
- # jobs-discuss (2)
- # nrepl (30)
- # off-topic (42)
- # pedestal (6)
- # re-frame (8)
- # reitit (7)
- # remote-jobs (2)
- # shadow-cljs (134)
- # specter (1)
- # vim (13)
I’m not positive if this is a CIDER or shadow-cljs question but I’ll try here:
I was having trouble evaluating in a spacemacs code window until I came across a stackoverflow article describing how (for :target :node-script
) I need to run node
from the command line and evaluate the compiled code. (I also had to run npm install
). This makes me feel like I’m missing some key documentation but I didn’t see anything about that here: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node
Here’s the stackoverflow article that had the answer: https://stackoverflow.com/questions/58060822/how-to-connect-a-clojurescript-node-repl-to-my-node-library-shadow-cljs-project
Question: Is there more documentation that I need to read about how CIDER is launching npx shadow-cljs
that will mention things like “then go to the shell and manually run node
on the generated JS artifact”?
@dcreno https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting maybe this helps?
admittedly, I haven’t read that whole doc yet, but yes, it will help me understand the architecture. I’ll read that before asking more questions. I was hoping to find a “walk-through” type of thing that mentions all the required steps in a single place.
I think this is a key statement in 14.3: > Regular shadow-cljs builds do not manage any JS runtime of their own so you are responsible for running them.
can't write 50 different walkthroughs for all the possible things people may be doing 😛
Sorry, I’m new and don’t fully understand the flexibility.
In my head, there’s browser app and node.js app, but I know that’s oversimplified.
only in my head… 😉
if you want to skip the manual "run" you use shadow-cljs node-repl
or shadow-cljs browser-repl
that’s the part that confused me, I would have thought that CIDER would have run shadow-cljs node-repl
based on :target :node-script
.
maybe when I figure this out I’ll try to write a node.js quickstart that gives all the steps. Then I’ll realize how much I’m missing.
sorry, let me try again…
rightly or wrongly, I think of CIDER as starting and connecting to any background processes required to evaluate code in the emacs buffer.
the stuff really isn't all that complicated in my head ... but granted that I work on this stuff for years I'm not the best to judge
can we take cider out of the equation for a second since I don't know what it does when it comes to "starting" things
warning, this is losing me because I have only a noobie understanding of how these pieces work…
but I will study what you write here!
CIDER runs this: `[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.22.0-SNAPSHOT server... `
after I run cider-jack-in-cljs
and pick “shadow” and provide the build name.
alright. that may be the problem. does it even let you continue WITHOUT selecting a build? or is generic node-repl
or browser-repl
an option?
no, pretty sure you have to pick a build.
when cider is starting, I can pick shadow
or shadow-select
, I always pick shadow
.
then it prompts for Select shadow-cljs build (e.g. dev):
right, I choose app
because I have
:builds {:app
right. Then I have to go to the shell and run node -e "require('./target/main.js')"
as per your comment in the above mentioned stackoverflow article.
I was expecting to do something very “nominal” and see a brief description of the steps. I suppose I was wrong in the number of things I’ve integrated with and possible steps.
I’ll try too! Thanks for trying to get in the head of a beginner like me.