Fork me on GitHub
#shadow-cljs
<
2019-09-14
>
Saikyun09:09:29

@thheller nah, I'm not running shadow-cljs watch, since that triggers webpack which takes a lot of cpu (and eventually restart the app)

thheller09:09:50

uhm you cant have a REPL without a running watch?

Saikyun09:09:53

I run shadow-cljs compile once, then I run shadow-cljs cljs-repl in order to connect with a repl πŸ™‚

Saikyun09:09:00

well, apparently I can :S

thheller09:09:21

not possible πŸ˜›

Saikyun09:09:33

well, I do it either way, I don't know what to say

Saikyun09:09:04

with only yarn start and shadow-cljs cljs-repl I manage to connect to a repl, and then run code on the mobile

thheller09:09:45

well sorry should have been more clear. cljs-repl starts the watch if it is not running

Saikyun09:09:52

oh, I see. πŸ™‚

Saikyun09:09:00

but it doesn't automatically recompile either way

thheller09:09:16

yeah thats true

thheller09:09:27

but still. if you run shadow-cljs server separately

thheller09:09:42

you can restart cljs-repl quickly without it taking a long time

Saikyun09:09:01

oh, that's a great step! thanks a lot

Saikyun09:09:08

I didn't realise you could only run the server.

Saikyun09:09:31

I've generally just used watch, but since I don't want the automatic recompiles atm I sadly have to turn it off

Saikyun09:09:47

thanks for the help either way, this will speed things up a lot!

Saikyun09:09:13

sadly I can't afford a new computer, and when the repl is actually set up it's very quick either way πŸ™‚ so it was just restarting that was bothersome

thheller09:09:18

there might still be weird things happening in that setup. it isn't really intended to be used that way πŸ™‚

thheller09:09:49

but yeah when in doubt use the web UI at http://localhost:9630

thheller09:09:00

that lets you restart the build without restarting the server and so on

Saikyun09:09:34

ah thanks. I haven't used the web ui

Saikyun09:09:09

generally the setup works okay at least πŸ™‚ as you've said I need to compile and restart when I add new requires, but other than that it works well πŸ™‚

Saikyun09:09:43

I hope to be able to shut down webpacks autocompile sometime, but I've already spent 2-3 hours in vain

Saikyun09:09:57

haven't really gotten any replies when inquiring at their forum/slack

thheller09:09:06

see the section about the REPL lower down

Saikyun09:09:40

that's amazing

Saikyun09:09:49

wow, shadow-cljs is so full of good stuff, haha

Saikyun09:09:55

thanks for taking the time to help me

Saikyun10:09:12

I hope to make some sort of example repo when I have a "stable" setup, so this stuff will help as well

Saikyun10:09:03

okay, so this is really awesome. using (shadow.cljs.devtools.api/watch :app {:autobuild false}) in a shadow-cljs clj-repl, I don't have to restart any repl processes. my repl connection starts saying No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code., but as soon as the app has finished restarting it works again πŸ™‚

Saikyun10:09:07

thanks a lot for your help!

Saikyun10:09:27

hm, or maybe I did have to restart. oh well

Saikyun10:09:30

the shadow-cljs server process started giving me:

[2019-09-14 12:24:48.771 - WARNING] :shadow.cljs.devtools.errors/format-error
SocketException Broken pipe

thheller10:09:36

need more context. that doesn't mean much and wouldn't require a restart

Saikyun11:09:08

sorry, I'm not sure what caused it to happen, so that's why I didn't write more. I'll come back when I can reproduce it. good to know that it shouldn't require a restart

Saikyun12:09:27

it happened again. what I did was run (shadow.cljs.devtools.api/watch-compile! :app), then kill the app then start it again. when I do that it seems like the cljs-repl still thinks it's connected (when I try to eval things, I get Timeout while waiting for REPL result.). I could solve this by stopping the watch (using stop-watch) then starting it again.

thheller12:09:13

you do react-native right? that has a known problem in that it doesn't disconnect websocket connections when the app is reloaded

Saikyun12:09:25

yeah, react-native. ah, that makes sense then.

Saikyun12:09:44

using stop-worker (not stop-watch) works though, so no biggie πŸ™‚ still don't need to restart

joshkh12:09:34

silly question i'm sure, but does shadow-cljs require clojure, or can it compile clojurescript using just node and the shadow-cljs package?

thheller12:09:59

it is written in clojure and requires a JVM

joshkh13:09:20

that's what i thought. thanks πŸ™‚

joshkh13:09:09

i'm attempting to stitch together a heroku buildpack to compile a webapp using shadow-cljs without having to build a runnable uberjar. potentially just serving the compiled js via express. have you come across a project like that before?

thheller13:09:17

not really sure how a "runnable uberjar" factors into CLJS?

thheller13:09:21

you mean a CLJ webserver?

joshkh13:09:42

it's more of a heroku factor and how it handles clojure projects by default

joshkh13:09:02

(and lein)

thheller13:09:39

you just need java

joshkh13:09:00

but yes, a web server of some sort is needed of course

thheller13:09:02

you could do that in node via express or something yes

dazld20:09:11

nothing urgent, but wondering if there’s a way to change the colours of the shadow console messages?

thheller07:09:57

there is not but if you open an issue I can add an option for that eventually πŸ™‚

πŸ‘ 4
dazld20:09:23

they’re a little hard to read on a dark dev tools background