This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-08
Channels
- # babashka (18)
- # beginners (35)
- # biff (15)
- # cider (24)
- # clj-commons (26)
- # clj-kondo (12)
- # clojure (18)
- # clojure-austin (1)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (88)
- # clojure-seattle (2)
- # clojure-spec (14)
- # clojure-uk (27)
- # clojuredesign-podcast (5)
- # clojurescript (25)
- # cursive (3)
- # datahike (26)
- # datalevin (13)
- # datomic (39)
- # etaoin (19)
- # events (1)
- # fulcro (12)
- # graphql (1)
- # hyperfiddle (40)
- # introduce-yourself (3)
- # joyride (8)
- # lsp (53)
- # missionary (7)
- # nyc (1)
- # off-topic (31)
- # overtone (10)
- # reitit (6)
- # shadow-cljs (9)
- # slack-help (9)
- # thejaloniki (1)
- # tools-deps (12)
Seems that using tmdjs causes missionary to cancel. All I do is require it in and it causes electric to completely crash in the browser. Repro - https://github.com/groundedsage/electric-tmdjs
Looking to use techml for sending large timeseries datasets to the frontend plus performing a bunch of compute required for rendering into datavis.
I would like to have infinite scroll and panning in my datavis. I am currently thinking I need to structure things this way • all data (backend) • buffered data window in frontend • virtual (visualised/rendered) window
Use Rama for all data. For the data I want in the frontend put that into a techmldataset and then transmit it to the frontend using the built in transit. Then read that into a tmdjs dataset in the frontend.
Following that I would do a filtering for the virtual window I am rendering and then also run scaling on the values. Also calculating moving averages.
Then put each entity into a sequence of maps for Electric rendering inside dom/svg
As I said in DM: For our paid design partners we are developing efficient virtual scroll patterns that are designed to scale to large datasets. But unfortunately capabilities like this we can only offer to our commercial partners at this time.
I sent all these messages around the same time. I respect the work required here and understand. It’s hard work. I’m happy to keep noodling on this problem and find a solution. The only blocker there is tmdjs causing missionary to cancel when loaded into the namespace. But I can also work around that for now.
I can also try digging into what is causing the tmdjs/missionary issue. But unsure where to even start looking for that.
Hi guys! I have something like this:
(e/defn Board [route-name route-match]
(case route-name
:foo (Foo. (:id route-match)
:baz (Baz. (:id route-match)))
Let’s say route-name
and route-match
change now. In this case, even if the route-name
is :foo
the branch :baz
of the case will be fire, right?It’s weird because here:
(e/defn Board [route-name route-match]
(e/server
(let [raw-user-id (get-in e/*http-request* [:cookies "cookie-id" :value])
user (retrieve-logged-user raw-user-id)]
(e/client
(binding [current-user user]
(dom/div
(Header.)
(dom/div
(case route-name
:foo (quiz-list/QuizList.)
:baz (quiz-item/QuizItem. (-> route-match :path-params :id))
:bar (do
(prn "THIS IS PRINT WHEN route-name IS :foo")
(quiz-session/QuizSession. (-> route-match :path-params :id)
raw-user-id))))))))))
the :bar
branch is fire even if the route-name
is :foo
. I don’t understand the cause of this.To be clear the branch :foo
is displayed but the prn
into the branch :bar
is also displayed.
Hello! I wondering is it possible to disappear that vector from screen ? I using history/router in my project and I seeing the params on screen and of course local host link. So if possible I dont want to see that. 🙂
didn't you copy it from one of the main entrypoints?
(dom/pre (dom/text (contrib.str/pprint-str history/route)))
Glad to help! The link is the storage in this case, e.g. to persist over tab refresh
I am scared that if a user changes the link's param part with some mock data is it going to make trouble for the app? Because I can change users from the link 😄
electric doesn't change the security considerations of one's application. The backend should still validate all user input, including the URL
and with publicly available data it's not a problem, e.g. you can change the username in a github link, reddit etc. to get to one's profile page
I see, I already prevented and restricted improtant datas in backend but I just wondered is it possible to they params on link or not. 🙂 Thanks for the help! 🙂
I have one more question: is there any supported event list exist in electric? I used before keydown - keyup - click -change but now I need to use load events and some mouse events. like: Load Events • DOMContentLoaded: Fired when the initial HTML document has been completely loaded and parsed without waiting for external resources like images. • load: Fired when the entire page, including all images and external resources, has finished loading.
(dom/on "DOMContentLoaded" (fn [] (swap! !state assoc :category (keyword "service" (str (.-value dom/node))))))
(dom/on "load" (fn [] (swap! !state assoc :category (keyword "service" (str (.-value dom/node))))))
(dom/on "change" (fn [] (swap! !state assoc :category (keyword "service" (str (.-value dom/node))))))
use dom/on!
with clojure.core/fn, dom/on
is for e/fn
all events should be supported, if something is wrong the dom/on! source code is straightforward to understand and can be adapted to some other dom API
Hello, I have architecture-related questions. In the future, I'd like my app (a multiplayer party game) to be able to run in "Hybrid Mode" on both LAN and Cloud simultaneously, sharing state between 2 server instances, so clients can interact transparently as if there were one server with 2 URLs. There's no rush for this feature, I'm happy to wait a year or two. (For context, it'll run for only 2 hours at a time, with 10-2,000 clients, and fairly low throughput). Question 1: When the Electric Examples App runs on multiple http://fly.io "machines", can those instances "see" each other, or is my instance of the multiplayer chat only sharing state with other clients in my region? Question 2: Would I achieve my Hybrid Mode by running 2+ servers (when Elec implements that), or by having one of them essentially be an event-forwarder, that round-trips everything to the "real" server? Question 3: I'm about to replace my hand-rolled state-atom with DataScript or Datomic Local (or Datomic Pro if needs be). If my Hybrid Mode is a 2-server solution, does it require Datomic Pro running decoupled on the cloud somewhere, or will Electric be able to share & update the other in-memory databases between instances? In a way, these are all the same question, but my understanding of both Electric & distributed systems is severely lacking. TIA!
Q1: fly instances don’t share state, yes they can reach each other but shared global state is your problem, likely you want to have each fly region connect to the local AWS region and use a service that advertises cross region writes
basically Electric is your web tier only, in the end Electric is just a protocol there is no magic or new physics
Q3: Datomic is a single region datastore, and Electric servers do not talk to each other (theoretically we could assist with this but still it will not get you the efficient globally distributed multi master writes that you are looking for)
Google Spanner is a good starting point for multi master writes, (note this is not my domain of expertise)
or if this is overkill maybe a CRDT? idk
Very comprehensive, thank you 🙂 I think CRDT or having a single master will be fine, I just want to avoid making mistakes early on that will require huge rewrites later.
I recommend that you use a dedicated central store to handle shared state instead of rolling your own, but you could try hazelcast if you don't want a third party server. depending on your requirements the latency of something like redis/scylladb is quite low already
i also like hazelcast for this now that i understand better the problem
> For context, it’ll run for only 2 hours at a time, with 10-2,000 clients, and fairly low throughput With those numbers I wonder if it will be much simpler to run a single server. You can use something like https://github.com/juji-io/datalevin for an in process datomic/datascript like, which would simplify your ops considerably. Datalevin meshes really well with electric in my limited experience. It also has a server mode if you need to scale up to multiple instances, so it won’t lock you in to a single server if for whatever reason your project is wildly successful.
@U0JEEGD4N Yes I think that's the answer - I've made a note of Hazelcast for later, but for now I'll stop overthinking and stick to the simplest thing that works 🙂 Datalevin looks good, I'd forgotten that one! I noticed you're in Edinburgh BTW - my goal is to do a run at Edinburgh Fringe with whatever interactive thing I end up making, so if you're there in August, it'll be Liquid Rooms on Victoria St 😉
Oh, awesome. Clojure is making the jump to the fringe! - I do think electric is a natural fit for digital party games so i’m excited to hear/see how it goes.