This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-22
Channels
- # alda (2)
- # announcements (1)
- # babashka (32)
- # beginners (67)
- # calva (1)
- # cider (19)
- # clerk (11)
- # clj-commons (35)
- # clj-kondo (7)
- # cljsrn (2)
- # clojure (35)
- # clojure-europe (86)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-russia (6)
- # clojurescript (16)
- # clr (21)
- # conjure (1)
- # core-async (10)
- # cryogen (1)
- # cursive (12)
- # data-science (1)
- # emacs (29)
- # events (4)
- # figwheel-main (2)
- # graalvm (9)
- # gratitude (7)
- # honeysql (4)
- # hugsql (3)
- # hyperfiddle (23)
- # jobs (1)
- # jobs-discuss (4)
- # joyride (9)
- # malli (2)
- # off-topic (81)
- # portal (7)
- # reagent (19)
- # reitit (1)
- # releases (4)
- # shadow-cljs (121)
- # xtdb (3)
Is there a way to get electric to tell me which line an unserializable transfer has occurred? I keep missing places that I need to add (e/server) and since it gives me the datom from datascript rather than a line where it occurred it's a bit hard to track down where in my code the issue is.
INFO : Unserializable reference transfer: datascript.db.Datom #datascript/Datom [8 :player/session-id "MzBVM0RORlhRK09zSDQvcmZQMDFIdz09" 536870921 true]
I'm using the same datoms all over my code so it's not exactly clear where the problem is happening.This has been on our backlog for a while. For now I typically bisect-comment the code in question
cells updates trigger reactively when referenced cells update. all execution happens in parallel on separate threads
wow, nice! how did you like using electric for building it? did you face any problems?
loved it! no problems. I had tried building this in reagent in the past and it quickly turned into a serialization/performance nightmare
Nice! Spreadsheets and electric seem like a great match to me too, but I've never tried myself!
How can I relocate an electric app to an other context root, not "/" ? Is there something in the "build" to do so ?
Electric itself doesn't know about the page's path. There are two places in userland application code that relate to the path: ā¢ index.html or other userland page entrypoint which boots the Electric client, e.g. https://github.com/hyperfiddle/electric-starter-app/blob/main/src/user.cljs#L16-L18 - you can call this from anywhere, Electric doesn't care, it will connect by websocket protocol and doesn't interact with any ordinary http endpoints (IIUC, the team will correct me if I made any mistake) ā¢ Application router code done from inside the Electric application. The starter app doesn't even include a router and never looks at the path (browse around the starter app src https://github.com/hyperfiddle/electric-starter-app/tree/main/src). The electric demo app does include a router https://github.com/hyperfiddle/electric/blob/7ef1612c9659d1e88f2f41223f5c7c045a5eb399/src-docs/user_main.cljc#L88-L97, so you'd need to slice off any context at this point.
Does this answer your question?
Note, I do not recommend you use the hyperfiddle.history router that the demo app uses, it is experimental and more complex to configure than we like. I'd recommend a simple https://github.com/hyperfiddle/electric/blob/master/src/contrib/electric_goog_history.cljc, you can modify that to deal with chopping off any parent routes
I was wondering where this https://github.com/hyperfiddle/electric-starter-app/blob/0b4ebdfe6399db8aceaef6539f03c7ae7ac444ba/resources/public/index.html#L11 gets changed into "/js/main.57678446D54FAE742D3AB51E6C9B1E63.js" When I put the starter app into Kubernetes and and an ingress , I would need to download the js from something like "/myapp/js/,,,,,"
Basicaly I would lkie that my electrip app is available at:
š App server available at
instead of
š App server available at
Is this for at work?
In the starter app, index.html is served by a ring middleware https://github.com/hyperfiddle/electric-starter-app/blob/0b4ebdfe6399db8aceaef6539f03c7ae7ac444ba/src/electric_server_java8_jetty9.clj#L101. The dev/ops team will need to modify the jetty server starter to suit their customizations. The starter app is NOT a production server, it is just an example, real apps need more secure auth for example
If you serve index.html
via /myapp
route. electric will be available via /myapp
and you use /
for something else. You can use your own ring handlers my app lives in /app
.
> Q: where is <script type="text/javascript" src="$:hyperfiddle.client.module/main$"></script>
rendered?
see template
in jetty-server https://github.com/hyperfiddle/electric-starter-app/blob/0b4ebdfe6399db8aceaef6539f03c7ae7ac444ba/src/electric_server_java8_jetty9.clj#L60-L62
I don't get it working. There are too many places in the starter-app to change, and probably i miss some. Does somebody have an example app (with code) which is not on "/" but on "/myapp".
@U7CAHM72M This is the striped down version of my core.clj
electric lives under /app
and a generic landing page under /
[1]
[1] https://gist.github.com/nakkaya/7b65ddc161aad9beb7207c8b520c47f3