Fork me on GitHub
#fulcro
<
2018-03-31
>
quang06:03:58

Is there anyway to ./run-tutorial.sh with a different :websocket-host ?

quang07:03:23

I tried added :websocket-host :js-client-host to tutorial id in project.clj but that didn't work... I ended up having to edit the compiled resources/public/js/tutorial/figwheel/client/socket.js manually.

tony.kay18:04:24

JVM_OPTS=-Dfigwheel.port=8001 ./run-tutorial.sh should do it for JDK8. The console message will still say 8080, but you can ignore it. For JDK 9, you’ll need: JVM_OPTS="--add-modules java.xml.bind -Dfigwheel.port=8001" ./run-tutorial.sh

quang15:04:31

Thanks Tony!

Daniel Hines19:03:43

Forgive me if I just haven't gotten far enough in the docs, but should all the reads I define with defquery-root or defentity-query be synchronous? So far in the guide examples, it's all hand-coded data, but when I rip that out, I don't see a callback I would hand to some async code (i.e, database or REST query). Or am I missing something about multimethods (those are still fuzzy for me)?

claudiu19:03:09

defquery-root & defentity query are on the server

Daniel Hines19:03:01

Right. Isn't that where I would put my database code?

claudiu19:03:58

yep, but it has to return the value. No idea how that could be async. I wait for the response from the db and then format and return.

Daniel Hines19:03:20

Ok, cool. I guess since most of my experience is with JS/node, I'm used to EVERYTHING being async/promise/observable, etc. Thank you!

sundarj21:03:39

i think it's easy to forget that JS is so async-dependent because it doesn't have threads. Clojure does have threads

Daniel Hines17:04:52

That’s fair. I hadn’t thought about it, but since my database requests will be instigated by requests to fulcro server, they will probably each be handled in their own thread already by the http server it’s built on. Thanks for the reminder!

4
claudiu20:03:51

you're welcome 🙂 also new mostly js/node & python. now trying to figure out this java stuff 😄