hyperfiddle

thomas 2025-07-11T09:11:22.807589Z

When I run clj -A:dev -X dev/-main on the starter app I can see INFO dev: :point_right: on the screen, but I get a time out when I point my browser at it? Any ideas?

Geoffrey Gaillard 2025-07-11T10:03:26.986359Z

Are you running on Windows?

thomas 2025-07-11T10:03:54.995429Z

Yes, with WSL2 installed

Geoffrey Gaillard 2025-07-11T10:13:15.336559Z

This is on us. Iโ€™m attempting a fix. Will keep you posted soon

๐Ÿ‘ 1
๐Ÿ’ฏ 1
Geoffrey Gaillard 2025-07-11T10:16:00.961149Z

I pushed a fix. git pull and clj -A:dev -X dev/-main should do the trick.

๐Ÿ™ 1
thomas 2025-07-11T10:38:06.515629Z

going to try that now....

thomas 2025-07-11T10:47:44.775669Z

Still fails for me, and what I noticed is that when I put http://0.0.0.0:8080 in my browser it changes to http://127.0.0.1:8080/ Not sure if that is relevant though. I use FF.

thomas 2025-07-11T10:49:48.210549Z

And I also get this:

*   Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080
> GET / HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 11 Jul 2025 10:49:13 GMT
< Last-Modified: Thu, 10 Jul 2025 14:02:45 GMT
< Content-Type: text/html
< Content-Length: 399
< Server: Jetty(11.0.18)
<

<html>
    <head>
        <meta charset="utf-8"/>
        <title>Hyperfiddle</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="/electric_starter_app/index.css" type="text/css" />
        <script defer type="text/javascript" src="/electric_starter_app/js/main.js"></script>
    </head>
    <body></body>
</html>

thomas 2025-07-11T10:50:15.995899Z

so it works... but FF is not playing ball for some reason. Let me try another browser

thomas 2025-07-11T10:54:15.934089Z

hmm Edge and Brave don't like it either... but curl does

thomas 2025-07-11T10:54:27.256999Z

and wget as well ๐Ÿค”

๐Ÿ‘€ 1
thomas 2025-07-11T11:01:09.642139Z

weird..... http://localhost:8080/ works now for me.

๐Ÿ™Œ 1
thomas 2025-07-11T11:01:16.674169Z

I don't get it

Geoffrey Gaillard 2025-07-11T11:15:05.959979Z

Glad to hear it works with localhost. Sorry you had to debug it. Iโ€™m capturing this and we will improve.

thomas 2025-07-11T11:30:19.325479Z

no worries, just a bit confused

thomas 2025-07-11T13:51:19.197559Z

ok, there is a difference with the latest Ring version ("1.14.2") and the one used in the starter app. Not sure what it is though.

Dustin Getz (Hyperfiddle) 2025-07-12T15:00:14.796589Z

Hi Thomas thanks for pointing that out we will upgrade our deps asap

Dustin Getz (Hyperfiddle) 2025-07-12T15:00:22.737659Z

In the meantime please just clone the starter app and don't change the deps

๐Ÿ‘ 1
thomas 2025-07-11T13:58:02.017269Z

upgrading to the latest cljs seems to cause problems as well

๐Ÿ‘€ 1
Geoffrey Gaillard 2025-07-11T15:06:59.374109Z

We havenโ€™t upgraded cljs in quite some time. Is there a feature or fix you need from a more recent cljs version?

thomas 2025-07-11T15:37:58.388909Z

No, I just tend to use the latest of everything.

Geoffrey Gaillard 2025-07-11T15:10:53.375379Z

Published a new Electric snapshot: โ€ข breaking: stricter unserializable value guards. โ—ฆ we are not expecting any actual breakage, but there could be some in principle. โ—ฆ we discovered transit serializes java Object to nil and js/Object to {}. While these two should be harmless, we do not know if other types could be implicitly serialized today, or in the future. As a matter of precaution and to prevent any accidental or unexpected object transfers, Electric will now only accept to serialize objects with an explicit transit write handler. โ€ข compiler improvements: โ—ฆ fix clojure.core/delay usage in cljs blocks โ—ฆ fix foo.bar.Baz syntax support in cljs โ—ฆ improved macro support in cljs (e.g. encore and telemere) โ—ฆ improved zprint and SCI compat (calling zprint or SCI from Electric) https://docs.google.com/document/d/17BE7xpV9bFoPq9scLJHCF8hD5gBm00K0Up45N3XeG5c/edit?tab=t.0

