Fork me on GitHub
#shadow-cljs
<
2018-04-06
>
denik00:04:45

@thheller while using shadow-cljs in embedded mode, I want to redef the request-handler without restarting the server and build processes. Is there any way to do that?

denik01:04:38

I think the problem is that the server closes over the value of the handler instead of keeping the var around.

denik01:04:48

Since I’d be making new endpoints all the time it would be unfortunate and is unnecessary to have to recompile every time.

thheller08:04:14

which request-handler? the one for the build? you could either set :http-handler that just delegates to the var you want to switch.

thheller08:04:34

or use your own webserver to begin with. shadow-cljs really doesn't need anything special from the dev-http servers

thheller08:04:35

@U050CJFRU sorry misunderstood what you were asking. fixed in 2.2.25. the var is now deref'd when the request happens not when starting the server. so any updates should be reflected immediately.

denik15:04:08

@thheller you’re killing it! This is so much fun!

levitanong04:04:31

@thheller hi, if I might make a suggestion regarding the shadow-cljs hud: Perhaps you can set z-index to a high value like 10000 to ensure that it stays on top of other absolutely positioned elements?

thheller08:04:35

thought that was already done but didn't do it for all elements. will add it to all.

thheller09:04:27

fixed. will be in next release.

parrot 8
mjmeintjes09:04:25

When starting a repl with shadow-cljs node-repl, is it possible to connect via another nrepl client? What would to port be? I want to start a node repl without having to set up build config, and then connect to it via cider.

mjmeintjes09:04:14

No worries, seems to work when I connect to existing shadow-cljs server via cider and then call (shadow.cljs.devtools.api/node-repl).

thheller09:04:51

@mjmeintjes it also works properly now if you just run (shadow.cljs.devtools.api/node-repl) without running shadow-cljs node-repl first.

mjmeintjes09:04:01

@thheller Thanks, that works great.

mjmeintjes10:04:43

One thing I'm struggling with - when I have a :node-script target, I can start the compiled js file using node, and then connect to the nrepl using cider. However, I can't figure out how to make println statements output to the repl. When I call println, it prints in to console where I started the node js script. I would like it to print within the repl. Does that make sense? Is it possible?

troglotit12:04:10

Hey! Is there way to import/require non-js dependencies just like webpack?