Fork me on GitHub
#shadow-cljs
<
2019-02-16
>
41ph4_Ph4un19:02:54

hmm.. Okay totally n00b question. Since shadow-cljs allows the use of nodejs or browser REPL, are there any actual configurations that would really benefit from using Lein or is that option more for people who simply prefer it?

41ph4_Ph4un19:02:25

I haven't got an opinion either way and just getting to use both so.. just curious 🙂

thheller19:02:55

most people use lein when they have some other CLJ code (eg. server-side) they need to work with as well

thheller19:02:35

nothing build related is affected by whether you use lein, tools.deps or shadow-cljs standalone

41ph4_Ph4un19:02:44

ah I see. So as a configuration for a full stack project.

41ph4_Ph4un19:02:30

Yeah I'm actually gonna playaround using NodeJS instead of just JVM BEs but I'm going to be using lein on other projects in the future so I set it up just to familiriaze myself

thheller19:02:40

but it also fine to use shadow-cljs.edn for CLJS and lein for CLJ completely separate. that is what I do.

41ph4_Ph4un19:02:32

hmmm.. hmmm.. I see! Well this clarifies nicely 🙂

41ph4_Ph4un20:02:39

hmm.. some clarifications about building a node scripts 🙂

41ph4_Ph4un20:02:58

So let's assume I have arbitary project foo where I'm defining a core.cljs having a main function

41ph4_Ph4un20:02:57

Does this seem to be in order? Am I correct to assume that next thing leiningen needs is a notion of where the sourcecode files are?

thheller20:02:33

why are you using lein if you are not familiar with lein?

thheller20:02:03

but yes you need :source-paths ["src"] or so in project.clj and the file located in src/foo/core.cljs (or whatever your source path is)

41ph4_Ph4un20:02:30

like previously said, it's likely I need to use it in the future and just thought I might as well begin now

thheller20:02:13

it will be trivial to switch later. no need to do it now 😉

41ph4_Ph4un20:02:13

I know it's additional and without familiarity just adds complexity currently 🙂 that's why ask does it actually have additional benefits

thheller20:02:38

no benefits in using project.clj over shadow-cljs.edn. just more complicated 😉

41ph4_Ph4un20:02:56

yes, I've noticed 😄

41ph4_Ph4un20:02:29

but since I started configuring might as well check it trough. Write a memo about it and then move in to what I actually use 😄

41ph4_Ph4un20:02:13

I hate to just leave stones unturned if I've started. So yeah. I'll just verify it's in order

41ph4_Ph4un20:02:30

okay verified, time to strip the clunkyness off

thheller20:02:11

basically the only difference is that :source-paths and :dependencies are either in shadow-cljs.edn or project.clj

thheller20:02:30

as far as the runtime and builds are concerned nothing else is different

41ph4_Ph4un20:02:59

yup. I'll add Leiningen when I'm actually using some non JS based BE or have more bigger production environment at hand

41ph4_Ph4un20:02:39

I haven't really even Clojure before. Only Common Lisp before 😄

41ph4_Ph4un20:02:12

As usual, when you start you really have too many options and not really an idea how to filter the useful parts of the information

thheller20:02:32

yeah thats why shadow-cljs doesn't use any of the other tools by default

thheller20:02:47

complicated enough if you keep everything to one tool 🙂

41ph4_Ph4un20:02:13

Yeah I can dig that. Sometimes I throw up into my mouth a bit when I look at what some of my webpack+others configurations have become like

thheller20:02:27

yeah it can get quite out of hand nowadays. too many tools, too many languages, too many different idioms.