hyperfiddle

braai engineer 2025-08-18T15:33:28.517219Z

Are {:pre [...]} checks supported in Electric v3 fn's, and if yes, where do they run given that they are not sited?

Geoffrey Gaillard 2025-08-18T16:06:18.176419Z

No, :pre and :post conditions are not supported by Electric v3 fn yet. Neither assert.

👍 1
braai engineer 2025-08-18T18:45:09.878359Z

Gotcha. In that case: the Electric compiler does not throw if you specify {:pre [...]} although some users used to clj functions may expect it to work, even though it is not supported.

Geoffrey Gaillard 2025-08-18T20:50:34.915139Z

You're right, we should certainly improve DX in that regard. Thank you for your feedback 👍

braai engineer 2025-08-18T16:21:41.806349Z

Given a recursive Electric fn that renders a tree picker, if you pass (e/server root-node-id) as the root node value ID at the top-level (root) call-site, does Electric care that subsequent recursive child ID renders are sited on the client, i.e. (e/client some-child-id)? I assume Electric won't care, but curious coz I'm debugging a perf. issue at the moment and trying to get to the bottom of it.

Geoffrey Gaillard 2025-08-18T17:37:32.525269Z

Electric fn calls are site-neutral. Only host interop is sited. Transfers should only happen at your recursive tree leaves. See the "no request waterfall" section of Electric documentation. Beware of rest arguments (`& args`) and destructuring though: they desugar to host interop (as in plain clojure): • Rest args builds a list value • Destructuring calls nth or get Both forces the value site.

👍 2
Dustin Getz (Hyperfiddle) 2025-08-18T19:20:28.583449Z

control flow is also sited e.g. if