This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-21
Channels
- # announcements (39)
- # architecture (7)
- # aws (9)
- # babashka (111)
- # beginners (139)
- # bristol-clojurians (1)
- # calva (47)
- # chlorine-clover (5)
- # cider (17)
- # clj-kondo (26)
- # clojars (25)
- # clojure (251)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (22)
- # clojure-france (1)
- # clojure-hungary (6)
- # clojure-losangeles (8)
- # clojure-nl (18)
- # clojure-spec (3)
- # clojure-uk (68)
- # clojured (32)
- # clojurescript (32)
- # core-async (10)
- # core-typed (120)
- # cursive (8)
- # datascript (10)
- # datomic (11)
- # docker (2)
- # emacs (6)
- # figwheel-main (4)
- # fulcro (10)
- # graalvm (92)
- # hoplon (2)
- # instaparse (9)
- # jobs (3)
- # jobs-discuss (31)
- # joker (2)
- # kaocha (1)
- # lambdaisland (5)
- # leiningen (10)
- # luminus (1)
- # lumo (14)
- # meander (30)
- # mid-cities-meetup (1)
- # midje (1)
- # off-topic (46)
- # pathom (22)
- # perun (2)
- # re-frame (10)
- # reitit (1)
- # remote-jobs (8)
- # shadow-cljs (71)
- # spacemacs (7)
- # sql (40)
- # tools-deps (31)
- # tree-sitter (11)
- # vim (14)
- # vscode (2)
- # xtdb (5)
What's a good clojurescript library to handle a SSE response (Server-Sent Events) [editted]? I found some old libs (chord) and the main one cljs-http
doesn't seem to handle the body in an async way
it should be just a regular http request that is reading from the connection until it's closed, and after that it starts again.
a yeah typed too quickly lol. I know it's very "simple", with curl for instance. But cljs-http
doesn't allow me to do it (I think). Do you have a specific library or everything hand-rolled?
@U1QQJJK89 Any specific library to use with websockets (client side)?
I feel we have a gap for a proper http library. Especially one that has one interface over all the different platforms that clojure now is targetting
Nothing client side. Im using immutant server side. Then just js interop client side. some core.async. transit encoding with LZString compression.
what I have found amazing is websockets + transit + multimethods + cljc as a gamechanger (IMHO). Being able to write client/server messaging "workflows" in a single cljc file with automatic dispatch (via multimehtods) feels pretty liberating.
Yeah exactly, I want that too. And the core of clojure works great on several platforms. It's the edges where you find yourself lost. E.g. now I want to do http requests. I have something for this that works on the server side, but when I think hey let's do this in a GraalVM environment or nodejs, or browser, they will all have a different implementation. If we can fix that .. 🙂
@U0FT7SRLP for websockets I recommend sente (handles client and server with reconnects and downgrades to ajax) - https://github.com/ptaoussanis/sente
You should definitely take a look at Hanasu https://github.com/jsa-aerial/hanasu It is a lot simpler than Sente but is very flexible.
Thank you!
It seems most people are more into websockets
Yes, generally I now use them for all this client/server (and/or peer to peer) communication. For the most part it is simpler, more flexible, and just works. For example, I use Hanasu extensively in several projects and I know some others do as well. I use it for python communication as well https://github.com/jsa-aerial/pyhanasu
Do you have an example clj/cljs/cljc project written in Hanasu one could examine?
several. Aerobio (which also uses pyhansu), Hanami and Saite are the public available ones: https://github.com/jsa-aerial/aerobio, https://github.com/jsa-aerial/hanami, https://github.com/jsa-aerial/saite
There are some others that I need/should release. These are not so much "written in Hanasu" as "written with Hanasu as the msg service"
I hope that a part of my issues with CLJS clients will be tackled by the new ring spec (see my point in this thread https://github.com/ring-clojure/ring/issues/393#issuecomment-593863601)
Where do beginners clojurescript questions belong? Because the following question will show I'm a total beginner in both clojurescript and web dev in general I'm afraid 😄. I trained a machine learning model in clojure and now I would like to use it in a small interactive webpage. I dived into using clojurescript for this, without really thinking much of exactly how I would communicate between my webapp and the model. The input for the model is a simple clojure vector, the output a single number. What would be the best way to this input-output communication going between clojurescript and clojure?
Thanks for the quick answer! 🙂 I'll look into AJAX requests, a quick search suggests to use cljs-http, is that still the standard/easiest way?
Great thanks! A last, very beginner question, is it ok to use the same base url (with different routing ofc) for both my clojurescript app and for my clojure "api"?
Yes, that should work.
I’m trying to make a router work with an re-frame application, but I’m not sure yet how do I make something like react-router with clojurescript, anyone that can help with? I tried to use secretary and now I’ve changed to re-frame-routing that uses bidi and pushy under the hood, but I still couldn’t make it work
I'm using kee-frame
with bidi
, it works perfectly. What do you mean by "couldn't make it work", what were the exact issues?
The problem is that I couldn’t sync secretary’s dispatch!
with browser’s url, I was able to route the application internally but the route doesn’t reflect on the browser URL, and if I try to change the URL manually (like a href
’s link) the page reloads
I've recently had the same question for secretary. Take a look at accountant which works together with secretary to take care of the browser history, it will update the browser, too.
Do you have an example clj/cljs/cljc project written in Hanasu one could examine?