shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
2020-10-27T13:44:24.166Z

hi all, is there a way to tell shadow-cljs to just download deps?

thheller 2020-10-27T13:45:28.166500Z

shadow-cljs classpath will do that

2020-10-27T13:45:46.166800Z

ok, thanks @thheller

thomas 2020-10-27T15:50:47.168100Z

Hi, I just started my first Shadow project... yeah... and straight after adding my first NPM module I am getting this error: Illegal variable reference before declaration: a any idea what I can do to get rid of this?

2020-10-27T17:17:09.168300Z

Hey everyone! Perhaps a dumb question but what is the preferred route to running a full stack (clj + cljs) clojure project? I currently have three directories: client, backend, common which refer to cljs, clj and ‘cljc’ respectively. My client uses shadow-cljs and after doing some reading I noticed that there are two ways to run shadow.  1. Via npm 2. Via lein I’m confused on what is preferred here. I assume with running the client project via npm I would still get access to the repl right?  I also noticed that in lein generated projects the top level directory has a project.clj file and both the client and backend run off of lein. Ive noticed the same thing with luminus too and I am confused what is the preferred route.  It seems like running shadow via npm and the backend clj project via lein would be right but what i mentioned above makes me hesitant that it is the "right way"

2020-10-27T17:17:19.168400Z

let me know if i should be asking this in #beginners !

thheller 2020-10-27T18:06:21.169Z

@thomas hard to say without more info. what npm package is causing this?

thomas 2020-10-28T08:42:22.173Z

that is weird indeed. not surprising the Closure compiler is complaining about that.

thomas 2020-10-28T08:43:05.173200Z

is there a way to make sure the Closure compiler ignores this code?

thheller 2020-10-28T08:50:11.173400Z

I don't think so

thomas 2020-10-28T09:16:45.173600Z

dang

thomas 2020-10-28T16:40:16.177900Z

I think I can workaround this for the moment by getting this from the CDN.

thheller 2020-10-27T18:06:49.169100Z

I run my backend via lein and all frontend related stuff via shadow-cljs/npm

thheller 2020-10-27T18:07:04.169300Z

that works well for me

thheller 2020-10-27T18:07:39.169500Z

others prefer to run everything via lein

thheller 2020-10-27T18:07:44.169700Z

up to personal preference I guess

thheller 2020-10-27T18:13:40.169900Z

I also have only one src/main that houses all .clj/s/c files but namespaced accordingly

thheller 2020-10-27T18:14:12.170100Z

so src/main/acme/project/frontend.cljs etc

2020-10-27T18:18:41.170300Z

word thanks a ton @thheller! my structure is

src/project_name/{client,backend,common}
ok cool im going to go your route since i like it as well. just need to make Calva play nice with it!

thheller 2020-10-27T18:22:41.170500Z

btw I never let my editor launch my REPLs

thheller 2020-10-27T18:22:48.170700Z

I only connect to them remotely

thheller 2020-10-27T18:23:01.170900Z

dunno how calva handles things by default

2020-10-27T19:00:48.171100Z

interesting! i am still fairly new to clojure so i only know of calva or cursive

2020-10-27T19:00:51.171300Z

do you have other recs?

thomas 2020-10-27T19:26:29.171500Z

The precise error I'm getting is this:

thomas 2020-10-27T19:26:33.171700Z

Closure compilation failed with 1 errors
--- node_modules/ibmcloud-appid-js/dist/appid.umd.min.js:44
Illegal variable reference before declaration: a

thheller 2020-10-27T19:50:07.171900Z

I only use cursive

👍 1
thheller 2020-10-27T19:55:20.172100Z

not a clue. this is an error from the closure compiler. either it is actually invalid code in the library or something the compiler didn't understand properly.

thheller 2020-10-27T19:55:59.172300Z

the code does look somewhat odd so hard to say

thheller 2020-10-27T19:57:18.172500Z

jsrsasign: a = a,

thheller 2020-10-27T19:57:33.172700Z

looks weird