Fork me on GitHub
#shadow-cljs
<
2019-06-14
>
lgessler01:06:53

@thheller incredible!! that did the trick, thank you for all your hard work πŸ™‚

lxsameer06:06:01

hey folks, how can I run a clojurescript function from CLI ? something like clj-run but for clojuresctip

sogaiu07:06:45

you don't mean something like lumo's -e flag by any chance?

lxsameer07:06:01

hmmm, no more like -m for lein

lxsameer07:06:05

but for clojurescript

lxsameer07:06:01

hmm i guess with lumo i can set the classpath and evaluate the function i want using the full path

lxsameer07:06:14

but does shadow supports something like this ?

thheller08:06:46

@lxsameer that what :node-script is for. building that is. running things is not supported.

lxsameer10:06:51

i see. I'm using node-script at the moment. I kinda needed this feature to integrate js tools in my env, for example PostCSS.

lxsameer10:06:31

shadow makes it easy to use npm modules it would've been awesome if this functionality exists

thheller11:06:38

it will never exist since it wouldn't be practical

thheller11:06:52

makes sense in lumo but not for anything that has to spin up an entire JVM first

thheller11:06:05

just adds like 5sec to startup time

thheller11:06:10

which is impractical for scripting

thheller11:06:27

if you just build it once and run many times later you don't pay for that startup anymore

thheller11:06:35

so builing actual scripts makes more sense

thheller11:06:09

actually I shouldn't say that this will never exist since you can pretty trivially do this via clj-run. the command may just get a bit long

thheller11:06:36

shadow-cljs run your.tool your.cljs.main output-to/foo.js or so

maxt11:06:42

Can I get a cljs nrepl when using shadow embedded? When I use shadow-cljs start on the commandline, it opens port 9000 and I can connect to it using Cursive. Is there a way to get the same behaviour when starting shadow from a repl with (shadow-server/start!)?

thheller11:06:46

the behavior is the same?

maxt11:06:22

I'd like it to be, but start! doesn't open port 9000

thheller11:06:48

assuming you have that configured in shadow-cljs.edn as normal?

maxt11:06:21

Yes, I'm using the same config as I do when I start it from comman dline

thheller11:06:54

but why do you want to start another nrepl server if you are already connected to one?

maxt11:06:28

Well maybe I missunderstand something, but I think the one I have is for clj and I'd like a cljs one too

thheller11:06:02

how did you get the first one?

thheller11:06:09

lein with project.clj?

thheller11:06:32

the nrepl should defintely be started using start! though

maxt11:06:33

Cursive, with the nREPL and deps selected.

thheller11:06:22

hmm I'm not sure how you'd configure middleware with that method

thheller11:06:31

in theory you just need the shadow-cljs middleware loaded

thheller11:06:59

but the shadow-cljs nrepl server should be working

maxt12:06:58

I'll restart it and post what it says at start

thheller12:06:18

just call stop! πŸ˜‰

thheller12:06:44

but JVM restart works too of course

maxt12:06:01

Just wanted to be 100% sure I have a clean slate

maxt12:06:22

Now it does start on port 9000 just fine. I'm so sorry to take your time with a crap question like that πŸ˜• Thank you for always being so supportive

πŸ‘ 1
pez13:06:33

@thheller about that Webpack problem I talked about the other day. (I'm building a :node-library since I had to eject trying to build it as an :npm-module after a lot of hard trying to make that work). I'm pondering my options. Since it works for release builds, I think I can try build the extension with Webpack only for those, and then use my current build config for development. (I am not sure I can make this work, but I think so.) However, is it just a fluke that it works for release builds, or is it something I can rely on?

thheller13:06:10

what is the problem with :npm-module?

thheller13:06:39

why do you need webpack?