This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-10
Channels
- # announcements (4)
- # babashka (29)
- # beginners (15)
- # calva (4)
- # cljs-dev (1)
- # clojure (28)
- # clojure-dev (13)
- # clojure-europe (3)
- # clojure-india (1)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (37)
- # component (2)
- # conjure (60)
- # cursive (2)
- # datomic (1)
- # emacs (1)
- # figwheel-main (18)
- # fulcro (38)
- # graalvm (6)
- # graphql (13)
- # helix (14)
- # jobs-discuss (1)
- # joker (5)
- # lein-figwheel (2)
- # nrepl (3)
- # off-topic (15)
- # other-languages (1)
- # other-lisps (1)
- # pedestal (2)
- # reagent (8)
- # reitit (44)
- # shadow-cljs (83)
- # slack-help (8)
- # spacemacs (1)
Hey, I'm trying to move from React to Reagent using shadow-cljs
but for some reason I don't understand, I keep getting this message *shadow-cljs - Stale Client! You are not using the latest compilation output!*
When I add break points on any piece of code it seems like it gets to it but does not really execute it. not even (js/alert "lala")
yeah I actually copied the question there after I found out theres a channel dedicated to shadow-cljs
Does anyone have experience writing chrome extensions in Clojurescript? What do you use - chromex?
Hey! What is currently well-maintained way of doing WebSockest in Clojure? I am looking for effortless way of talking with Clojure data structures back and forth.
I was looking at Sente, but it feels like abstraction on abstraction on abstraction.. And using it with component
on backend it pretty much guesswork.
I haven't had the need for Sente myself, by I would urge you to take a second look at it. Zach Tellman is a fantastic asset to this community. He maintains lots of high-performance Clojure/Java libraries, has many interesting talks, and wrote the awesome book Elements of Clojure that really underscores just how much hammock time is behind his open source stuff.
Basically, he makes good stuff and the abstractions are probably there for a very good reason.
Yep, it's by Peter Taoussanis. Still a great software engineer though, with many OSS projects.
I guess I thought of Zach because he is a master of abstractions (manifold) and made Aleph which also has a websocket component.
Well, honestly I am just having difficulties with getting it to work and due to it complexity I’ve got issues finding the cause.
eg.
Sun May 10 22:27:20 CEST 2020 [worker-1] ERROR - GET /chsk
java.lang.IllegalStateException: close handler exist: taoensso.sente.server_adapters.http_kit.HttpKitServerChanAdapter$fn__48045@46087ec
at org.httpkit.server.AsyncChannel.setCloseHandler(AsyncChannel.java:197)
at org.httpkit.server$eval20613$fn__20626.invoke(server.clj:151)
at org.httpkit.server$eval20514$fn__20584$G__20505__20591.invoke(server.clj:96)
at taoensso.sente.server_adapters.http_kit.HttpKitServerChanAdapter.ring_req__GT_server_ch_resp(http_kit.clj:25)
at taoensso.sente$make_channel_socket_server_BANG_$fn__26730.invoke(sente.cljc:638)
I have used pure Jetty websockets (via Pedestal) and haslett/gniazdo for CLJS client. You need to do your own ping/pong to keep the connection alive. And your own auth.
@UB0EMUD34 Impossible to say anything definitive without the code that calls ajax-get-or-ws-handshake-fn
. Seems like you call hk/on-close
twice on the same object.
Also there's this: https://github.com/http-kit/http-kit/issues/408
@U2FRKM4TW there isn’t really too much code…
(GET "/chsk" req (ring-ajax-get-or-ws-handshake req))
And component:
:sente (new-channel-socket-server nil
(sente-http-kit/get-sch-adapter)
;;
{:csrf-token-fn nil
:allowed-origins #{""}
})
And in cljs:
(defonce sente-socket
(sente/make-channel-socket! "/chsk" nil
{:type :auto
:port 8080
}))
Yeah, it seems like you're hitting that issue. I don't know how to fix it by doing anything short of reproducing and debugging it.
If you can create a minimal reproducible example (definitely without the component
library) and post it in the issue, it definitely could be helpful to those that will try to fix it.
I doubt it will be me though. :) I use Sente with Aleph, so far it has been perfect.
And I don’t like working around things that way. You know, at some point I will indeed need http-kit and then what..
start with the working sente clone
anyone tried the new functional-compiler
of reagent? how would I know that Reagent actually creating function components and not Class components? I mean how can I see the React code that comes out ?
Hi 🙂 You can always look into the JS generated by ClojureScript (either in the browser or in the output dir generated by CLJS). You could log your components and see what they output. In general though, one way to know if a component is a Class or Function component is if the component has a isReactComponent
flag. see https://overreacted.io/how-does-react-tell-a-class-from-a-function/ and for more information about how a class component is transformed in Reagent https://betweentwoparens.com/what-the-reagent-component