Fork me on GitHub
#shadow-cljs
<
2021-02-27
>
West09:02:13

So I’m trying to get a CIDER repl working with shadow-cljs. The way I launch it is by indirectly, through another script in package.json, doing shadow-cljs watch main renderer. I can seem to do cider-connect-cljs just fine, but I can’t evaluate any functions or send anything to the repl. Maybe this is a better question for #emacs?

thheller09:02:22

what happens if you do? I can't really answer emacs/cider questions but maybe I can give a hint depending on what happens

West09:02:56

So shadow starts a server just fine. Then I can see live changes when I edit the source. I can’t seem to be able to send anything to the repl though. I found about this thing called piggieback so I added it as a dependency, but is that really the problem?

West09:02:38

WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information) I wonder if this has anything to do with the problem. I even checked out the URL where it says “(https://docs.cider.mx/cider/troubleshooting.html#cider-complains-of-the-cider-nrepl-version)” but it didn’t really help.

thheller09:02:00

well did you add cider-nrepl to your dependencies?

West09:02:02

Nevermind. Turns out I had the incorrect cider version.

West09:02:19

I had cider/nrepl not cider/cider-nrepl.

p-himik14:02:31

I'm using ANTLR4 4.9.1 that AFAICT generates ES6 classes with static members which seem to upset shadow-cljs:

220 | 
 221 | export default class ABCMusicLexer extends antlr4.Lexer {
 222 | 
 223 |     static grammarFileName = "ABCMusic.g4";
---------------------------------^----------------------------------------------
'(' expected
--------------------------------------------------------------------------------
To add more details - I just call ANTLR4's code to generate some JS files that I include in my CLJS files and then I call shadow-cljs to build it all. Is there any way to compile such classes?

thheller14:02:27

it doesn't upset shadow-cljs. that is the closure-compiler complaining.

thheller14:02:16

probably just doesn't support static class properties yet

p-himik14:02:22

I assume it means that I have to either use Babel or something like that or downgrade ANTLR4 to the point when it wasn't emitting such code, right?

p-himik14:02:39

FWIW [email protected] works fine since it emits ES5 code, so I'll settle on it.

thheller16:02:08

> FYI, static class fields are currently in stage 3 of the TC39 process, so they aren't officially part of the language yet.

p-himik17:02:07

Right, thanks!