shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
West 2021-02-27T09:12:13.121400Z

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?

thheller 2021-02-27T09:13:22.121700Z

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

West 2021-02-27T09:17:56.124300Z

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?

West 2021-02-27T09:45:38.125700Z

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.

thheller 2021-02-27T09:51:00.126200Z

well did you add cider-nrepl to your dependencies?

West 2021-02-27T09:51:02.126500Z

Nevermind. Turns out I had the incorrect cider version.

West 2021-02-27T09:51:19.126800Z

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

thheller 2021-02-27T09:51:26.127Z

ah

p-himik 2021-02-27T14:26:31.129100Z

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?

thheller 2021-02-27T14:29:27.129700Z

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

thheller 2021-02-27T14:30:16.130500Z

probably just doesn't support static class properties yet

p-himik 2021-02-27T14:31:22.130600Z

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-himik 2021-02-27T14:40:39.130800Z

FWIW ANTLR4@4.8.0 works fine since it emits ES5 code, so I'll settle on it.

thheller 2021-02-27T16:56:08.131300Z

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

p-himik 2021-02-27T17:14:07.131600Z

Right, thanks!