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!?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.
> does auto-submit not work with Textarea!? It should, if it doesn’t, it’s a bug.
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.
yes it does seem to be a bug. input and textarea are tricky to generalize! i think i have a workaround for now
does auto-submit not work with Textarea!?
some feedback: Textarea! should probably not have a default maxlength of 100
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 entriesIs 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.
this thread might be relevant: https://clojurians.slack.com/archives/C7Q9GSHFV/p1746804046555269
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 …)).
Thanks guys I will explore those approaches
I know this is tricky in general because "Electric needs to be on the outside" so to speak.
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)disable the datomic demos in docs-site.sitemap \