hyperfiddle

2025-05-17T04:11:04.392219Z

what does "superseded" mean in this form composition example?

electric-tutorial.form-list ; superseded
should i not reference it? still wrapping my head around forms5. my goal is to have three tabs each with a single textbox editing a different key of a server-side atom map, in auto-submit mode. for this, would you suggest using one Form! or multiple instances of Form!?

Geoffrey Gaillard 2025-05-19T08:57:23.435779Z

would you suggest using one Form! or multiple instances of Form! ?I’d go for one Form! per tab. Because your text fields seem independent of each other. If they do depend on each other (e.g. validated together), then putting them in the same Form! is the way to go.

💯 1
Geoffrey Gaillard 2025-05-19T08:58:06.617869Z

> does auto-submit not work with Textarea!? It should, if it doesn’t, it’s a bug.

Geoffrey Gaillard 2025-05-19T08:59:01.484949Z

some feedback: Textarea! should probably not have a default maxlength of 100I agree, sorry for the inconvenience. It’s also questionable for Input!. We’ll look into it.

🙏 1
2025-05-19T10:17:07.528399Z

yes it does seem to be a bug. input and textarea are tricky to generalize! i think i have a workaround for now

2025-05-17T13:51:06.626839Z

does auto-submit not work with Textarea!?

2025-05-17T14:24:36.752239Z

some feedback: Textarea! should probably not have a default maxlength of 100

2025-05-17T16:25:26.056639Z

workaround:

(Input! k (get form-value k) :as :textarea :maxlength 10000000)
tried this first:
(Textarea! k (get form-value k) :maxlength 10000000)
and got
Reactor failure: Error: conj on a map takes map entries or seqables of map entries

tobias 2025-05-17T04:41:23.636199Z

Is there a pattern for calling an electric function from a clojurescript function? I seem to remember there was some workaround by having Electric respond to a change in a client side atom? The use case is for Firebase auth. The client-side Firebase library uses a callback system where you supply a function to be called when the user logs in successfully. When the user logs in I want to call an Electric function to save the user's ID token in an atom on the server. It would also be useful in other situations e.g. if I have some react ui component with a callback and I want to do something on the server in response to the user interacting with the ui component.

2025-05-17T07:01:33.747499Z

this thread might be relevant: https://clojurians.slack.com/archives/C7Q9GSHFV/p1746804046555269

henrik 2025-05-17T08:37:45.277799Z

The most straightforward would probably be to have the callback be a reset! of a clientside atom (default nil, or whatever makes sense). Watch that atom, and guard a server scope with (when atom-value (e/server …)).

tobias 2025-05-17T12:48:34.799189Z

Thanks guys I will explore those approaches

tobias 2025-05-17T04:41:55.682319Z

I know this is tricky in general because "Electric needs to be on the outside" so to speak.

2025-05-17T07:04:15.582459Z

i'm trying to run https://electric.hyperfiddle.net/tutorial locally on commit de2bad00eb29312bae7a0641385f42cd07a218fd (gitlab repo), but it's failing with these errors:

electric-fiddle % clj -A:dev:electric-tutorial:dustingetz -X dev/-main

Exception in thread "main" Syntax error macroexpanding at (da.omic_browser/datomic_browser3.cljc:1:1).
        at clojure.lang.Compiler.load(Compiler.java:8177)
...
Caused by: java.io.FileNotFoundException: Could not locate dustingetz/entity_browser3__init.class, dustingetz/entity_browser3.clj or dustingetz/entity_browser3.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
        at clojure.lang.RT.load(RT.java:482)

Dustin Getz (Hyperfiddle) 2025-05-17T12:40:16.517429Z

disable the datomic demos in docs-site.sitemap \

🙏 1