Fork me on GitHub
#clojurescript
<
2022-03-27
>
olaf00:03:30

I’m looking for references on how to connect to a nREPL server from a cljs webpage. I read the nREPL docs and tried with a websocket but doesn’t seems to like it. Just need to pass {:op "clone"} {:op "eval" :code "…"} {:op "interrupt"} to the server and read the reply. Any hints? (posting here because #nrepl seems a bit quiet)

thheller07:03:31

for that you first need a nrepl server that supports websockets. the default one doesn't. not sure there are any that do. what do you intend to do?

olaf07:03:29

Not sure I need websocket. I want to expose the repl to the frontend of an electron app. So pretty much what an IDE does but in a cljs webpage

thheller08:03:07

assuming you want this as a development aid. if the point of the app is to be a full REPL client then you need a full websocket nrepl server

thheller08:03:29

or I guess implement the nrepl protocol over tcp given that elecrtron can open tcp connections

olaf08:03:55

Yes, a full REPL. I will try with node using tcp or a socket nrepl. Thanks

pinkfrog07:03:24

How can I convert the react

useEffect(() => {
  // do something
}, [array, dependency])
to reagent ?

valtteri08:03:24

(require '["react" :as react])

(.useEffect react (fn [] (do-your-effect)) #js[your-dep])

thanks3 1
valtteri08:03:50

Note that hooks can only be used within function components. You can tell reagent to treat a component as a function component like this [:f> your-function-component]

Jakub Holý (HolyJak)08:03:45

Hi! Any idea when is update-vals coming to clojurescript? I have switched to 1.11.4 but it seems not to be there. Thank you!

Jakub Holý (HolyJak)17:03:48

Ah, https://github.com/clojure/clojurescript/commits/master that update-vals, iteration and other stuff has been added in Q1, after the 1.11.4 release so I have to wait until the next cljs release... 😢

👍 1
mruzekw17:03:21

Has anyone used Mori in their JS projects lately? I'm wondering about the state of the project. https://github.com/swannodette/mori

1
emccue03:03:10

Totally abandoned. Use immutable.js (or one of the other options)

👀 1
mruzekw16:03:21

Fair enough. I've been looking at https://github.com/92green/unmutable for a point-free style

Jakub Holý (HolyJak)17:03:48

Ah, https://github.com/clojure/clojurescript/commits/master that update-vals, iteration and other stuff has been added in Q1, after the 1.11.4 release so I have to wait until the next cljs release... 😢

👍 1