Fork me on GitHub

change it in package.json and then run npm install. restart shadow and it should pick it up


Do you know the consequences of having a global install that’s out of sync?


it always uses the one installed in the project over the global one so it should not be a problem.


I'm getting "Too many open files" error every now and then:

[:app] Compiling ...
[:app] Build failure:
FileNotFoundException: /home/matthys/projects/personal/learning/src/learning/web/topic_notes/core.cljs (Too many open files) ( (<init> (


I can create an issue for this, but not really sure what information I can provide. How would you go diagnosing this?


@mjmeintjes if you are on linux/osx you can use lsof -p <pid> to list the open files of the shadow-cljs process. jps should list the pid. not sure where the leak could be coming from so knowing which files are open would help a lot


might also be an external process with too many files open though. doesn't have to be the shadow-cljs process since its a user limit not a per process limit IIRC


Thanks, that helps. If it happens again I'll open an issue if it looks like shadow-cljs is at fault.


@thheller: I edited the github project wiki to add info about Calva for editing shadow projects:


(I know it said deprecated, but didn’t see how to edit the other user guide, and people will look at the wiki pages as long as they are there anyway.)


cool thx. I will add it to the user guide later. or you send make a PR if you want

Chris Bidler12:04:09

@pez: I want to say that I took Calva for a spin yesterday with a shadow-cljs project I have here and so far it looks really good


Oh, yay. Thanks for letting me know!

Chris Bidler12:04:54

like, “maybe I can finally stop scaring off the youths with my and then you simply download 'emacs'... speech when trying to infect them with The Clojure” good

Chris Bidler12:04:12

I will have to dig through the extensions list and see if there’s anything that can hold a candle to magit and org-mode before get too serious about Code as a daily driver, but Calva seems to do really well for a REPL 🙂


The org extension doesn’t seem to match emacs org-mode very well. But GitLens together with the built in Git support is very good, I think. Maybe not magit-level, keyboard-wise, but still good.


But the download emacs thing is a good way to weed out the weak. 😃

Chris Bidler13:04:12

well, that’s certainly true, but I do think that being able to demonstrate the REPL workflow in a “modern editor” might get some of those “weaklings” interested enough to start lifting some mental weights, so to speak

Chris Bidler13:04:02

My experience has been that the vast majority of devs, once they see the REPL flow work, they will happily chew on emacs or JVM stacktraces or whatever for awhile to get what I’m selling hehe


That’s what happened to me. I was blown away and installed Emacs immediately.


I think I should put together a playground project for people to try out shadow-cljs together with the interactive programming Calva enables.


If you play some with Calva for shadow-cljs, I am eager to learn if something does not work or if there is something that would make the experience better.

Chris Bidler13:04:55

I intend to use it for my interactions with the project I mentioned before (shipped, production SPA but that I don’t have many responsibilities over) and also when I spike moving our RN app from Boot to shadow-cljs sometime Real Soon™

Chris Bidler13:04:00

I will be sure to keep you posted

❤️ 4

Actually, it seems there are some problems evaluating (loading) files in the Clojurescript repl of shadow-cljs. This works more stably in Figwheel’s repl. I have some investigation to do.


@pez I only tried the plugin briefly but it seemd to have a few issues


couldn't get it to work properly. it seems weird to me that it forces me to select a CLJS repl before I actually do anything.


I think there are a few issues with your approach that might cause problems


How do you mean before you actually do anything?


ie. in my work project I usually have 2 builds running. say one for the server one for the browser. if Calva tries to unconditionally load the CLJS file I'm currently working on in the REPL that will cause problem


some server files can't be loaded in the browser repl


I open the project, open a CLJS file and it asks me which build


didn't tell it to connect or anything


It defaults to autoconnect. This is a setting. Maybe it should default to not do that. But I am not sure that is the whole story behind what you mean with “my approach”?


it seems to try to load the file I'm working on in the REPL?


don't know why it did that when I didn't tell it to do that


I come from an environment where there is cljs in the browser and clj on the server.


I also have clj on the server but I do have several CLJS builds in my project


It loads the file so that evaluating forms will be more likely to work.


yeah but that doesn't work


Tell me why.


assume this simple scenario. CLJS on the server, CLJS in the browser.


:server build is :node-script running in node. :app build is :browser


I have the file open. it imports various node packages


Yes, that is a scenario that breaks things right now.


but I'm connected to the :app REPL


same for two different :browser builds. I have one for the website and one for the admin interface


can't load admin stuff in the website


add a react-native app to the mix and so on


not all cljs files run in all cljs builds


I will have to go back to the drawing board for properly supporting shadow-cljs, I think. Can you tell me how you would like it to work?


well its part of a greater problem really. I have no idea how to address this.


In Clojure you only have one runtime. everything is nice and easy.


in CLJS it is not since there are many different platforms and it is very likely that you'll be talking to many at once


there is also the problem of many connected runtimes.


say you build a react-native app and have the app open in iOS and android. which do you use to eval the REPL code in?


or the browser open in chrome and firefox?


I ran into that problem today. shadow-cljs told me it couldn’t evaluate for me.


its a problem you do not have for Clojure since there is only Clojure.


I haven’t run into the problem with Figwheel, though.


figwheel cheats


it just sends the eval to everything that is connected and displays the first result that comes back


I see. 😃


But if we put that problem apart, which seems to be much bigger than Calva… Maybe if for shadow-cljs projects Calva asks for which build for every file that is opened? Possibly trying to remember per file between sessions.


that doesn't work because many files are shared and used in many builds


the only issue I have really is that it auto-evals


just let me manually eval what I want and everything is fine I think


if I can toggle it to off that is fine too


But Calva only lets you have one build connected per workspace. Will that work?


I gotta go. I will experiment with this some more tomorrow.


as long as I can switch it yes thats fine


You can’t at the moment. Well, maybe you can reconnect and that has that effect, sort of.


this may be a stupid question, can i set different :output-dir for :dev and :release? it seems the answer is yes from the docs... but maybe i am having a slow day and can't see it clearly. use case is i have watch running but i also have a quick test deploy script the compiles the same build but in release and deploys to


so TLDR: can i run a release build if the same build is being watched? if so.. how do i set a different output folder?


:release {:output-dir "foo/bar"}

👍 4

Refresh and good luck!


I didn't know about :module-hash-names. It is actually great feature for me.

😃 4

@thheller I just published an update of Calva that does not auto evaluate files. Might make it an opt-in later, but this is a saner default considering all different kinds of workflows and project setups. I’m still pondering on how to support build switching. For now reconnecting might work. Please let me know if you try it out some more, what works and not.


Loading of files does not seem to work through the shadow-cljs Clojurescript repl connection. So added a greeting note in the app log channel about a possible workaround which is to select all contents of the file and evaluate it.