Fork me on GitHub
#shadow-cljs
<
2020-10-27
>
amorokh13:10:24

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

thheller13:10:28

shadow-cljs classpath will do that

thomas15:10:47

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?

tjb17:10:09

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"

tjb17:10:19

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

thheller18:10:49

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

thheller18:10:04

that works well for me

thheller18:10:39

others prefer to run everything via lein

thheller18:10:44

up to personal preference I guess

thheller18:10:40

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

thheller18:10:12

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

tjb18:10:41

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!

thheller18:10:41

btw I never let my editor launch my REPLs

thheller18:10:48

I only connect to them remotely

thheller18:10:01

dunno how calva handles things by default

tjb19:10:48

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

tjb19:10:51

do you have other recs?

thheller19:10:07

I only use cursive

👍 1
thheller18:10:21

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

thomas19:10:29

The precise error I'm getting is this:

thomas19:10:33

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

thheller19:10:20

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.

thheller19:10:59

the code does look somewhat odd so hard to say

thheller19:10:18

jsrsasign: a = a,

thheller19:10:33

looks weird

thomas08:10:22

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

thomas08:10:05

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

thheller08:10:11

I don't think so

thomas16:10:16

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