shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Chris McCormick 2021-02-17T02:04:03.239200Z

will test out both of these, thanks. @thheller what i am looking for is something that can replace an existing workflow from javascript. i often have a small piece of js in my makefile to just do one thing (like transform markdown into HTML on the server) and i would like to be able to use cljs instead. it would be good if i could just create and run a .cljs file in a node context, rather than having to add a clause to shadow-cljs.edn and run multiple steps. i guess i'm really looking for something like lumo - a cljs interpereter that is pre-compiled into js on node.

thheller 2021-02-17T09:25:18.240900Z

@chris358 sounds like babashka might be a good fit? or even just clj? CLJS is only great for this is you have it precompiled and don't need the JVM anymore. Or just lumo. shadow-cljs will always require the JVM to compile so thats not the best fit if you want to compile on-demand

👍 1
❤️ 2
2021-02-17T13:17:37.241500Z

I have a weird error that I don't know what it is

2021-02-17T13:19:04.241700Z

I'm pretty sure it worked before, but I can't find a Shadow version where it actually works

2021-02-17T13:20:17.242Z

problem only affects meander

thheller 2021-02-17T13:34:17.243300Z

@r.krzywaznia my guess is that the meander macro emits some "bad" JS code referencing jvm stuff. usually something like java.lang.Exception or so

thheller 2021-02-17T13:34:52.243800Z

oftentimes you never really run into these exception so the code appears to work. doesn't make it any more valid though.

2021-02-17T13:39:53.244100Z

I will pass the information to the meander creator

2021-02-17T13:41:54.244300Z

thx

thheller 2021-02-17T13:47:37.244600Z

yeah as expected the compiled code contains

} catch (e48925) {
                    if (e48925 instanceof java.lang.Exception) {
                      var e__47256__auto__ = e48925;

thheller 2021-02-17T13:47:58.244900Z

should it ever end up in that catch the code will break

bringe 2021-02-17T23:47:48.245200Z

Hello. Been looking around for clues to this issue I'm having and it looks similar to this issue, but not sure it's the same. I'm trying to require js files compiled from typescript. I can require them with js/require , but trying to require them from the ns form doesn't work. The shadow compilation works, but with a require like ["/config.js" :as config] and then eval config I get

; Execution error (ReferenceError) at (<cljs repl>:1).
module$config is not defined

bringe 2021-02-17T23:48:29.245900Z

This is with shadow version 12.11.18

thheller 2021-02-17T23:48:54.246500Z

don't do this. I thought we went over this in the ticket 🙂

thheller 2021-02-17T23:49:11.247Z

just use js/require instead