hyperfiddle

Dustin Getz (Hyperfiddle) 2025-06-11T00:15:32.034609Z

Andrew Wilcox 2025-06-11T03:55:20.090529Z

Is this the correct pattern to use to define an element that takes children?

(e/defn Border [Content]
  (dom/div
    (dom/props {:style {:border-width "1px"}})
    (Content)))

(Border
  (e/fn []
    (dom/p (dom/text "one"))
    (dom/p (dom/text "two"))))

;=>

<div style="border-width: 1px;">
  <p>one</p>
  <p>two</p>
</div>

xificurC 2025-06-11T05:42:59.689899Z

yes

👍 1
Dustin Getz (Hyperfiddle) 2025-06-11T11:55:34.214339Z

you can write a trivial macro to encapsulate the boilerplate, we do this so often that we should probably figure out a macro syntax to define container components like this, i dont think we've thought much about it yet

2025-06-11T08:10:26.880259Z

With v3, I’ve been getting “Method code too large” errors in production builds. The error message often points at a very small function, and the actual problem seems to be with a caller of the function, or even a caller of the caller. Up until yesterday, I’ve managed to make the errors go away by splitting functions into pieces. The problem got much worse for me yesterday, and I’ve noticed that there was a new release a couple of days ago that I’m guessing is the reason. See thread for a small reproduction of the problem.

2025-06-11T08:11:41.065559Z

I’m happy to create a Git repo to demonstrate this — please let me know if you would like me to do that — but perhaps it’s easier just to give the following instructions… 1. Clone the starter app. 2. Replace the electric-starter-app.main namespace with the code given below. 3. Add the my-namespace app with the code given below. 4. Do a production build. This gives me a “Method code too large” error. The error message points at an Electric function that has an empty body. (I get this with a Docker build where everything is clean, as well as with a “normal” build.) The comments in my-namespace describe ways to make the problem go away by deleting code.

2025-06-11T08:12:38.940879Z

2025-06-11T08:13:25.925959Z

2025-06-11T08:16:29.515369Z

So, just to pull things out from those comments, I have three ways to make the problem go away: 1. Delete the attr-map in the namespace declaration. 2. Delete Unused-function. 3. Delete one line from the body of Unused-function.

xificurC 2025-06-11T09:56:35.745529Z

thanks for the report Simon, we'll take a look and keep you posted

👍 2
2025-06-11T10:13:20.461249Z

Ah, if I remove attr-maps from all namespace declarations in my real code the problem goes away.

xificurC 2025-06-11T11:06:00.862909Z

is that electric specific then?

2025-06-11T11:18:16.349299Z

Ah, good question. IDK. A quick google hasn’t shown up anyone else with the same issue. I’m not blocked, because I can remove attr-maps temporarily for a prod build. I will try reproducing with a non-Electric project, but maybe not very soon.

Hendrik 2025-06-11T08:11:32.265739Z

Has anybody used clojure-mcp with Electric? If yes: What are your experiences and what is your workflow / prompt to make it a smooth experience? I gave it a try, but I wasn’t able to produce good results, yet. It seems that clojure-mcp struggles with hot-code-reloading and the fact it cannot use electric functions in the repl to evaluate something.

2025-06-11T13:15:37.476269Z

I just thought I’d share what I’ve been building with Electric — a timeline of Ancient Greece. It’s not really the kind of app that Electric is aimed at, but I enjoy using Electric and it definitely works for this. :-) Thanks everyone for all the help answering my questions! https://timelines.nomistech.com/ Needs to be on a reasonable-sized screen — not a phone.

👏 6
🇬🇷 2
🎉 5
Dustin Getz (Hyperfiddle) 2025-06-13T10:21:45.729719Z

Can I see the complete source code of your app @nomiskatz there are some basic things I'd like to check

2025-06-13T10:46:42.275099Z

@dustingetz I’ve added you as a collaborator. Just trying to work out how to make it read-only…

2025-06-13T10:48:38.944789Z

Ah, “In a private repository, repository owners can only grant write access to collaborators.”

2025-06-13T10:49:11.157939Z

So I’ll leave it like that.

2025-06-13T10:50:23.220849Z

You should get an invite from GitHub.

👍 1
Dustin Getz (Hyperfiddle) 2025-06-13T11:38:07.067259Z

Simon can you add @ggaillard ggeoffrey and @xifi xificurC to the repo pls

2025-06-13T11:45:03.824979Z

I’ve added ggeoffrey but can’t find xificurC.

Dustin Getz (Hyperfiddle) 2025-06-13T11:45:46.782899Z

https://github.com/xificurC

2025-06-13T11:47:57.718709Z

Done. I think there might have been a glitch at GitHub.

Geoffrey Gaillard 2025-06-13T11:49:28.876589Z

I received and accepted the invite. Thank you Simon, we will take a look.

👍 1
2025-06-13T11:50:43.279209Z

Out of interest, is this about the prod build issue I was having, or about whether the app can be improved (more responsive, whatever)?

2025-06-13T14:07:24.797589Z

FWIW, in Emacs, if you want to make some of the clj-kondo annotations go away, take a look at the minor mode at https://github.com/simon-katz/nomis-public-dev-setup/blob/master/emacs-configuration/emacs-installation/emacs-init-files/nomis-replace-text.el

Dustin Getz (Hyperfiddle) 2025-06-13T14:09:39.509989Z

we are interested in performance, it is an active priority

👍 1
telekid 2025-06-11T13:46:39.758699Z

Very cool. Probably serves as a good example for performance optimization work.

☝️ 1
🙏 1
Dustin Getz (Hyperfiddle) 2025-06-11T13:46:41.421429Z

this is very cool

🙏 1
telekid 2025-06-11T13:47:35.751899Z

The bidirectional interactivity (e.g. "autoscroll chart to hovered item") is exactly the kind of UX that is normally a pain to build.

telekid 2025-06-11T13:48:33.163939Z

Definitely some rendering jank on my side. Would be an interesting exercise to see what it would take to make that go away.

Dustin Getz (Hyperfiddle) 2025-06-11T13:49:31.032169Z

We certainly want this to be fast in Electric, the rendering pauses are probably the same e/for flaw that we're working on

👍 2
telekid 2025-06-11T13:51:33.854769Z

Great UX all around.

🙏 1