This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-28
Channels
- # announcements (2)
- # babashka (36)
- # beginners (29)
- # bristol-clojurians (2)
- # calva (3)
- # cider (102)
- # circleci (7)
- # clj-kondo (5)
- # cljs-dev (7)
- # clojure (117)
- # clojure-europe (23)
- # clojure-korea (1)
- # clojure-nl (1)
- # clojure-spec (15)
- # clojure-uk (47)
- # clojurescript (43)
- # code-reviews (1)
- # community-development (1)
- # conjure (32)
- # cursive (1)
- # datalog (15)
- # datomic (14)
- # emacs (18)
- # fulcro (9)
- # helix (23)
- # jackdaw (1)
- # jobs-discuss (10)
- # meander (8)
- # membrane (57)
- # off-topic (4)
- # portal (2)
- # re-frame (22)
- # reagent (1)
- # reitit (9)
- # reveal (3)
- # rewrite-clj (14)
- # shadow-cljs (22)
- # spacemacs (27)
- # sql (34)
- # testing (6)
- # tools-deps (40)
- # vim (5)
- # vrac (15)
- # xtdb (2)
Thanks @zackteo, I would have thought so too, but that's kind of par for the course with Clojure documentation...
I'm trying it out with the exact examples from https://docs.cider.mx/cider/debugging/enlighten.html with no luck. Emacs tells me "Cider-Enlighten mode enabled", but evaluating the examples doesn't display the values in the buffer. Simply nothing happens.
If this is the case, hopefully CIDER docs can make it more clear which features do and don't work on CLJS?
Or perhaps I'm misreading the docs, it is implied https://docs.cider.mx/cider/debugging/debugger.html that "The debugger currently does not support ClojureScript", and perhaps that means that everything under the debugging section (including macroexpansion and tracing) doesn't support CLJS.
It would probably be nice for each feature page to have a little note like https://docs.cider.mx/cider/debugging/profiling.html to make it crystal clear to users what does and doesn't work in ClojureScript.
All that being said, I'd give an arm and a leg for all these features to support ClojureScript, that's where all my dev time is spent.
I’m afraid it’d be quite complex to support some of the Clojure features on ClojureScript, otherwise we would have done this by now. 🙂 Feel free to open a ticket about the documentation and I’ll update it when I can. If I recall correct enlighten is implemented in terms of the debugger which means it’s definitely Clojure-only for now.
Unfortunately, bozhidar personally doesn't really use cljs so development on that end is tougher?
Anyone here uses CIDER for cljs? I can't seem to get the CIDER jack-in-cljs to work? Any tips for doing so? 😮
cljs has more moving parts. can you describe your project? figwheel, figwheel main, shadow, deps.main?
Was trying the reagent template - https://github.com/reagent-project/reagent-template after adding +shadow-cljs and +cider , am I can lauch it separately from the command line but can't quite seem to understand how I would launch it with shadow with `cider-jack-in`
i did lein new reagent check
and then cider-jack-in
. once the repl is up, (ns-publics *ns*)
showed that start-server
was defined so i gave that a shot and that got the backend up. then cider-jack-in-cljs
, choose figwheel and reload the webpage and i was up. i'm not sure what +cider
is doing but i just omitted it and all is grand
that puts an ancient version of cider in there. just ignore that option and things will work just fine
Sorry how does (ns-publics *ns*)
work? I often have trouble figuring out which options to pick for when doing a cider-cljs-jack-in
cider-jack-in-cljs has many options because there are many optionsin the cljs tool space unfortunately. the first you need to choose is which build tool you are using. this template uses figwheel so choose that. and you should be done
i did that call in the clojure repl (not the cljs repl like you are doing). when the repl starts, the webserver isn't started yet. i was hoping (and was correct) that there would be a handy function to crank up the webserver
so even tho I picked the +shadow option I should still run it with figwheel? Think I am confusing 2 different things unfortunately
check.repl> (ns-publics *ns*)
{stop-server #'check.repl/stop-server,
start-server #'check.repl/start-server,
server #'check.repl/server,
get-handler #'check.repl/get-handler}
ah. then yes. start your backend up. then cider-jack-in-cljs
, choose shadow. then shadow needs to know which build you want. it should offer you a list of known builds
so you usually run cider-jack-in-clj
for the backend first then cider-jack-in-cljs
? 😮
rightt, then how would you determine which command should be used
lein vs shadow-cljs
you chose shadow-cljs. it emitted a shadow-cljs.edn file which controls how the executable shadow-cljs
spins up the cljs compiler. CIDER is merely asking you which build tools are involved so it knows how to start up the right programs. shadow is a stand alone thing.
and shadow is exclusively cljs. so for the backend you just start up lein (and notice you didn't get a choice when cider-jack-in
). for the frontend you're telling it to use shadow and then it has one last question about which build to use
not exactly. it uses the same jvm i think and that's not possible here where the backend is a lein project and the frontend is a shadow project
i think that uses the same jvm and gives you two repls, the second of which just starts up the cljs compiler. at the top of the repl are the startup commands which might help explain things
;; Startup: /Users/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost
;;
;; ClojureScript REPL type: figwheel
;; ClojureScript REPL init form: (do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))
the first command is how the repl started up lein ... repl
essentially. the second is how it started the cljs compiler for you. (start-figwheel!) (cljs-repl)
in essence
the tooling can be difficult. CIDER really tries to show you exactly what is going on with those startup commands. so that you can always read the documentation of the underlying tool to know what problems you might be hitting
right! I thought the shadow is the standard nowadays, which i why I try to avoid figwheel
perhaps am kinda wrong to think that
figwheel is outdated but still pays the bills for lots of projects. bruce rewrote it as figwheel-main for a modern flair. i'm quite partial to shadow for its fantastic interop with npm packages. it does a lot of really nice stuff. the build report is also quite nice. there are some UI tools for inspecting things as well
the two main contenders are shadow-cljs and figwheel-main. if you're up and running with shadow i'd just carry on with that and get back to cranking out cool ideas
quick question. How and do you transition from cljs.user
to shadow.user
and back (like in terms of your workflow
i don't know what shadow.user is. but i would just be in whatever namespace i needed to be in for my code
C-c C-k
will evaluate namespaces and C-c M-n n
will switch the repl to that namespace. you can also use (require 'my.ns)
and then (in-ns 'my-ns)
to change the repl namespace as well
https://clojure.org/guides/repl/introduction has good info i believe
Cider worked just fine on Emacs 26.3 for the last year and a half. I was also using CIDER on Emacs 27 (before and after its release as the new stable version). I am now running CIDER daily on Emacs 28. I would avoid using Emacs 25.1 (although I am fairly certain CIDER would work fine) as there are issues with the package repository authentication and its two releases behind now
In particular my issue is: Running cider-test-run-ns-tests
results in a cons: Symbol's function definition is void: first
error. I don't see anything in github issues about this.
as you can see in that thread, ag said first
is a function that doesn't exist in "older versiond of emacs"
When moving to Emacs 27 I've deleted quite a few Emacs packages and restarted Emacs to download fresh copies. This seems to fix issues with Emacs not finding things. Its a quick brute force fix and I just had to do that with Magit today. It doesnt explain the underlying issue, but so far its worked. Not had your issue with CIDER though, so no guarantee.
Ok, I upgraded to Emacs 27. That didn't fix it. cons: Symbol's function definition is void: first
still when running cider-test-run-ns-tests
I didnt think Emacs versions was the issue, appologies if I gave that impression. Did you delete all CIDER related packages from ~/.emacs.d/elpa/
?
Have you run Cider test runner before or is this the first time?
Have you used a test runner on the command line?
To narrow down an issue, its useful to know if the project runs or tests run on the command line.
If you are using leingingen and lein test
gives a similar error, then is seems its a bug in the project
I can confirm that cider-test-run-ns-test
runs in vanilla Emacs 26.3 (Debian GNU/Linux Stretch), using CIDER 0.25.0 (Bergamo). I use it regularly and just checked it a few seconds ago.
• I have used cider test runner before • I have used the cli runner • And yea, I purged and re downloaded my elpa packages
I am at a loss of other ideas. If its not specific to the Clojure project itself then I dont know what to suggest, sorry.
@U70QFSCG2 can you provide a stacktrace in Emacs. You could try to M-x toggle-debug-on-error
and then reproduce the problem. Maybe that tells us more where the problem is coming from.
{:a {:a 1}
:b {:b 2}}
and
{:c {:c 3}
:d {:d 4}}
=>
{:a {:a 1}
:b {:b 2}
:c {:c 3}
:d {:d 4}}
Yes, merge works
(merge {:a {:a 1}
:b {:b 2}}
{:c {:c 3}
:d {:d 4}})
#beginners is a better channel for help on general Clojure topics, a lot more people in that channel generally.
Easy to do. I use rainbow parens with CIDER to help show the structure of the code
This was from the repl, which doesn't have any highlighting at all. never looked into it, but do you know if it's possible to enable rainbow parens in there? 😄
If you use Spacemacs (a community config for Emacs), there is also the #spacemacs channel. Otherwise any CIDER related questions should get an answer here.
There are lots of other ways to get help too.. here is a quick guide to them https://practicalli.github.io/blog/posts/cloure-community-getting-help/
How is this achieved? Conj, concat and merge seems to just put them into a list together
cider-jack-in question: is there a way to configure the jack-in command line to not include the -Sdeps
part? (the deps that are auto-injected to make it work)
I appreciate I can use the universal argument to edit the command each time...
I have a Clojure CLI alias that runs REBL repl with nREPL and I can successfully connect with cider-connect-clj
but when using cider-jack-in-clj
and a .dir-locals.el
file to set the alias, something in the -Sdeps
section of the command line is conflicting.
I guess I should really figure out the conflict (but that may take a while).
i think you can set cider-inject-dependencies-at-jack-in
to nil and it might then work?
Adding that config to .dir-locals.el
seems to kill the aliases I add too, unless I have got the config wrong
((clojure-mode . ((cider-inject-dependencies-at-jack-in . nil)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl"))))
With that .dir-locals.el file cider-jack-in uses the command line:
[nREPL] Starting server via /usr/local/bin/clojure -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
and of course that goes bang because there is no nrepl 🙂
oh i'm not sure and its too early for me. but i suspect you'll have to walk through cider--update-jack-in-cmd
and see where the different parts get added. you may need to add a new keyword to the params
that are threaded through? or maybe the easiest way is to add a way to just give it an absolute command. there's no real reason it has to be dynamic if you are calling just a known string
If I can set an absolute command for cider-jack-in-clj using .dir-locals.el
that would work just fine.
:jack-in-cmd
is the params key. maybe update the logic to not override this if its already present?
(defun practicalli/REBL () (interactive) (cider-jack-in :jack-in-cmd "clj stuff"))
Hmm, I thought I could be clever and use something like that in the .dir-locals.el
file, but it didnt work.
((clojure-mode . ((eval . (progn
(cider-jack-in-cljs :jack-in-cmd "/usr/local/bin/clojure -R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl"))))))
I'll try it just in the init.el file.yes there's no logic to conditional set :jack-in-cmd
you would need to extend it i think
Ah this is getting complicated, sounds like something for the weekend. Thanks for all the pointers though... I can live with cider-connect for now 🙂
@jr0cket Now that I've seen in http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#practicalli the exact command line you wanted for clj
, this is the closer you can get in CIDER using .dir-locals.el
without changing the code:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))
Thank you, that is a much nicer approach.
I started looking at adding a clojure-rebl
project type, but didn't get it working (it seems I still have a great deal to understand about the CIDER code). Thanks again.
@jr0cket Now that I've seen in http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#practicalli the exact command line you wanted for clj
, this is the closer you can get in CIDER using .dir-locals.el
without changing the code:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))