This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-06
Channels
- # announcements (5)
- # asami (4)
- # babashka (27)
- # beginners (1)
- # calva (4)
- # cider (64)
- # clj-kondo (7)
- # clojure (7)
- # clojure-brasil (3)
- # clojure-europe (41)
- # clojure-france (2)
- # clojure-norway (101)
- # clojure-uk (5)
- # clojurescript (19)
- # cursive (3)
- # datahike (15)
- # datomic (15)
- # events (2)
- # honeysql (11)
- # hyperfiddle (27)
- # introduce-yourself (2)
- # jobs-rus (1)
- # leiningen (8)
- # london-clojurians (1)
- # lsp (175)
- # off-topic (52)
- # overtone (10)
- # portal (15)
- # re-frame (7)
- # reagent (1)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (15)
- # sql (5)
@dustingetz a little off topic but what do you use for screen recording? I am thinking to make some "walk through" videos of my electric code and currently i'm doing (2x quicktime)
I used Wondershare demo creator to create a RCF video in 2021 seemed ok to use at the time, I'm not a power video editor though
https://www.loom.com/ is worth a look
Vimeo has a pretty good free recorder these days as well
I need a better way to send an access-token along when establishing the Electric websocket connection. What’s the suggested way to do this?
ideally the access token is stored... clientside in browser storage, in header of every request? both?
tangentially related: i'm using tuple <timestamp, username> to derive a <userhash> and pass all three when the user does stuff. Probably a better way exists.
I was pretty sure that you can’t use headers with a websocket connection, and have to rely on a query-string or some other mechanism. How do you supply these headers?
I believe the session ID used in the examples is just the standard session ID attached to all websocket connections.
As far as I know, it is not possible to set headers on the WS UPGRADE request. Is it ok to pass your token as a query param? If no, then you need a two-step mechanism: 1. Issue a request to /set-token, a. pass your token as a header b. generate a unique id (e.g. uuid), c. store the pair (uid, token) into some hash-map i. ensures the pair is short-lived - clean it up after a few seconds (e.g. with a missionary task or make your map a TTL cache) d. return the uid 2. pass the UID as a query param in the WS connection url a. get the corresponding token from the map
In this case, a third party (Auth0) handles all the storage etc., so I literally only have to find a non-insane way to have the access-token travel along with the WS connection request.
Not in Electric, but you can rebind *ws-server-url*
before calling hyperfiddle.electric/boot
, so before the program starts.
Not the kind of thing you want to leave hanging around in a cookie. It’ll go stale if your cookie lives longer than the access token it holds.
OpenAI are letting people create custom gpts, I remember Dustin once said it would be good to have a bot that could help with support check it on their devday video
Yeah a dialed in Electric GPT would be amazing for helping with the minutia
anybody have a working electric+rama clojure api example of subscribing to changes on a pstate? having some trouble converting the callback of foreign-proxy
to something electric can use (missionary observable?)
I’m doing this:
(defn make-reactive-query [path pstate]
(->> (m/observe
(fn [!]
;; Init
(! nil)
(let [cp (r/foreign-proxy-async path pstate {:callback-fn (proxy-callback !)})]
#(.close @cp))))
(m/relieve {})))
There is also a thread about this: https://clojurians.slack.com/archives/CL85MBPEF/p1698062851851949