๐Ÿ’ฏ 3
borkdude 2025-07-11T15:12:23.046989Z

improved zprint and sci compat? ๐Ÿ‘€

Geoffrey Gaillard 2025-07-11T15:14:12.344889Z

improved zprint and sci compat?https://github.com/hyperfiddle/electric/commit/257ef44b5f9feaaf81aeef551f2af527eacdb180

borkdude 2025-07-11T15:16:31.443239Z

does this mean electric can run in SCI?

Geoffrey Gaillard 2025-07-11T15:18:24.538399Z

I donโ€™t know (I donโ€™t think so). This fix is about calling SCI from Electric, not the other way around. Sorry for the confusion.

borkdude 2025-07-11T15:18:58.555249Z

ah no worries, it just got me curious :)

Geoffrey Gaillard 2025-07-11T15:20:24.800579Z

Someday ๐Ÿคž

2025-07-11T19:13:24.170969Z

thanks for the release! confirmed telemere logging is working in both clj and cljs

๐Ÿ™Œ 1
2025-07-11T18:58:56.816629Z

Hi. I have a macro that is misbehaving with the new Electric snapshot. It was fine before. See in thread for details.

2025-07-12T08:14:04.849379Z

> unless you call this macro from an e/defn I only call my macro from the top level.

2025-07-12T08:17:17.546899Z

From the error message, it seems that this is about whether subforms of do are processed separately as top-level forms, or whether the do form as a whole gets processed all together. FWIW, I know Common Lisp clearly states that subforms of progn are processed as top-level forms, but Iโ€™m struggling to find a similar statement for Clojureโ€™s do. Although a little experimenting shows that it does seem to be the case.

2025-07-12T08:17:54.990509Z

Anyway, as I said, no urgency. Have a good weekend!

2025-07-13T03:57:42.553859Z

https://technomancy.us/143

๐Ÿ™ 1
2025-07-15T20:39:43.424789Z

I asked about top-level do in #clojure. You might want to look at the discussion at https://clojurians.slack.com/archives/C03S1KBA2/p1752422724214819

๐Ÿ‘€ 1
2025-07-15T20:40:25.641299Z

Some interesting stuff!

2025-07-11T18:59:25.282269Z

(No urgency. I have a workaround.)

2025-07-11T19:00:13.966919Z

2025-07-11T19:00:40.320329Z

(FWIW, it defines a CLJS atom that tracks the latest value of an Electric signal. Maybe this is a bad idea and there are better ways of achieving what I want, but I think thatโ€™s by the by.)

2025-07-11T19:00:51.060579Z

I call it like this:

2025-07-11T19:01:13.544079Z

2025-07-11T19:01:52.598639Z

When I first connect to a REPL, I get the following error:

Exception in thread "main" Syntax error macroexpanding hyperfiddle.electric3/defn [...]

my-ns/Maintain-my-cljs-name::
I cannot resolve [!my-atom-name]

2025-07-11T19:02:21.096939Z

If I change the when cljs? in the macro definition to when true, I can start a REPL with no problem.

2025-07-11T19:02:22.002929Z

I can then revert the change, and running (dev/-main) works fine.

2025-07-11T19:02:54.035609Z

Maybe the macro changes in the new snapshot have broken something.

Geoffrey Gaillard 2025-07-11T20:43:13.972469Z

Thank you for this detailed report. > Maybe the macro changes in the new snapshot have broken something. > I share your intuition. Though I'm not yet clear if the release broke something or if something was working by accident before. Eyeballing your macro impl I noticed you detect cljs vs clj with (:ns &env) . Try with (:js-globals &env) instead. We've found it to be a more reliable check overall.

Geoffrey Gaillard 2025-07-11T20:47:35.512909Z

And not just in Electric. After years of dealing with tools.analyzer and clj/cljs compilers, we now default to (:js-globals &env). TBH I don't remember why.

2025-07-11T21:08:52.726229Z

Thanks โ€” itโ€™s good to know about :js-globals. I gave it a go but (:js-globals &env) is behaving in the same way as (:ns &env).

๐Ÿ‘€ 1
xificurC 2025-07-11T21:31:32.804149Z

We used to fill in :ns in electric and we don't for this exact reason, people check for cljs env that way. Although I don't see how that breaks here, unless you call this macro from an e/defn